diff --git a/api.go b/api.go index a22862f..b863538 100644 --- a/api.go +++ b/api.go @@ -25,6 +25,11 @@ type ( OldPassword string `json:"old_password"` NewPassword string `json:"new_password"` } + + configureValue struct { + Attribute string `json:"attribute"` + Value string `json:"value"` + } ) func (svr *Server) handleLogin(ctx *http.Context) (err error) { @@ -96,7 +101,14 @@ func (svr *Server) handleUpdateProfile(ctx *http.Context) (err error) { } func (svr *Server) handleGetConfigure(ctx *http.Context) (err error) { - return ctx.Success(map[string]string{}) + ms := make([]configureValue, 0, len(svr.cfg.System.Settings)) + for k, v := range svr.cfg.System.Settings { + ms = append(ms, configureValue{ + Attribute: k, + Value: v, + }) + } + return ctx.Success(ms) } func (svr *Server) handleListSchema(ctx *http.Context) (err error) { diff --git a/config/config.go b/config/config.go index 4c99dab..1ad022a 100644 --- a/config/config.go +++ b/config/config.go @@ -13,9 +13,14 @@ type Avatar struct { Dirname string `json:"dirname" yaml:"dirname"` } +type System struct { + Settings map[string]string `json:"settings" yaml:"settings"` +} + type Config struct { - Database Database `json:"database" yaml:"database"` Avatar Avatar `json:"avatar" yaml:"avatar"` + System System `json:"system" yaml:"system"` + Database Database `json:"database" yaml:"database"` AdminUsers []string `json:"admin_users" yaml:"adminUsers"` } diff --git a/config/config.yaml b/config/config.yaml index ec01c8b..b08e3bf 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -5,4 +5,9 @@ database: database: "test2" adminUsers: - - "1000" \ No newline at end of file + - "1000" + +system: + settings: + productName: "测试网址" + copyright: "xxx" \ No newline at end of file diff --git a/web/release/index.html b/web/release/index.html index 6b45ccb..6adb8e3 100644 --- a/web/release/index.html +++ b/web/release/index.html @@ -7,7 +7,7 @@
H7(e,n,t),getStopIndexForStartIndex:(e,t,n,o)=>{const{height:r,total:a,layout:l,width:s}=e,i=Ri(l)?s:r,c=Nl(e,t,o),d=n+i;let f=c.offset+c.size,p=t;for(;p H7(e,n,t),getStopIndexForStartIndex:(e,t,n,o)=>{const{height:r,total:a,layout:l,width:s}=e,i=Ri(l)?s:r,c=Nl(e,t,o),d=n+i;let f=c.offset+c.size,p=t;for(;p {const o=Er(e,t,n,"column");return[o.size,o.offset]},getRowPosition:(e,t,n)=>{const o=Er(e,t,n,"row");return[o.size,o.offset]},getColumnOffset:(e,t,n,o,r,a)=>Py(e,t,n,o,r,"column",a),getRowOffset:(e,t,n,o,r,a)=>Py(e,t,n,o,r,"row",a),getColumnStartIndexForOffset:(e,t,n)=>My(e,n,t,"column"),getColumnStopIndexForStartIndex:(e,t,n,o)=>{const r=Er(e,t,o,"column"),a=n+e.width;let l=r.offset+r.size,s=t;for(;s