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", "权限审批 请处理"))
}
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) {
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) {
if AllowStatus(kit.Int(value[model.ALLOW_STATUS])) == AllowCreate {
m.PushButton(s.Reject, s.Approve, s.Remove)
m.PushButton(s.Reject, s.Approve)
} else {
m.PushButton()
}

View File

@ -9,23 +9,11 @@ import (
type city struct {
Table
order string `data:"507"`
order string `data:"602"`
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) {
if msg := m.Cmd(s, s.Select, model.NAME, arg[1]); msg.Length() == 0 {
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) {
if len(arg) == 0 {
if m.Display("/plugin/table.js"); len(arg) == 0 || arg[0] == m.Option(model.PLACE_UID) {
s.Select(m)
s.SelectJoinAuth(m)
m.Table(func(value ice.Maps) {

View File

@ -50,7 +50,7 @@ type Table struct {
marketPlaceInfo string `name:"marketPlaceInfo" 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"`
userInfo string `name:"userInfo" help:"用户信息" role:"void"`
userInfo string `name:"userInfo" help:"成员信息" role:"worker"`
noticeList string `name:"noticeList" role:"void"`
memberList string `name:"memberList" 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
}
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...)
}
func (s Table) SelectJoinRecent(m *ice.Message, PLACE_UID string, arg ...string) *ice.Message {

View File

@ -8,12 +8,12 @@ import (
type domain struct {
Table
order string `data:"508"`
order string `data:"603"`
role string `data:"tech"`
fields string `name:"name,order"`
create string `name:"create name* info" 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...) }
@ -24,9 +24,8 @@ func (s domain) Remove(m *ice.Message, arg ...string) {
s.Delete(m.Options(model.UID, m.Option(model.DOMAIN_UID)))
}
func (s domain) List(m *ice.Message, arg ...string) {
m.Display("/plugin/table.js")
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()
m.SortInt("order")
} else {

View File

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

View File

@ -267,13 +267,14 @@ type Service struct {
db.ModelWithUID
Icon string `gorm:"type:varchar(128)"`
Name string `gorm:"type:varchar(32)"`
Space 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)"`
Domain string `gorm:"type:varchar(255)"`
Portal string `gorm:"type:varchar(255)"`
Nodetype string `gorm:"type:varchar(32)"`
Nodename string `gorm:"type:varchar(32)"`
Nodename string `gorm:"type:varchar(64)"`
Pathname string `gorm:"type:varchar(255)"`
Hostname string `gorm:"type:varchar(32)"`
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.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.production.coder>div.output { background-color:var(--output-bg-color); }
$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 div.status>span.username {

View File

@ -85,17 +85,18 @@ func (s Portal) Run(m *ice.Message, arg ...string) {
return
}
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() {
if kit.IndexOf(m.Appendv(ice.MSG_APPEND), model.TO_USER_UID) == -1 &&
kit.IndexOf(m.Appendv(ice.KEY), model.TO_USER_UID) == -1 {
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.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) {
role := cmd.Role
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") {
return
}
if kit.IndexOf(arg, mdb.INPUTS) == -1 {
defer func() {
if e := recover(); e != nil {
m.Info("what %v", m.FormatsMeta(nil))
}
}()
if kit.IndexOf(arg, mdb.INPUTS) == -1 && !strings.HasSuffix(arg[1], ".member") {
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 TYPE = "type", ROLE = "role", STATUS = "status"
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)
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": "进入系统",
"applyCreate": "申请权限", "commentCreate": "评论", "applyQRCode": "邀请码",
"config": "配置", "code": "编程", "data": "数据", "cache": "缓存",
"clean": "数据清理", "domain": "领域分类",
"clean": "数据清理",
"icons": {
"qrcode": "bi bi-qr-code",
"apply": "bi bi-pencil-square",
@ -23,10 +23,7 @@
"recent": "bi bi-clock-history",
"service": "bi bi-box",
"support": "bi bi-opencollective",
"clean": "bi bi-recycle",
"user": "bi bi-recycle",
"city": "bi bi-recycle",
"domain": "bi bi-grid-3x2-gap"
"clean": "bi bi-recycle"
},
"style": {
"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) {
uid := ServiceUID(m)
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)
}
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.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, "")
}
func (s service) Open(m *ice.Message, arg ...string) {

View File

@ -12,10 +12,12 @@ import (
type sess struct {
Table
user user
order string `data:"605"`
role string `data:"tech"`
fields string `data:"user_uid,agent,system,location,ip,ua"`
create string `name:"create user_uid*"`
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) {
@ -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")
}
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() {
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 {
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 (s Table) HashSelect(m *ice.Message, arg ...string) {
s.Hash.Select(m, arg...)
}
func (s Table) SettingCreate(m *ice.Message, arg ...string) {
m.Cmdy(s.PrefixSetting(m), s.Create, model.NAME, arg[0],
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) {
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) {
if value[model.USER_UID] != "" && value[model.USER_UID] != m.Option(model.USER_UID) {
return

View File

@ -9,9 +9,31 @@ import (
type street struct {
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) {
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])
@ -21,7 +43,7 @@ func (s street) FindOrCreateByName(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) {
if value[model.AUTH_UID] == "" && m.IsTech() {
m.PushButton(s.AuthCreate, s.Delete)

View File

@ -18,13 +18,13 @@ import (
type user struct {
Table
setting setting
order string `data:"509"`
order string `data:"604"`
role string `data:"tech"`
template string `data:"zJjgEbfiVKgJ_eDLfvHB_lXEzitNuxwZk0UHeTsFRns"`
fields string `data:"auth_uid,open_id,language,name,info,avatar,background,status"`
create string `name:"create open_id* avatar usernick"`
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:"切换"`
sendCookie string `name:"sendCookie" 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) {
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)
if len(arg) == 0 {
if m.Display("/plugin/table.js"); len(arg) == 0 || arg[0] == m.Option(model.PLACE_UID) {
if m.IsTech() {
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.StatusTimeCount(mdb.TOTAL, s.SelectTotal(m))
}
@ -73,14 +73,13 @@ func (s user) List(m *ice.Message, arg ...string) {
}
button = append(button, s.AuthRemove)
if m.IsTech() && value[model.UID] != m.Option(ice.MSG_USERUID) {
button = append(button, s.SetCookie, s.Remove)
}
if m.IsTech() {
button = append(button, s.SetCookie)
if value[model.STATUS] == "1" {
button = append(button, s.Enable)
} else {
button = append(button, s.Disable)
}
button = append(button, s.Remove)
}
})
}

View File

@ -12,6 +12,6 @@ import (
func main() { print(ice.Run()) }
func init() {
ice.Info.CodeMain = "src/renzhengshouquan/portal.go"
ice.Info.NodeMain = "web.team.renzhengshouquan.portal"
ice.Info.CodeMain = "src/gonganxitong/portal.go"
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])) {
case AuthCreate:
button = append(button, s.Issue)
button = append(button, s.Issue, s.Delete)
case AuthIssued:
button = append(button, s.SetScore, s.Revoke)
case AuthRevoked:

View File

@ -18,6 +18,7 @@ type profile struct {
serviceList string `name:"serviceList" role:"void"`
fromList string `name:"fromList" role:"void"`
authPersonal string `name:"authPersonal" role:"void"`
open string `name:"open" role:"void"`
}
func (s profile) Modify(m *ice.Message, arg ...string) {
@ -36,7 +37,7 @@ func (s profile) List(m *ice.Message, arg ...string) {
case AuthService:
s.SelectJoinRecent(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))
case AuthCompany:
case AuthPersonal:
@ -53,7 +54,7 @@ func (s profile) AuthList(m *ice.Message, arg ...string) {
if value[model.PLACE_UID] == "" {
m.PushButton()
} else {
m.PushButton(s.Enter)
m.PushButton(s.Enter, s.Open)
}
})
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.SelectJoinRecent(m, "")
s.SelectJoinService(m)
m.PushAction(s.Enter)
m.PushAction(s.Enter, s.Open)
s.authSort(m)
}
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)
}
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{}) }