Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into main-github
Browse files Browse the repository at this point in the history
  • Loading branch information
Dot-Liu committed Sep 28, 2022
2 parents fc5ffd4 + a833ca9 commit bac9936
Show file tree
Hide file tree
Showing 33 changed files with 2,679 additions and 71 deletions.
1 change: 1 addition & 0 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func NewAccountHandler(userDetailsService IUserDetailsService, ser http.Handler,
srv.HandleFunc("/logout", accountHandler.logoutHandler)
srv.HandleFunc("/api/", accountHandler.Api)
srv.HandleFunc("/profession/", accountHandler.Api)
srv.HandleFunc("/setting/", accountHandler.Api)
srv.HandleFunc("/", accountHandler.View)
return srv
}
Expand Down
8 changes: 5 additions & 3 deletions app/apinto-dashboard/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package main

import (
"fmt"
"io/ioutil"
"strings"

apinto "github.com/eolinker/apinto-dashboard"
"github.com/eolinker/apinto-dashboard/modules/professions"
yaml "gopkg.in/yaml.v2"
"io/ioutil"
"strings"
)

type ProfessionConfigItem struct {
Expand All @@ -15,6 +16,7 @@ type ProfessionConfigItem struct {
Titles map[string][]string `yaml:"titles"`
Fields []string `yaml:"fields"`
Profession string `yaml:"profession"`
Disable bool `yaml:"disable"`
}

type UserDetailsConfig struct {
Expand Down Expand Up @@ -91,7 +93,7 @@ func toModule(c *Config) []*apinto.Module {
Handler: professions.NewProfession(cm.Name, cm.Profession, titles, fields, nil),
Name: cm.Name,
I18nName: make(map[apinto.ZoneName]string),
NotView: false,
//NotView: cm.Disable,
}
for k, v := range cm.I18nNames {
m.I18nName[apinto.ZoneName(strings.ToLower(k))] = v
Expand Down
35 changes: 29 additions & 6 deletions app/apinto-dashboard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import (
"fmt"
"os"

"github.com/eolinker/apinto-dashboard/modules/apps"

apinto "github.com/eolinker/apinto-dashboard"
"github.com/eolinker/apinto-dashboard/internal/activity-log/sqlite"
apintoClient "github.com/eolinker/apinto-dashboard/internal/apinto"
"github.com/eolinker/apinto-dashboard/internal/security"
activity_log "github.com/eolinker/apinto-dashboard/modules/activity-log"
"github.com/eolinker/apinto-dashboard/modules/render"

"net/http"
"strings"
Expand Down Expand Up @@ -85,6 +88,25 @@ func main() {
Handler: routersModule,
Path: "/skill/routers",
})
appModule := apps.NewApps("apps")
config.Modules = append(config.Modules, &apinto.Module{
Path: "/apps/list",
Handler: appModule,
Name: "apps",
I18nName: map[apinto.ZoneName]string{
apinto.ZhCn: "应用",
apinto.EnUs: "Apps",
},
}, &apinto.Module{
Handler: appModule,
Path: "/profession/apps/",
NotView: true,
}, &apinto.Module{
NotView: true,
Handler: appModule,
Path: "/skill/apps",
})

ms := toModule(cf)
config.Modules = append(config.Modules, ms...)

Expand All @@ -99,6 +121,13 @@ func main() {
},
})

renderModule := render.NewRender()
config.Modules = append(config.Modules, &apinto.Module{
Handler: renderModule,
Path: "/setting/",
NotView: true,
})

activityLogModule, err := activity_log.NewActivityLog("activity-log", activityHandler)
if err != nil {
log.Panic(err)
Expand All @@ -125,12 +154,6 @@ func main() {
},
})

config.Statics = map[string]string{
"": "./static",
"js": "./static/js",
"umd": "./static/umd",
//"css":"./static/css",
}
service, err := apinto.Create(config)

if err != nil {
Expand Down
1 change: 1 addition & 0 deletions builds/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/data/
*.DS_Store
10 changes: 5 additions & 5 deletions builds/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ professions:
i18n_name:
zh_cn: 上游服务
en_us: upstream services
- name: templates
profession: template
i18n_name:
zh_cn: 模版
en_us: template
- name: discoveries
profession: discovery
i18n_name:
zh_cn: 服务发现
en_us: discoveries
- name: auths
profession: auth
i18n_name:
zh_cn: 鉴权
en_us: auths
- name: outputs
profession: output
i18n_name:
Expand Down
5 changes: 4 additions & 1 deletion builds/static/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ let dashboard = {
},
searchSkill:function (module,skill,success,error){
this.get(`/skill/${module}?skill=${skill}`, success, error)
}
},
additionRender:function (driver,success,error){
this.get(`/setting/${driver}`, success, error)
},
}
let common = {
/**
Expand Down
Loading

0 comments on commit bac9936

Please sign in to comment.