mirror of
https://shylinux.com/x/operation
synced 2025-04-25 01:08:04 +08:00
add some
This commit is contained in:
parent
484edfe48d
commit
0dced97b0f
@ -2,6 +2,9 @@ package development
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/nfs"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/operation/src/development/model"
|
||||
@ -19,6 +22,22 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
s.InputsListRole(m, UserReposRoleList, arg...)
|
||||
case model.REPOS_TYPE:
|
||||
s.InputsList(m, ReposTypeList, arg...)
|
||||
case model.REPOS_NAME:
|
||||
switch ReposType(kit.Int(m.Option(model.REPOS_TYPE))) {
|
||||
case ReposSystem:
|
||||
m.Cmdy(web.SPACE, ice.OPS, web.DREAM).CutTo(mdb.NAME, arg[0])
|
||||
case ReposLibrary:
|
||||
m.Cmdy(web.CODE_GIT_REPOS).CutTo(nfs.REPOS, arg[0])
|
||||
case ReposGithub:
|
||||
}
|
||||
case model.REPOS_LINK:
|
||||
switch ReposType(kit.Int(m.Option(model.REPOS_TYPE))) {
|
||||
case ReposSystem:
|
||||
m.Cmdy(web.SPACE, ice.OPS, web.DREAM).CutTo(nfs.REPOS, arg[0])
|
||||
case ReposLibrary:
|
||||
m.Cmdy(web.CODE_GIT_REPOS).CutTo(web.ORIGIN, arg[0])
|
||||
case ReposGithub:
|
||||
}
|
||||
default:
|
||||
s.Table.Inputs(m, arg...)
|
||||
}
|
||||
|
33
src/development/history.go
Normal file
33
src/development/history.go
Normal file
@ -0,0 +1,33 @@
|
||||
package development
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/operation/src/development/model"
|
||||
)
|
||||
|
||||
type history struct {
|
||||
Tables
|
||||
repos repos
|
||||
order string `data:"1"`
|
||||
list string `name:"list repos_uid commit file auto" role:"void"`
|
||||
}
|
||||
|
||||
func (s history) List(m *ice.Message, arg ...string) {
|
||||
msg := m.Cmd(s.repos, s.Select, model.UID, arg[0])
|
||||
switch ReposType(kit.Int(msg.Append(model.TYPE))) {
|
||||
case ReposSystem:
|
||||
m.Cmdy(web.SPACE, ice.OPS, web.CODE_GIT_REPOS, msg.Append(model.NAME), "master", arg[1:])
|
||||
case ReposLibrary:
|
||||
m.Cmdy(web.CODE_GIT_REPOS, msg.Append(model.NAME), "master", arg[1:])
|
||||
}
|
||||
if len(arg) == 1 {
|
||||
m.Display("")
|
||||
} else {
|
||||
m.Display("/plugin/table.js")
|
||||
}
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(history{}) }
|
9
src/development/history.js
Normal file
9
src/development/history.js
Normal file
@ -0,0 +1,9 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.text]},
|
||||
{view: html.STATUS, list: [value.commit.slice(0, 6), can.onimport.timeView(can, value), value.username]},
|
||||
{view: html.STATUS, list: [can.onimport.unitView(can, value, "files"), can.onimport.unitView(can, value, "adds"), can.onimport.unitView(can, value, "dels")]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -13,6 +13,7 @@ const (
|
||||
USER_REPOS_ROLE = "user_repos_role"
|
||||
REPOS_UID = "repos_uid"
|
||||
REPOS_NAME = "repos_name"
|
||||
REPOS_LINK = "repos_link"
|
||||
REPOS_TYPE = "repos_type"
|
||||
VERSION_UID = "version_uid"
|
||||
)
|
||||
@ -24,6 +25,8 @@ type UserRepos struct {
|
||||
type Repos struct {
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
Path string `gorm:"type:varchar(255)"`
|
||||
Link string `gorm:"type:varchar(255)"`
|
||||
}
|
||||
type Version struct {
|
||||
db.ModelContent
|
||||
|
@ -1,13 +1,31 @@
|
||||
package development
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong"
|
||||
"shylinux.com/x/operation/src/development/model"
|
||||
"shylinux.com/x/operation/src/operation"
|
||||
)
|
||||
|
||||
type Portal struct {
|
||||
operation.Portal
|
||||
placeCreate string `name:"placeCreate city_name* company_name* repos_name* repos_type:select" role:"void"`
|
||||
placeCreate string `name:"placeCreate city_name* company_name* repos_type*:select repos_name* repos_link" role:"void"`
|
||||
}
|
||||
|
||||
func (s Portal) PlaceCreate(m *ice.Message, arg ...string) {
|
||||
switch ReposType(kit.Int(m.Option(model.REPOS_TYPE))) {
|
||||
case ReposSystem:
|
||||
msg := m.Cmd(web.SPACE, ice.OPS, web.DREAM, mdb.CREATE, m.Option(model.REPOS_NAME), m.Option(model.REPOS_LINK), kit.Dict(ice.MSG_USERROLE, aaa.TECH))
|
||||
arg = append(arg, model.NAME, msg.Option(model.NAME))
|
||||
case ReposLibrary:
|
||||
case ReposGithub:
|
||||
}
|
||||
s.Portal.PlaceCreate(m, arg...)
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: operation.NewPortal(userRepos{}, repos{})}) }
|
||||
|
@ -1,14 +1,19 @@
|
||||
{
|
||||
"portal": "软件开发",
|
||||
"version": "版本",
|
||||
"history": "记录",
|
||||
"serve": "服务",
|
||||
"icons": {
|
||||
"version": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
"serve": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"version": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"history": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
},
|
||||
"input": {
|
||||
"My Repos": "我的源码",
|
||||
"user_repos_role": "用户角色",
|
||||
"repos_name": "源码名称",
|
||||
"repos_type": "源码类型"
|
||||
"repos_type": "源码类型",
|
||||
"repos_link": "源码地址"
|
||||
},
|
||||
"value": {
|
||||
"user_repos_role": {
|
||||
@ -24,6 +29,7 @@
|
||||
},
|
||||
"repos_type": {
|
||||
"system": "系统库",
|
||||
"library": "依赖库",
|
||||
"github": "Github"
|
||||
}
|
||||
}
|
||||
|
@ -10,12 +10,14 @@ type ReposType int
|
||||
|
||||
const (
|
||||
ReposSystem ReposType = iota
|
||||
ReposLibrary
|
||||
ReposGithub
|
||||
)
|
||||
|
||||
var ReposTypeList = map[ReposType]string{
|
||||
ReposSystem: "system",
|
||||
ReposGithub: "github",
|
||||
ReposSystem: "system",
|
||||
ReposLibrary: "library",
|
||||
ReposGithub: "github",
|
||||
}
|
||||
|
||||
func (s ReposType) String() string { return ReposTypeList[s] }
|
||||
|
77
src/development/serve.go
Normal file
77
src/development/serve.go
Normal file
@ -0,0 +1,77 @@
|
||||
package development
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/cli"
|
||||
"shylinux.com/x/icebergs/base/ctx"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/nfs"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
"shylinux.com/x/icebergs/core/code"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/operation/src/development/model"
|
||||
)
|
||||
|
||||
type serve struct {
|
||||
Tables
|
||||
repos repos
|
||||
order string `data:"1"`
|
||||
imports string `name:"imports" role:"leader,worker"`
|
||||
autogen string `name:"autogen name* help* class* table*" icon:"bi bi-plus-square-dotted" role:"leader,worker"`
|
||||
}
|
||||
|
||||
func (s serve) BeforeAction(m *ice.Message, arg ...string) *ice.Message {
|
||||
msg := m.Cmd(s.repos, s.Select, model.UID, m.Option(model.REPOS_UID), ice.Maps{mdb.TABLE: ""})
|
||||
m.Option(model.REPOS_NAME, msg.Append(model.NAME))
|
||||
return msg
|
||||
}
|
||||
func (s serve) Imports(m *ice.Message, arg ...string) {
|
||||
s.spaceCmdy(m, web.CODE_GIT_REPOS, "init", kit.MergeURL2(m.Option(ice.MSG_USERHOST), "/x/"+m.Option(model.REPOS_NAME)))
|
||||
s.spaceCmdy(m, web.CODE_AUTOGEN, code.IMPORT, "gonganxitong", "shylinux.com/x/community")
|
||||
s.spaceCmdy(m, web.CODE_AUTOGEN, code.IMPORT, "db/mysql", "shylinux.com/x/mysql-story")
|
||||
s.spaceCmdy(m, web.CODE_VIMER, code.COMPILE)
|
||||
s.SpaceCmdy(m, ice.OPS, web.CODE_COMPILE, code.DEVPACK)
|
||||
m.Sleep("3s")
|
||||
}
|
||||
func (s serve) Autogen(m *ice.Message, arg ...string) {
|
||||
s.spaceCmdy(m, "web.team.gonganxitong.service", code.AUTOGEN, arg)
|
||||
s.spaceCmdy(m, cli.SYSTEM, "git", "add", "src")
|
||||
s.spaceCmdy(m, cli.SYSTEM, "git", "commit", "-am", "add some")
|
||||
s.spaceCmdy(m, cli.SYSTEM, "git", "push")
|
||||
s.spaceCmdy(m, web.CODE_VIMER, code.COMPILE)
|
||||
}
|
||||
func (s serve) List(m *ice.Message, arg ...string) {
|
||||
msg := s.BeforeAction(m.Options(model.REPOS_UID, arg[0]))
|
||||
switch ReposType(kit.Int(msg.Append(model.TYPE))) {
|
||||
case ReposSystem:
|
||||
if s.spaceCmd(m, ctx.COMMAND, "web.team.gonganxitong.portal").Length() == 0 {
|
||||
s.Button(m, "", s.Imports)
|
||||
return
|
||||
}
|
||||
s.spaceCmd(m, nfs.DIR, nfs.SRC, nfs.PATH, nfs.SIZE, kit.Dict(
|
||||
nfs.DIR_DEEP, ice.TRUE, nfs.DIR_TYPE, nfs.TYPE_CAT, nfs.DIR_REG, "portal.go",
|
||||
)).Table(func(value ice.Maps) {
|
||||
m.Push(model.NAME, strings.Split(value[nfs.PATH], "/")[1])
|
||||
})
|
||||
m.PushAction(s.Open, s.Config).Action(s.Autogen).Display("")
|
||||
s.Button(m, "", s.Autogen)
|
||||
}
|
||||
}
|
||||
func (s serve) Open(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(web.S(m.Option(model.REPOS_NAME)) + web.C("web.team."+m.Option(model.NAME)+".portal"))
|
||||
}
|
||||
func (s serve) Config(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(web.S(m.Option(model.REPOS_NAME)) + web.C("web.team."+m.Option(model.NAME)+".portal") + "?view=table")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(serve{}) }
|
||||
|
||||
func (s serve) spaceCmdy(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||
return s.SpaceCmdy(m, m.Option(model.REPOS_NAME), arg...)
|
||||
}
|
||||
func (s serve) spaceCmd(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||
return s.SpaceCmd(m, m.Option(model.REPOS_NAME), arg...)
|
||||
}
|
7
src/development/serve.js
Normal file
7
src/development/serve.js
Normal file
@ -0,0 +1,7 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.name]},
|
||||
] })
|
||||
},
|
||||
})
|
41
src/h1/common.go
Normal file
41
src/h1/common.go
Normal file
@ -0,0 +1,41 @@
|
||||
package h1
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
"shylinux.com/x/operation/src/h1/model"
|
||||
)
|
||||
|
||||
type Table struct {
|
||||
guanlixitong.Table
|
||||
list string `name:"list h1_uid uid auto" role:"void"`
|
||||
}
|
||||
|
||||
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case model.USER_H1_ROLE:
|
||||
s.InputsListRole(m, UserH1RoleList, arg...)
|
||||
case model.H1_TYPE:
|
||||
s.InputsList(m, H1TypeList, arg...)
|
||||
default:
|
||||
s.Table.Inputs(m, arg...)
|
||||
}
|
||||
}
|
||||
func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
||||
m.RewriteAppend(func(value, key string, index int) string {
|
||||
switch key {
|
||||
case model.USER_H1_ROLE:
|
||||
value = UserH1Role(kit.Int(value)).String()
|
||||
case model.H1_TYPE:
|
||||
value = H1Type(kit.Int(value)).String()
|
||||
}
|
||||
return value
|
||||
})
|
||||
return s.Table.RewriteAppend(m)
|
||||
}
|
||||
|
||||
type Tables struct { Table }
|
||||
|
||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
23
src/h1/h1.go
Normal file
23
src/h1/h1.go
Normal file
@ -0,0 +1,23 @@
|
||||
package h1
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type h1 struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(h1{}) }
|
||||
|
||||
type H1Type int
|
||||
|
||||
const (
|
||||
H1RD H1Type = iota
|
||||
H1OP
|
||||
H1HR
|
||||
)
|
||||
|
||||
var H1TypeList = map[H1Type]string{
|
||||
H1RD: "RD",
|
||||
H1OP: "OP",
|
||||
H1HR: "HR",
|
||||
}
|
||||
|
||||
func (s H1Type) String() string { return H1TypeList[s] }
|
15
src/h1/h2.go
Normal file
15
src/h1/h2.go
Normal file
@ -0,0 +1,15 @@
|
||||
package h1
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type h2 struct {
|
||||
Table
|
||||
order string `data:"1"`
|
||||
fields string `data:"title,content,user_uid"`
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
}
|
||||
|
||||
func (s h2) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
||||
|
||||
func init() { ice.TeamCtxCmd(h2{}) }
|
9
src/h1/h2.js
Normal file
9
src/h1/h2.js
Normal file
@ -0,0 +1,9 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title||value.name]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
||||
{view: html.OUTPUT, list: [value.content||value.info]},
|
||||
] })
|
||||
},
|
||||
})
|
34
src/h1/model/model.go
Normal file
34
src/h1/model/model.go
Normal file
@ -0,0 +1,34 @@
|
||||
package model
|
||||
|
||||
import "shylinux.com/x/mysql-story/src/db"
|
||||
|
||||
const (
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
INFO = "info"
|
||||
TYPE = "type"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
USER_UID = "user_uid"
|
||||
USER_H1_ROLE = "user_h1_role"
|
||||
H1_UID = "h1_uid"
|
||||
H1_NAME = "h1_name"
|
||||
H1_TYPE = "h1_type"
|
||||
H2_UID = "_uid"
|
||||
)
|
||||
|
||||
type UserH1 struct {
|
||||
db.ModelUserPlace
|
||||
H1UID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type H1 struct {
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type H2 struct {
|
||||
db.ModelContent
|
||||
H1UID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
|
||||
|
||||
func init() { db.CmdModels("", &UserH1{}, &H1{}, &H2{}) }
|
13
src/h1/portal.go
Normal file
13
src/h1/portal.go
Normal file
@ -0,0 +1,13 @@
|
||||
package h1
|
||||
|
||||
import (
|
||||
"shylinux.com/x/community/src/gonganxitong"
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
|
||||
type Portal struct {
|
||||
guanlixitong.Portal
|
||||
placeCreate string `name:"placeCreate city_name* company_name* h1_name* h1_type:select" role:"void"`
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userH1{}, h1{})}) }
|
31
src/h1/portal.json
Normal file
31
src/h1/portal.json
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"portal": "h1",
|
||||
"": "场景应用",
|
||||
"icons": {
|
||||
"": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
},
|
||||
"input": {
|
||||
"My H1": "我的场景",
|
||||
"user_h1_role": "成员角色",
|
||||
"h1_name": "场景名称",
|
||||
"h1_type": "场景类型"
|
||||
},
|
||||
"value": {
|
||||
"user_h1_role": {
|
||||
"visitor": "访客",
|
||||
"creator": "创建人",
|
||||
"leader": "管理人员",
|
||||
"worker": "工作人员",
|
||||
"server": "服务人员",
|
||||
"style": {
|
||||
"creator": "danger",
|
||||
"leader": "danger"
|
||||
}
|
||||
},
|
||||
"h1_type": {
|
||||
"RD": "研发群",
|
||||
"OP": "运维群",
|
||||
"HR": "人力群"
|
||||
}
|
||||
}
|
||||
}
|
15
src/h1/userH1.go
Normal file
15
src/h1/userH1.go
Normal file
@ -0,0 +1,15 @@
|
||||
package h1
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
|
||||
type userH1 struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userH1{}) }
|
||||
|
||||
type UserH1Role = guanlixitong.UserGroupRole
|
||||
|
||||
var UserH1RoleList = guanlixitong.UserGroupRoleList
|
@ -8,6 +8,8 @@ import (
|
||||
_ "shylinux.com/x/operation/src/operation"
|
||||
_ "shylinux.com/x/operation/src/production"
|
||||
_ "shylinux.com/x/operation/src/storage"
|
||||
|
||||
_ "shylinux.com/x/operation/src/h1"
|
||||
)
|
||||
|
||||
func main() { print(ice.Run()) }
|
||||
|
@ -36,6 +36,15 @@
|
||||
"time": "2024-09-03 10:22:15.306"
|
||||
}
|
||||
},
|
||||
"52f27fd80193ec5e6bf32a67903c254e": {
|
||||
"meta": {
|
||||
"icons": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"index": "web.team.development.history",
|
||||
"name": "记录",
|
||||
"order": "1",
|
||||
"time": "2024-10-04 21:52:11.754"
|
||||
}
|
||||
},
|
||||
"65bbf43dd9dd847f2c85f827030ea8ca": {
|
||||
"meta": {
|
||||
"icons": "https://img.icons8.com/officel/80/settings--v1.png",
|
||||
@ -131,5 +140,14 @@
|
||||
"order": "901",
|
||||
"time": "2024-09-09 08:51:35.231"
|
||||
}
|
||||
},
|
||||
"eaf46f03ee68a1dd734f0c74083c37c9": {
|
||||
"meta": {
|
||||
"icons": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"index": "web.team.development.serve",
|
||||
"name": "服务",
|
||||
"order": "1",
|
||||
"time": "2024-10-04 22:31:10.447"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user