mirror of
https://shylinux.com/x/operation
synced 2025-07-01 21:21:19 +08:00
add some
This commit is contained in:
parent
8aaa85dc83
commit
4270108ae2
@ -4,13 +4,11 @@ import "shylinux.com/x/ice"
|
|||||||
|
|
||||||
type version struct {
|
type version struct {
|
||||||
Table
|
Table
|
||||||
fields string `data:"title,content"`
|
fields string `data:"title,content,user_uid"`
|
||||||
create string `name:"create title* content*" role:"leader"`
|
create string `name:"create title* content*" role:"leader"`
|
||||||
remove string `name:"remove" role:"leader"`
|
remove string `name:"remove" role:"leader"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s version) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) }
|
|
||||||
func (s version) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
|
|
||||||
func (s version) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
func (s version) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(version{}) }
|
func init() { ice.TeamCtxCmd(version{}) }
|
||||||
|
@ -9,11 +9,15 @@ func init() { ice.TeamCtxCmd(cloud{}) }
|
|||||||
type CloudType int
|
type CloudType int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
CloudAliyun CloudType = iota
|
CloudSystem CloudType = iota
|
||||||
|
CloudLocal
|
||||||
|
CloudAliyun
|
||||||
CloudTencent
|
CloudTencent
|
||||||
)
|
)
|
||||||
|
|
||||||
var CloudTypeList = map[CloudType]string{
|
var CloudTypeList = map[CloudType]string{
|
||||||
|
CloudSystem: "system",
|
||||||
|
CloudLocal: "local",
|
||||||
CloudAliyun: "aliyun",
|
CloudAliyun: "aliyun",
|
||||||
CloudTencent: "tencent",
|
CloudTencent: "tencent",
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
type Portal struct {
|
type Portal struct {
|
||||||
guanlixitong.Portal
|
guanlixitong.Portal
|
||||||
placeCreate string `name:"placeCreate city_name* company_name* cloud_name*" cloud_type*:select role:"void"`
|
placeCreate string `name:"placeCreate city_name* company_name* cloud_name* cloud_type*:select" role:"void"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userCloud{}, cloud{})}) }
|
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userCloud{}, cloud{})}) }
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cloud_type": {
|
"cloud_type": {
|
||||||
|
"system": "系统云",
|
||||||
|
"local": "本地云",
|
||||||
"aliyun": "阿里云",
|
"aliyun": "阿里云",
|
||||||
"tencent": "腾讯云"
|
"tencent": "腾讯云"
|
||||||
}
|
}
|
||||||
|
@ -4,13 +4,11 @@ import "shylinux.com/x/ice"
|
|||||||
|
|
||||||
type release struct {
|
type release struct {
|
||||||
Table
|
Table
|
||||||
fields string `data:"title,content"`
|
fields string `data:"title,content,user_uid"`
|
||||||
create string `name:"create title* content*" role:"leader"`
|
create string `name:"create title* content*" role:"leader"`
|
||||||
remove string `name:"remove" role:"leader"`
|
remove string `name:"remove" role:"leader"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s release) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) }
|
|
||||||
func (s release) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
|
|
||||||
func (s release) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
func (s release) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(release{}) }
|
func init() { ice.TeamCtxCmd(release{}) }
|
||||||
|
@ -25,7 +25,7 @@ func (s file) Upload(m *ice.Message, arg ...string) {
|
|||||||
up := kit.Simple(m.Optionv(ice.MSG_UPLOAD))
|
up := kit.Simple(m.Optionv(ice.MSG_UPLOAD))
|
||||||
p := s.path(m, m.Option(model.STORAGE_UID), up[1])
|
p := s.path(m, m.Option(model.STORAGE_UID), up[1])
|
||||||
m.Cmdy(web.CACHE, web.WATCH, up[0], p)
|
m.Cmdy(web.CACHE, web.WATCH, up[0], p)
|
||||||
s.ValueCreate(m, model.TYPE, kit.Format(FilePath), model.TITLE, up[1], model.CONTENT, "", model.SIZE, up[2])
|
s.ValueCreate(m, model.TITLE, up[1], model.CONTENT, "", model.TYPE, kit.Format(FilePath), model.SIZE, up[2])
|
||||||
s.DashboardUpdate(m)
|
s.DashboardUpdate(m)
|
||||||
}
|
}
|
||||||
func (s file) Right(m *ice.Message, arg ...string) {
|
func (s file) Right(m *ice.Message, arg ...string) {
|
||||||
@ -35,6 +35,10 @@ func (s file) Right(m *ice.Message, arg ...string) {
|
|||||||
func (s file) List(m *ice.Message, arg ...string) {
|
func (s file) List(m *ice.Message, arg ...string) {
|
||||||
if s.ValueList(m, arg).Display(""); len(arg) == 1 {
|
if s.ValueList(m, arg).Display(""); len(arg) == 1 {
|
||||||
m.Action(s.Upload)
|
m.Action(s.Upload)
|
||||||
|
if m.Length() == 0 {
|
||||||
|
m.SetResult()
|
||||||
|
s.Button(m, m.Trans("please upload file", "请上传文件"), s.Upload)
|
||||||
|
}
|
||||||
} else if len(arg) == 2 {
|
} else if len(arg) == 2 {
|
||||||
m.PushQRCode(cli.QRCODE, kit.MergeURL2(m.Option(ice.MSG_USERWEB), m.Resource(s.path(m, arg[0], m.Append(model.TITLE)))))
|
m.PushQRCode(cli.QRCODE, kit.MergeURL2(m.Option(ice.MSG_USERWEB), m.Resource(s.path(m, arg[0], m.Append(model.TITLE)))))
|
||||||
m.EchoImages(m.Resource(s.path(m, arg[0], m.Append(model.TITLE))))
|
m.EchoImages(m.Resource(s.path(m, arg[0], m.Append(model.TITLE))))
|
||||||
|
@ -32,6 +32,8 @@ type Storage struct {
|
|||||||
type File struct {
|
type File struct {
|
||||||
db.ModelContent
|
db.ModelContent
|
||||||
StorageUID string `gorm:"type:char(32);index"`
|
StorageUID string `gorm:"type:char(32);index"`
|
||||||
|
Type uint8 `gorm:"default:0"`
|
||||||
|
Size int `gorm:"default:0"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { db.CmdModels("", &UserStorage{}, &Storage{}, &File{}) }
|
func init() { db.CmdModels("", &UserStorage{}, &Storage{}, &File{}) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user