2022-09-22 16:16:04 +08:00
|
|
|
package dto
|
|
|
|
|
2022-09-30 17:56:06 +08:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
2022-09-26 18:20:21 +08:00
|
|
|
)
|
|
|
|
|
2022-10-09 23:35:24 +08:00
|
|
|
type AppDatabase struct {
|
|
|
|
ServiceName string `json:"PANEL_DB_HOST"`
|
|
|
|
DbName string `json:"PANEL_DB_NAME"`
|
|
|
|
DbUser string `json:"PANEL_DB_USER"`
|
|
|
|
Password string `json:"PANEL_DB_USER_PASSWORD"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type AuthParam struct {
|
|
|
|
RootPassword string `json:"PANEL_DB_ROOT_PASSWORD"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ContainerExec struct {
|
|
|
|
ContainerName string `json:"containerName"`
|
|
|
|
DbParam AppDatabase `json:"dbParam"`
|
|
|
|
Auth AuthParam `json:"auth"`
|
|
|
|
}
|
2022-10-13 18:56:53 +08:00
|
|
|
|
2022-10-14 14:48:55 +08:00
|
|
|
type AppOssConfig struct {
|
|
|
|
Version string `json:"version"`
|
|
|
|
Package string `json:"package"`
|
|
|
|
}
|
|
|
|
|
2022-10-13 18:56:53 +08:00
|
|
|
type AppVersion struct {
|
|
|
|
Version string `json:"version"`
|
|
|
|
DetailId uint `json:"detailId"`
|
|
|
|
}
|
2022-10-14 14:48:55 +08:00
|
|
|
|
|
|
|
type AppList struct {
|
|
|
|
Version string `json:"version"`
|
|
|
|
Tags []Tag `json:"tags"`
|
|
|
|
Items []AppDefine `json:"items"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type AppDefine struct {
|
2022-11-22 14:32:45 +08:00
|
|
|
Key string `json:"key"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Tags []string `json:"tags"`
|
|
|
|
Versions []string `json:"versions"`
|
2023-02-17 16:21:13 +08:00
|
|
|
ShortDescZh string `json:"shortDescZh"`
|
|
|
|
ShortDescEn string `json:"shortDescEn"`
|
2022-10-14 14:48:55 +08:00
|
|
|
Type string `json:"type"`
|
|
|
|
Required []string `json:"Required"`
|
|
|
|
CrossVersionUpdate bool `json:"crossVersionUpdate"`
|
2022-11-22 14:32:45 +08:00
|
|
|
Limit int `json:"limit"`
|
2023-02-08 16:21:17 +08:00
|
|
|
Recommend int `json:"recommend"`
|
2023-01-30 17:24:46 +08:00
|
|
|
Website string `json:"website"`
|
|
|
|
Github string `json:"github"`
|
|
|
|
Document string `json:"document"`
|
2022-10-14 14:48:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (define AppDefine) GetRequired() string {
|
|
|
|
by, _ := json.Marshal(define.Required)
|
|
|
|
return string(by)
|
|
|
|
}
|
|
|
|
|
|
|
|
type Tag struct {
|
|
|
|
Key string `json:"key"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type AppForm struct {
|
2023-01-03 14:57:13 +08:00
|
|
|
FormFields []AppFormFields `json:"formFields"`
|
2022-10-14 14:48:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type AppFormFields struct {
|
2023-03-22 15:38:30 +08:00
|
|
|
Type string `json:"type"`
|
|
|
|
LabelZh string `json:"labelZh"`
|
|
|
|
LabelEn string `json:"labelEn"`
|
|
|
|
Required bool `json:"required"`
|
|
|
|
Default interface{} `json:"default"`
|
|
|
|
EnvKey string `json:"envKey"`
|
|
|
|
Disabled bool `json:"disabled"`
|
|
|
|
Edit bool `json:"edit"`
|
|
|
|
Rule string `json:"rule"`
|
|
|
|
Values []AppFormValue `json:"values"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type AppFormValue struct {
|
|
|
|
Label string `json:"label"`
|
|
|
|
Value string `json:"value"`
|
2022-10-14 14:48:55 +08:00
|
|
|
}
|
2022-12-01 19:25:02 +08:00
|
|
|
|
|
|
|
type AppResource struct {
|
|
|
|
Type string `json:"type"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
}
|
2022-12-09 16:03:00 +08:00
|
|
|
|
|
|
|
var AppToolMap = map[string]string{
|
|
|
|
"mysql": "phpmyadmin",
|
|
|
|
"redis": "redis-commander",
|
|
|
|
}
|