This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-06-16 13:39:03 +08:00
parent 477773dbee
commit c2a4a69883
18 changed files with 82 additions and 61 deletions

View File

@ -23,7 +23,8 @@ func (s allow) Create(m *ice.Message, arg ...string) {
s.SendTemplate(m, "", "", m.Trans("please allow", "权限审批 请处理")) s.SendTemplate(m, "", "", m.Trans("please allow", "权限审批 请处理"))
} }
func (s allow) Remove(m *ice.Message, arg ...string) { func (s allow) Remove(m *ice.Message, arg ...string) {
s.Delete(m, m.OptionSimple(model.UID, model.PLACE_UID)...) m.Cmd(apply{}, s.Delete)
s.Delete(m.Options(model.UID, m.Option(model.ALLOW_UID)))
} }
func (s allow) List(m *ice.Message, arg ...string) { func (s allow) List(m *ice.Message, arg ...string) {
s.Tables(m, s.apply).FieldsWithCreatedAT(m, s.apply, s.Tables(m, s.apply).FieldsWithCreatedAT(m, s.apply,
@ -49,7 +50,7 @@ func (s allow) List(m *ice.Message, arg ...string) {
} }
m.Table(func(value ice.Maps) { m.Table(func(value ice.Maps) {
if AllowStatus(kit.Int(value[model.ALLOW_STATUS])) == AllowCreate { if AllowStatus(kit.Int(value[model.ALLOW_STATUS])) == AllowCreate {
m.PushButton(s.Reject, s.Approve, s.Remove) m.PushButton(s.Reject, s.Approve)
} else { } else {
m.PushButton() m.PushButton()
} }

View File

@ -9,23 +9,11 @@ import (
type city struct { type city struct {
Table Table
order string `data:"507"` order string `data:"602"`
role string `data:"tech"` role string `data:"tech"`
list string `name:"list name auto"` list string `name:"list name auto" help:"城市管理" icon:"bi bi-buildings"`
} }
func (s user) Init(m *ice.Message, arg ...string) {
cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL
cmdSpace[m.PrefixKey()] = "20240724-community"
}
func (s street) Init(m *ice.Message, arg ...string) {
cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL
cmdSpace[m.PrefixKey()] = "20240724-community"
}
func (s city) Init(m *ice.Message, arg ...string) {
cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL
cmdSpace[m.PrefixKey()] = "20240724-community"
}
func (s city) FindOrCreateByName(m *ice.Message, arg ...string) { func (s city) FindOrCreateByName(m *ice.Message, arg ...string) {
if msg := m.Cmd(s, s.Select, model.NAME, arg[1]); msg.Length() == 0 { if msg := m.Cmd(s, s.Select, model.NAME, arg[1]); msg.Length() == 0 {
msg := m.Cmd(s, s.Insert, model.NAME, arg[1]) msg := m.Cmd(s, s.Insert, model.NAME, arg[1])
@ -35,7 +23,7 @@ func (s city) FindOrCreateByName(m *ice.Message, arg ...string) {
} }
} }
func (s city) List(m *ice.Message, arg ...string) { func (s city) List(m *ice.Message, arg ...string) {
if len(arg) == 0 { if m.Display("/plugin/table.js"); len(arg) == 0 || arg[0] == m.Option(model.PLACE_UID) {
s.Select(m) s.Select(m)
s.SelectJoinAuth(m) s.SelectJoinAuth(m)
m.Table(func(value ice.Maps) { m.Table(func(value ice.Maps) {

View File

@ -50,7 +50,7 @@ type Table struct {
marketPlaceInfo string `name:"marketPlaceInfo" role:"void"` marketPlaceInfo string `name:"marketPlaceInfo" role:"void"`
messagePlaceInfo string `name:"messagePlaceInfo" role:"void"` messagePlaceInfo string `name:"messagePlaceInfo" role:"void"`
sendMessage string `name:"sendMessage from_user_uid*:select to_user_uid*:select title* content price" style:"notice" role:"worker"` sendMessage string `name:"sendMessage from_user_uid*:select to_user_uid*:select title* content price" style:"notice" role:"worker"`
userInfo string `name:"userInfo" help:"用户信息" role:"void"` userInfo string `name:"userInfo" help:"成员信息" role:"worker"`
noticeList string `name:"noticeList" role:"void"` noticeList string `name:"noticeList" role:"void"`
memberList string `name:"memberList" role:"void"` memberList string `name:"memberList" role:"void"`
applyCreate string `name:"applyCreate" role:"void"` applyCreate string `name:"applyCreate" role:"void"`
@ -307,7 +307,7 @@ func (s Table) SelectJoinBy(m *ice.Message, UID, TARGET_UID string, prefix strin
return m return m
} }
func (s Table) SelectJoinService(m *ice.Message, arg ...string) *ice.Message { func (s Table) SelectJoinService(m *ice.Message, arg ...string) *ice.Message {
kit.If(len(arg) == 0, func() { arg = append(arg, model.NODENAME, model.INDEX, model.NAME, model.ICON) }) kit.If(len(arg) == 0, func() { arg = append(arg, model.SPACE, model.INDEX, model.NAME, model.ICON) })
return s.SelectJoin(m, service{}, arg...) return s.SelectJoin(m, service{}, arg...)
} }
func (s Table) SelectJoinRecent(m *ice.Message, PLACE_UID string, arg ...string) *ice.Message { func (s Table) SelectJoinRecent(m *ice.Message, PLACE_UID string, arg ...string) *ice.Message {

View File

@ -8,12 +8,12 @@ import (
type domain struct { type domain struct {
Table Table
order string `data:"508"` order string `data:"603"`
role string `data:"tech"` role string `data:"tech"`
fields string `name:"name,order"` fields string `name:"name,order"`
create string `name:"create name* info" role:"tech"` create string `name:"create name* info" role:"tech"`
remove string `name:"remove" role:"tech"` remove string `name:"remove" role:"tech"`
list string `name:"list place_uid domain_uid auto" role:"void"` list string `name:"list place_uid domain_uid auto" help:"领域管理" icon:"bi bi-grid-3x2-gap" role:"void"`
} }
func (s domain) Create(m *ice.Message, arg ...string) { s.Insert(m, arg...) } func (s domain) Create(m *ice.Message, arg ...string) { s.Insert(m, arg...) }
@ -24,9 +24,8 @@ func (s domain) Remove(m *ice.Message, arg ...string) {
s.Delete(m.Options(model.UID, m.Option(model.DOMAIN_UID))) s.Delete(m.Options(model.UID, m.Option(model.DOMAIN_UID)))
} }
func (s domain) List(m *ice.Message, arg ...string) { func (s domain) List(m *ice.Message, arg ...string) {
m.Display("/plugin/table.js")
s.Fields(m, model.UID, model.NAME, "order") s.Fields(m, model.UID, model.NAME, "order")
if len(arg) < 2 { if m.Display("/plugin/table.js"); len(arg) == 0 || arg[0] == m.Option(model.PLACE_UID) {
s.Select(m).RenameAppend(model.UID, model.DOMAIN_UID).Action() s.Select(m).RenameAppend(model.UID, model.DOMAIN_UID).Action()
m.SortInt("order") m.SortInt("order")
} else { } else {

View File

@ -25,6 +25,7 @@ type member struct {
setInfo string `name:"setInfo info" help:"备注" role:"worker"` setInfo string `name:"setInfo info" help:"备注" role:"worker"`
setLanguage string `name:"setLanguage language" help:"语言" role:"worker"` setLanguage string `name:"setLanguage language" help:"语言" role:"worker"`
sessList string `name:"sessList" role:"leader"` sessList string `name:"sessList" role:"leader"`
userInfo string `name:"userInfo" help:"个人主页" role:"void"`
} }
func (s member) Remove(m *ice.Message, arg ...string) { func (s member) Remove(m *ice.Message, arg ...string) {

View File

@ -267,13 +267,14 @@ type Service struct {
db.ModelWithUID db.ModelWithUID
Icon string `gorm:"type:varchar(128)"` Icon string `gorm:"type:varchar(128)"`
Name string `gorm:"type:varchar(32)"` Name string `gorm:"type:varchar(32)"`
Space string `gorm:"type:varchar(64)"`
Index string `gorm:"type:varchar(64)"` Index string `gorm:"type:varchar(64)"`
Module string `gorm:"type:varchar(32)"` Module string `gorm:"type:varchar(64)"`
Version string `gorm:"type:varchar(32)"` Version string `gorm:"type:varchar(32)"`
Domain string `gorm:"type:varchar(255)"` Domain string `gorm:"type:varchar(255)"`
Portal string `gorm:"type:varchar(255)"` Portal string `gorm:"type:varchar(255)"`
Nodetype string `gorm:"type:varchar(32)"` Nodetype string `gorm:"type:varchar(32)"`
Nodename string `gorm:"type:varchar(32)"` Nodename string `gorm:"type:varchar(64)"`
Pathname string `gorm:"type:varchar(255)"` Pathname string `gorm:"type:varchar(255)"`
Hostname string `gorm:"type:varchar(32)"` Hostname string `gorm:"type:varchar(32)"`
Status uint8 `gorm:"default:0"` Status uint8 `gorm:"default:0"`

View File

@ -175,6 +175,7 @@ $output>fieldset.story>div.output div.item.card.loaded>div.output { background-c
$output fieldset.story.form>div.output>div.code>input[type=button] { font-size:18px; margin:10px; height:36px; } $output fieldset.story.form>div.output>div.code>input[type=button] { font-size:18px; margin:10px; height:36px; }
$output>fieldset.story.web.team.credit>div.output>div.code { margin-top:64px; } $output>fieldset.story.web.team.credit>div.output>div.code { margin-top:64px; }
$output fieldset.story.web.team.dashboard.summary>div.output { min-height:64px; } $output fieldset.story.web.team.dashboard.summary>div.output { min-height:64px; }
$output fieldset.story.web.team.production.coder>div.output { background-color:var(--output-bg-color); }
$output>fieldset.qrcode table.content td { text-align:center; } $output>fieldset.qrcode table.content td { text-align:center; }
$output>fieldset.market>div.output>div.list div.item.card img { height:48px; width:48px; min-width:48px; } $output>fieldset.market>div.output>div.list div.item.card img { height:48px; width:48px; min-width:48px; }
$output>fieldset.market>div.output>div.list div.item.card div.status>span.username { $output>fieldset.market>div.output>div.list div.item.card div.status>span.username {

View File

@ -85,17 +85,18 @@ func (s Portal) Run(m *ice.Message, arg ...string) {
return return
} }
s.DisplayBase(m, "common.js") s.DisplayBase(m, "common.js")
m.Option(model.SERVICE_UID, ServiceUID(m))
m.Option(model.COMMAND_UID, CommandUID(m, arg[0]))
m.OptionDefault(model.TO_USER_UID, m.Option(model.USER_UID))
defer func() { defer func() {
if kit.IndexOf(m.Appendv(ice.MSG_APPEND), model.TO_USER_UID) == -1 && if kit.IndexOf(m.Appendv(ice.MSG_APPEND), model.TO_USER_UID) == -1 &&
kit.IndexOf(m.Appendv(ice.KEY), model.TO_USER_UID) == -1 { kit.IndexOf(m.Appendv(ice.KEY), model.TO_USER_UID) == -1 {
m.Optionv(model.TO_USER_UID, []string{}) m.Optionv(model.TO_USER_UID, []string{})
} }
}() }()
m.OptionDefault(model.FROM_USER_UID, m.Option(ice.MSG_USERUID))
m.OptionDefault(model.TO_USER_UID, m.Option(model.USER_UID))
m.Option(model.USER_UID, m.Option(ice.MSG_USERUID)) m.Option(model.USER_UID, m.Option(ice.MSG_USERUID))
m.Option(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID))) m.Option(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))
m.Option(model.COMMAND_UID, CommandUID(m, arg[0]))
m.OptionDefault(model.SERVICE_UID, ServiceUID(m))
m.Search(arg[0], func(key string, cmd *ice.Command) { m.Search(arg[0], func(key string, cmd *ice.Command) {
role := cmd.Role role := cmd.Role
if len(arg) > 1 && arg[1] == ctx.ACTION { if len(arg) > 1 && arg[1] == ctx.ACTION {
@ -132,12 +133,7 @@ func (s Portal) Run(m *ice.Message, arg ...string) {
if len(arg) > 0 && strings.HasSuffix(arg[0], ".portal") { if len(arg) > 0 && strings.HasSuffix(arg[0], ".portal") {
return return
} }
if kit.IndexOf(arg, mdb.INPUTS) == -1 { if kit.IndexOf(arg, mdb.INPUTS) == -1 && !strings.HasSuffix(arg[1], ".member") {
defer func() {
if e := recover(); e != nil {
m.Info("what %v", m.FormatsMeta(nil))
}
}()
s.Place.RewriteAppend(m) s.Place.RewriteAppend(m)
} }
}) })

View File

@ -2,7 +2,9 @@ var UID = "uid", PLACE_UID = "place_uid", PLACE_NAME = "place_name", PLACE_TYPE
var USER_UID = "user_uid", USER_ROLE = "user_role", AUTH_UID = "auth_uid", AUTH_TYPE = "auth_type" var USER_UID = "user_uid", USER_ROLE = "user_role", AUTH_UID = "auth_uid", AUTH_TYPE = "auth_type"
var TYPE = "type", ROLE = "role", STATUS = "status" var TYPE = "type", ROLE = "role", STATUS = "status"
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { can.onappend.style(can, html.OUTPUT), can.onimport.myPortal(can, msg) }, _init: function(can, msg) {
can.onappend.style(can, html.OUTPUT), can.onimport.myPortal(can, msg)
},
qrcode: function(can, msg, avatar, target) { target = target||can.ui.output, can.onappend.board(can, msg, target) qrcode: function(can, msg, avatar, target) { target = target||can.ui.output, can.onappend.board(can, msg, target)
can.page.Append(can, can.page.SelectOne(can, target, "div.code"), [{img: can.misc.Resource(can, avatar||can.ConfIcons()||can.user.info.favicon), className: "avatar"}]) can.page.Append(can, can.page.SelectOne(can, target, "div.code"), [{img: can.misc.Resource(can, avatar||can.ConfIcons()||can.user.info.favicon), className: "avatar"}])
}, },

View File

@ -11,7 +11,7 @@
"marketPlaceEnter": "进入系统", "messagePlaceEnter": "进入系统", "marketPlaceEnter": "进入系统", "messagePlaceEnter": "进入系统",
"applyCreate": "申请权限", "commentCreate": "评论", "applyQRCode": "邀请码", "applyCreate": "申请权限", "commentCreate": "评论", "applyQRCode": "邀请码",
"config": "配置", "code": "编程", "data": "数据", "cache": "缓存", "config": "配置", "code": "编程", "data": "数据", "cache": "缓存",
"clean": "数据清理", "domain": "领域分类", "clean": "数据清理",
"icons": { "icons": {
"qrcode": "bi bi-qr-code", "qrcode": "bi bi-qr-code",
"apply": "bi bi-pencil-square", "apply": "bi bi-pencil-square",
@ -23,10 +23,7 @@
"recent": "bi bi-clock-history", "recent": "bi bi-clock-history",
"service": "bi bi-box", "service": "bi bi-box",
"support": "bi bi-opencollective", "support": "bi bi-opencollective",
"clean": "bi bi-recycle", "clean": "bi bi-recycle"
"user": "bi bi-recycle",
"city": "bi bi-recycle",
"domain": "bi bi-grid-3x2-gap"
}, },
"style": { "style": {
"marketPlaceEnter": "notice", "marketPlaceEnter": "notice",

View File

@ -45,9 +45,9 @@ func (s service) Inputs(m *ice.Message, arg ...string) {
func (s service) Update(m *ice.Message, arg ...string) { func (s service) Update(m *ice.Message, arg ...string) {
uid := ServiceUID(m) uid := ServiceUID(m)
if s.Select(m.Spawn(), model.UID, uid).Length() == 0 { if s.Select(m.Spawn(), model.UID, uid).Length() == 0 {
s.Insert(m, kit.Simple(model.UID, uid, model.INDEX, s.PrefixPortal(m), tcp.NODETYPE, ice.Info.NodeType, tcp.NODENAME, ice.Info.NodeName, nfs.PATHNAME, ice.Info.Pwd, tcp.HOSTNAME, ice.Info.Hostname)...) s.Insert(m, kit.Simple(model.UID, uid, model.SPACE, ice.Info.NodeName, model.INDEX, s.PrefixPortal(m), tcp.NODETYPE, ice.Info.NodeType, tcp.NODENAME, ice.Info.NodeName, nfs.PATHNAME, ice.Info.Pwd, tcp.HOSTNAME, ice.Info.Hostname)...)
} }
s.Table.Update(m, kit.Dict(arg, m.OptionSimple(mdb.NAME, mdb.ICON), nfs.MODULE, ice.Info.Make.Module, nfs.VERSION, ice.Info.Make.Versions()), model.UID, uid) s.Table.Update(m, kit.Dict(arg, m.OptionSimple(mdb.NAME, mdb.ICON), model.SPACE, ice.Info.NodeName, nfs.MODULE, ice.Info.Make.Module, nfs.VERSION, ice.Info.Make.Versions()), model.UID, uid)
m.Cmd(s.PrefixPortal(m), Portal{}.CommandUpdate, uid) m.Cmd(s.PrefixPortal(m), Portal{}.CommandUpdate, uid)
} }
func (s service) Oauth(m *ice.Message, arg ...string) { func (s service) Oauth(m *ice.Message, arg ...string) {
@ -124,7 +124,7 @@ func (s service) List(m *ice.Message, arg ...string) {
m.Action() m.Action()
} }
}) })
m.RenameAppend(model.NODENAME, model.SPACE, model.NODETYPE, model.SERVICE_TYPE, mdb.STATUS, model.SERVICE_STATUS) m.RenameAppend(model.NODETYPE, model.SERVICE_TYPE, mdb.STATUS, model.SERVICE_STATUS)
s.DisplayBase(m, "") s.DisplayBase(m, "")
} }
func (s service) Open(m *ice.Message, arg ...string) { func (s service) Open(m *ice.Message, arg ...string) {

View File

@ -12,10 +12,12 @@ import (
type sess struct { type sess struct {
Table Table
user user user user
order string `data:"605"`
role string `data:"tech"`
fields string `data:"user_uid,agent,system,location,ip,ua"` fields string `data:"user_uid,agent,system,location,ip,ua"`
create string `name:"create user_uid*"` create string `name:"create user_uid*"`
check string `name:"check" role:"void"` check string `name:"check" role:"void"`
list string `name:"list uid auto" role:"void"` list string `name:"list uid auto" help:"会话管理" icon:"bi bi-people" role:"void"`
} }
func (s sess) Create(m *ice.Message, arg ...string) { func (s sess) Create(m *ice.Message, arg ...string) {
@ -25,10 +27,10 @@ func (s sess) Create(m *ice.Message, arg ...string) {
m.ProcessCookie(ice.MSG_SESSID, m.Option(ice.MSG_SESSID, kit.JoinWord(web.SPACE, m.Option(ice.MSG_USERPOD), m.PrefixKey(), aaa.CHECK, m.Result())), "-2") m.ProcessCookie(ice.MSG_SESSID, m.Option(ice.MSG_SESSID, kit.JoinWord(web.SPACE, m.Option(ice.MSG_USERPOD), m.PrefixKey(), aaa.CHECK, m.Result())), "-2")
} }
func (s sess) List(m *ice.Message, arg ...string) { func (s sess) List(m *ice.Message, arg ...string) {
if len(arg) == 0 { if m.Display("/plugin/table.js"); len(arg) == 0 || arg[0] == m.Option(model.PLACE_UID) {
if m.IsTech() { if m.IsTech() {
s.Tables(m, user{}).FieldsWithCreatedAT(m, s, kit.Split("user_uid,name,info,avatar,background,agent,system,location,ip,ua")).Limit(m, 3000) s.Tables(m, user{}).FieldsWithCreatedAT(m, s, kit.Split("user_uid,name,info,avatar,background,agent,system,location,ip,ua")).Limit(m, 3000)
s.Select(m, arg...).PushAction(s.Remove).Action(s.Repair) s.Select(m).PushAction(s.Remove).Action(s.Repair)
} }
} else { } else {
s.SelectDetail(m, s.Key(s, model.UID), arg[0]) s.SelectDetail(m, s.Key(s, model.UID), arg[0])

View File

@ -118,6 +118,9 @@ func (s setting) List(m *ice.Message, arg ...string) {
func init() { ice.TeamCtxCmd(setting{Table: newTable()}) } func init() { ice.TeamCtxCmd(setting{Table: newTable()}) }
func (s Table) HashSelect(m *ice.Message, arg ...string) {
s.Hash.Select(m, arg...)
}
func (s Table) SettingCreate(m *ice.Message, arg ...string) { func (s Table) SettingCreate(m *ice.Message, arg ...string) {
m.Cmdy(s.PrefixSetting(m), s.Create, model.NAME, arg[0], m.Cmdy(s.PrefixSetting(m), s.Create, model.NAME, arg[0],
model.TYPE, kit.Select(SETTING_RADIO, arg, 1), model.TYPE, kit.Select(SETTING_RADIO, arg, 1),
@ -128,6 +131,9 @@ func (s Table) SettingCreate(m *ice.Message, arg ...string) {
) )
} }
func (s Table) SettingSelect(m *ice.Message, arg ...string) { func (s Table) SettingSelect(m *ice.Message, arg ...string) {
m.Cmd(s.PrefixSetting(m), s.HashSelect).Table(func(value ice.Maps) {
m.Option(value[model.NAME], value["default"])
})
m.Cmd(s.PrefixSetting(m), s.Select, m.OptionSimple(model.PLACE_UID)).Table(func(value ice.Maps) { m.Cmd(s.PrefixSetting(m), s.Select, m.OptionSimple(model.PLACE_UID)).Table(func(value ice.Maps) {
if value[model.USER_UID] != "" && value[model.USER_UID] != m.Option(model.USER_UID) { if value[model.USER_UID] != "" && value[model.USER_UID] != m.Option(model.USER_UID) {
return return

View File

@ -9,9 +9,31 @@ import (
type street struct { type street struct {
Table Table
list string `name:"list uid auto"` order string `data:"601"`
role string `data:"tech"`
list string `name:"list uid auto" help:"街道管理" icon:"bi bi-buildings"`
} }
func (s sess) Init(m *ice.Message, arg ...string) {
cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL
cmdSpace[m.PrefixKey()] = "20240724-community"
}
func (s user) Init(m *ice.Message, arg ...string) {
cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL
cmdSpace[m.PrefixKey()] = "20240724-community"
}
func (s domain) Init(m *ice.Message, arg ...string) {
cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL
cmdSpace[m.PrefixKey()] = "20240724-community"
}
func (s city) Init(m *ice.Message, arg ...string) {
cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL
cmdSpace[m.PrefixKey()] = "20240724-community"
}
func (s street) Init(m *ice.Message, arg ...string) {
cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL
cmdSpace[m.PrefixKey()] = "20240724-community"
}
func (s street) FindOrCreateByName(m *ice.Message, arg ...string) { func (s street) FindOrCreateByName(m *ice.Message, arg ...string) {
if msg := m.Cmd(s, s.Select, model.CITY_UID, arg[1], model.NAME, arg[3]); msg.Length() == 0 { if msg := m.Cmd(s, s.Select, model.CITY_UID, arg[1], model.NAME, arg[3]); msg.Length() == 0 {
msg := m.Cmd(s, s.Insert, model.CITY_UID, arg[1], model.NAME, arg[3]) msg := m.Cmd(s, s.Insert, model.CITY_UID, arg[1], model.NAME, arg[3])
@ -21,7 +43,7 @@ func (s street) FindOrCreateByName(m *ice.Message, arg ...string) {
} }
} }
func (s street) List(m *ice.Message, arg ...string) { func (s street) List(m *ice.Message, arg ...string) {
if len(arg) == 0 { if m.Display("/plugin/table.js"); len(arg) == 0 || arg[0] == m.Option(model.PLACE_UID) {
s.Select(m).Table(func(value ice.Maps) { s.Select(m).Table(func(value ice.Maps) {
if value[model.AUTH_UID] == "" && m.IsTech() { if value[model.AUTH_UID] == "" && m.IsTech() {
m.PushButton(s.AuthCreate, s.Delete) m.PushButton(s.AuthCreate, s.Delete)

View File

@ -18,13 +18,13 @@ import (
type user struct { type user struct {
Table Table
setting setting setting setting
order string `data:"509"` order string `data:"604"`
role string `data:"tech"` role string `data:"tech"`
template string `data:"zJjgEbfiVKgJ_eDLfvHB_lXEzitNuxwZk0UHeTsFRns"` template string `data:"zJjgEbfiVKgJ_eDLfvHB_lXEzitNuxwZk0UHeTsFRns"`
fields string `data:"auth_uid,open_id,language,name,info,avatar,background,status"` fields string `data:"auth_uid,open_id,language,name,info,avatar,background,status"`
create string `name:"create open_id* avatar usernick"` create string `name:"create open_id* avatar usernick"`
modify string `name:"modify info" role:"void"` modify string `name:"modify info" role:"void"`
list string `name:"list uid auto" role:"void"` list string `name:"list uid auto" help:"用户管理" icon:"bi bi-people" role:"void"`
setCookie string `name:"setCookie" help:"切换"` setCookie string `name:"setCookie" help:"切换"`
sendCookie string `name:"sendCookie" help:"授权" role:"void"` sendCookie string `name:"sendCookie" help:"授权" role:"void"`
authRemove string `name:"authRemove" help:"删除认证" role:"void"` authRemove string `name:"authRemove" help:"删除认证" role:"void"`
@ -51,10 +51,10 @@ func (s user) Remove(m *ice.Message, arg ...string) {
func (s user) List(m *ice.Message, arg ...string) { func (s user) List(m *ice.Message, arg ...string) {
s.Tables(m, "LEFT JOIN sesses ON users.uid = sesses.user_uid").Groups(m, "user_uid").Orders(m, s.Desc("sesses.created_at")) s.Tables(m, "LEFT JOIN sesses ON users.uid = sesses.user_uid").Groups(m, "user_uid").Orders(m, s.Desc("sesses.created_at"))
s.FieldsWithCreatedAT(m, s, kit.Split("auth_uid,name,info,avatar,background,status,agent,system,location,ip,ua")).Limit(m, 3000) s.FieldsWithCreatedAT(m, s, kit.Split("auth_uid,name,info,avatar,background,status,agent,system,location,ip,ua")).Limit(m, 3000)
if len(arg) == 0 { if m.Display("/plugin/table.js"); len(arg) == 0 || arg[0] == m.Option(model.PLACE_UID) {
if m.IsTech() { if m.IsTech() {
s.Limit(m, 3000) s.Limit(m, 3000)
s.Select(m, arg...) s.Select(m)
m.EchoQRCode(m.MergePodCmd("", m.PrefixKey()+"/action/sendCookie", ice.FROM_DAEMON, m.Option(ice.MSG_DAEMON))).Echo("<br/>").Echo("请扫码授权") m.EchoQRCode(m.MergePodCmd("", m.PrefixKey()+"/action/sendCookie", ice.FROM_DAEMON, m.Option(ice.MSG_DAEMON))).Echo("<br/>").Echo("请扫码授权")
m.StatusTimeCount(mdb.TOTAL, s.SelectTotal(m)) m.StatusTimeCount(mdb.TOTAL, s.SelectTotal(m))
} }
@ -73,14 +73,13 @@ func (s user) List(m *ice.Message, arg ...string) {
} }
button = append(button, s.AuthRemove) button = append(button, s.AuthRemove)
if m.IsTech() && value[model.UID] != m.Option(ice.MSG_USERUID) { if m.IsTech() && value[model.UID] != m.Option(ice.MSG_USERUID) {
button = append(button, s.SetCookie, s.Remove) button = append(button, s.SetCookie)
}
if m.IsTech() {
if value[model.STATUS] == "1" { if value[model.STATUS] == "1" {
button = append(button, s.Enable) button = append(button, s.Enable)
} else { } else {
button = append(button, s.Disable) button = append(button, s.Disable)
} }
button = append(button, s.Remove)
} }
}) })
} }

View File

@ -12,6 +12,6 @@ import (
func main() { print(ice.Run()) } func main() { print(ice.Run()) }
func init() { func init() {
ice.Info.CodeMain = "src/renzhengshouquan/portal.go" ice.Info.CodeMain = "src/gonganxitong/portal.go"
ice.Info.NodeMain = "web.team.renzhengshouquan.portal" ice.Info.NodeMain = "web.team.gonganxitong.portal"
} }

View File

@ -53,7 +53,7 @@ func (s Auth) List(m *ice.Message, arg ...string) {
} }
switch AuthStatus(kit.Int(value[model.AUTH_STATUS])) { switch AuthStatus(kit.Int(value[model.AUTH_STATUS])) {
case AuthCreate: case AuthCreate:
button = append(button, s.Issue) button = append(button, s.Issue, s.Delete)
case AuthIssued: case AuthIssued:
button = append(button, s.SetScore, s.Revoke) button = append(button, s.SetScore, s.Revoke)
case AuthRevoked: case AuthRevoked:

View File

@ -18,6 +18,7 @@ type profile struct {
serviceList string `name:"serviceList" role:"void"` serviceList string `name:"serviceList" role:"void"`
fromList string `name:"fromList" role:"void"` fromList string `name:"fromList" role:"void"`
authPersonal string `name:"authPersonal" role:"void"` authPersonal string `name:"authPersonal" role:"void"`
open string `name:"open" role:"void"`
} }
func (s profile) Modify(m *ice.Message, arg ...string) { func (s profile) Modify(m *ice.Message, arg ...string) {
@ -36,7 +37,7 @@ func (s profile) List(m *ice.Message, arg ...string) {
case AuthService: case AuthService:
s.SelectJoinRecent(m, "") s.SelectJoinRecent(m, "")
s.SelectJoinService(m) s.SelectJoinService(m)
button = append(button, s.Enter) button = append(button, s.Enter, s.Open)
name = kit.JoinWord(m.Append(model.CITY_NAME), m.Append(model.STREET_NAME), m.Append(model.PLACE_NAME)) name = kit.JoinWord(m.Append(model.CITY_NAME), m.Append(model.STREET_NAME), m.Append(model.PLACE_NAME))
case AuthCompany: case AuthCompany:
case AuthPersonal: case AuthPersonal:
@ -53,7 +54,7 @@ func (s profile) AuthList(m *ice.Message, arg ...string) {
if value[model.PLACE_UID] == "" { if value[model.PLACE_UID] == "" {
m.PushButton() m.PushButton()
} else { } else {
m.PushButton(s.Enter) m.PushButton(s.Enter, s.Open)
} }
}) })
s.SelectJoinRecent(m, "") s.SelectJoinRecent(m, "")
@ -87,7 +88,7 @@ func (s profile) ServiceList(m *ice.Message, arg ...string) {
s.SelectList(m, kit.Simple(model.PLACE_UID, kit.Sort(list))...) s.SelectList(m, kit.Simple(model.PLACE_UID, kit.Sort(list))...)
s.SelectJoinRecent(m, "") s.SelectJoinRecent(m, "")
s.SelectJoinService(m) s.SelectJoinService(m)
m.PushAction(s.Enter) m.PushAction(s.Enter, s.Open)
s.authSort(m) s.authSort(m)
} }
func (s profile) FromList(m *ice.Message, arg ...string) { func (s profile) FromList(m *ice.Message, arg ...string) {
@ -106,6 +107,11 @@ func (s profile) AuthPersonal(m *ice.Message, arg ...string) {
s.CreditCmdy(m, m.ActionKey(), arg) s.CreditCmdy(m, m.ActionKey(), arg)
} }
func (s profile) Enter(m *ice.Message, arg ...string) {} func (s profile) Enter(m *ice.Message, arg ...string) {}
func (s profile) Open(m *ice.Message, arg ...string) {
s.Select(m, m.OptionSimple(model.UID)...)
s.SelectJoinService(m)
m.ProcessOpen(s.SpaceLink(m, m.Append(model.SPACE), m.Append(model.INDEX), m.Append(model.PLACE_UID)))
}
func init() { ice.TeamCtxCmd(profile{}) } func init() { ice.TeamCtxCmd(profile{}) }