feat: 设置语言精简中英+补全时区;构建节点磁盘显示;浏览器 favicon
- 系统设置:界面语言仅保留 简体中文/English;时区按 亚/欧/美/大洋洲 分组补全 22 个常用时区 - 构建节点:BuildNode 新增 diskInfo 字段(模型/CRUD/seed),卡片显示 磁盘用量(未上报显示 —),添加/编辑弹窗可维护 - 新增 favicon.svg(主题渐变火箭图标),index.html 注入 icon 链接
This commit is contained in:
1 parent
581d0a8351
commit
a3b4637e19
7 files changed
+71
-10
No files matched your search
@@ -203,9 +203,9 @@ func seedResources() {
|
||||
if n == 0 {
|
||||
hb := time.Now().Add(-10 * time.Second)
|
||||
DB.Create([]model.BuildNode{
|
||||
{Name: "build-host-01", IP: "10.0.8.11", Labels: `["docker","go","java"]`, MaxConcurrency: 4, Status: "online", CurrentJobs: 1, LastHeartbeat: &hb},
|
||||
{Name: "build-host-02", IP: "10.0.8.12", Labels: `["docker","nodejs"]`, MaxConcurrency: 2, Status: "busy", CurrentJobs: 2, LastHeartbeat: &hb},
|
||||
{Name: "build-host-03", IP: "10.0.8.13", Labels: `["python"]`, MaxConcurrency: 2, Status: "offline", LastHeartbeat: &hb},
|
||||
{Name: "build-host-01", IP: "10.0.8.11", Labels: `["docker","go","java"]`, MaxConcurrency: 4, Status: "online", CurrentJobs: 1, DiskInfo: "78G/200G", LastHeartbeat: &hb},
|
||||
{Name: "build-host-02", IP: "10.0.8.12", Labels: `["docker","nodejs"]`, MaxConcurrency: 2, Status: "busy", CurrentJobs: 2, DiskInfo: "156G/500G", LastHeartbeat: &hb},
|
||||
{Name: "build-host-03", IP: "10.0.8.13", Labels: `["python"]`, MaxConcurrency: 2, Status: "offline", DiskInfo: "45G/100G", LastHeartbeat: &hb},
|
||||
})
|
||||
}
|
||||
DB.Model(&model.WebhookEndpoint{}).Count(&n)
|
||||
|
||||
@@ -394,7 +394,7 @@ func UpdateBuildNode(c *gin.Context) {
|
||||
}
|
||||
var raw map[string]any
|
||||
_ = c.ShouldBindJSON(&raw)
|
||||
for _, k := range []string{"name", "ip", "labels", "maxConcurrency", "workspacePath", "enabled"} {
|
||||
for _, k := range []string{"name", "ip", "labels", "maxConcurrency", "workspacePath", "diskInfo", "enabled"} {
|
||||
if v, ok := raw[k]; ok {
|
||||
database.DB.Model(&n).Update(k, v)
|
||||
}
|
||||
|
||||
@@ -204,6 +204,7 @@ type BuildNode struct {
|
||||
Labels string `gorm:"type:text" json:"labels"` // JSON ["docker","go"]
|
||||
MaxConcurrency int `gorm:"default:2" json:"maxConcurrency"`
|
||||
WorkspacePath string `gorm:"default:/data/flowstack-workspace" json:"workspacePath"`
|
||||
DiskInfo string `json:"diskInfo"` // 如 "45G/200G"
|
||||
Enabled bool `gorm:"default:true" json:"enabled"`
|
||||
Status string `gorm:"default:offline" json:"status"` // online|offline|busy
|
||||
CurrentJobs int `gorm:"default:0" json:"currentJobs"`
|
||||
|
||||
Reference in new issue
Block a user