From 7631c237e922030763451d0a88cfff1600a7a7ee Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:30:20 +0800 Subject: [PATCH] feat: Uniform state style (#7436) --- agent/app/service/ftp.go | 2 +- agent/constant/status.go | 1 + agent/init/migration/migrate.go | 7 -- core/app/api/v2/setting.go | 2 +- core/app/service/auth.go | 8 +- core/app/service/setting.go | 6 +- core/app/service/upgrade.go | 4 +- core/cmd/server/cmd/listen-ip.go | 5 +- core/cmd/server/cmd/reset.go | 5 +- core/cmd/server/cmd/update.go | 3 +- core/constant/common.go | 3 - core/constant/status.go | 34 ++--- core/init/migration/migrate.go | 1 + core/init/migration/migrations/init.go | 27 ++-- core/middleware/session.go | 2 +- core/server/server.go | 5 +- frontend/src/api/interface/host.ts | 5 +- frontend/src/components/app-status/index.vue | 2 +- frontend/src/components/status/index.vue | 52 +++++--- frontend/src/lang/modules/en.ts | 19 ++- frontend/src/lang/modules/tw.ts | 21 ++-- frontend/src/lang/modules/zh.ts | 21 ++-- frontend/src/styles/common.scss | 4 - frontend/src/utils/xpack.ts | 6 +- .../src/views/container/compose/index.vue | 4 +- frontend/src/views/container/image/index.vue | 25 ++-- .../src/views/container/network/index.vue | 4 +- frontend/src/views/container/repo/index.vue | 14 +-- .../src/views/container/setting/index.vue | 7 +- .../src/views/container/template/index.vue | 4 +- frontend/src/views/container/volume/index.vue | 4 +- frontend/src/views/cronjob/index.vue | 24 +--- frontend/src/views/cronjob/record/index.vue | 17 +-- frontend/src/views/database/mysql/index.vue | 2 +- .../src/views/database/postgresql/index.vue | 2 +- .../src/views/host/firewall/forward/index.vue | 4 +- frontend/src/views/host/firewall/ip/index.vue | 4 +- .../src/views/host/firewall/port/index.vue | 4 +- .../src/views/host/firewall/status/index.vue | 9 +- frontend/src/views/host/ssh/log/log.vue | 4 +- frontend/src/views/host/ssh/ssh/index.vue | 17 +-- frontend/src/views/log/login/index.vue | 13 +- frontend/src/views/log/operation/index.vue | 117 +++++------------- frontend/src/views/log/task/index.vue | 19 +-- .../views/setting/backup-account/index.vue | 4 +- frontend/src/views/setting/license/index.vue | 31 ++--- frontend/src/views/setting/panel/index.vue | 10 +- frontend/src/views/setting/safe/index.vue | 34 ++--- frontend/src/views/setting/snapshot/index.vue | 4 +- frontend/src/views/toolbox/clam/index.vue | 20 +-- .../src/views/toolbox/clam/record/index.vue | 7 +- .../src/views/toolbox/clam/status/index.vue | 14 +-- frontend/src/views/toolbox/fail2ban/index.vue | 7 +- frontend/src/views/toolbox/ftp/index.vue | 31 ++--- frontend/src/views/toolbox/ftp/log/index.vue | 3 +- .../src/views/toolbox/supervisor/index.vue | 31 ++--- .../views/toolbox/supervisor/status/index.vue | 2 +- .../website/runtime/php/supervisor/index.vue | 25 ++-- .../website/config/basic/proxy/index.vue | 9 +- .../website/config/basic/redirect/index.vue | 8 +- frontend/src/views/website/website/index.vue | 15 +-- 61 files changed, 311 insertions(+), 487 deletions(-) diff --git a/agent/app/service/ftp.go b/agent/app/service/ftp.go index a7440873c..889c97ff4 100644 --- a/agent/app/service/ftp.go +++ b/agent/app/service/ftp.go @@ -122,7 +122,7 @@ func (f *FtpService) Sync() error { } for _, item := range listsInDB { if _, ok := sameData[item.User]; !ok { - _ = ftpRepo.Update(item.ID, map[string]interface{}{"status": "deleted"}) + _ = ftpRepo.Update(item.ID, map[string]interface{}{"status": constant.StatusDeleted}) } } return nil diff --git a/agent/constant/status.go b/agent/constant/status.go index 161b50e00..2268cbc32 100644 --- a/agent/constant/status.go +++ b/agent/constant/status.go @@ -10,6 +10,7 @@ const ( StatusEnable = "Enable" StatusDisable = "Disable" StatusNone = "None" + StatusDeleted = "Deleted" OrderDesc = "descending" OrderAsc = "ascending" diff --git a/agent/init/migration/migrate.go b/agent/init/migration/migrate.go index 95f44a6c1..6ad8ac415 100644 --- a/agent/init/migration/migrate.go +++ b/agent/init/migration/migrate.go @@ -15,13 +15,6 @@ func Init() { migrations.InitImageRepo, migrations.InitDefaultCA, migrations.InitPHPExtensions, - migrations.UpdateWebsite, - migrations.UpdateWebsiteDomain, - migrations.UpdateApp, - migrations.AddTaskDB, - migrations.UpdateAppInstall, - migrations.UpdateSnapshot, - migrations.UpdateCronjob, migrations.InitBaseDir, }) if err := m.Migrate(); err != nil { diff --git a/core/app/api/v2/setting.go b/core/app/api/v2/setting.go index ec138b137..8676d12b0 100644 --- a/core/app/api/v2/setting.go +++ b/core/app/api/v2/setting.go @@ -357,7 +357,7 @@ func (b *BaseApi) MFABind(c *gin.Context) { return } - if err := settingService.Update("MFAStatus", "enable"); err != nil { + if err := settingService.Update("MFAStatus", constant.StatusEnable); err != nil { helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) return } diff --git a/core/app/service/auth.go b/core/app/service/auth.go index 4401f36e8..4788839d3 100644 --- a/core/app/service/auth.go +++ b/core/app/service/auth.go @@ -61,7 +61,7 @@ func (u *AuthService) Login(c *gin.Context, info dto.Login, entrance string) (*d if err = settingRepo.Update("Language", info.Language); err != nil { return nil, err } - if mfa.Value == "enable" { + if mfa.Value == constant.StatusEnable { return &dto.UserLoginInfo{Name: nameSetting.Value, MfaStatus: mfa.Value}, nil } return u.generateSession(c, info.Name, info.AuthMethod) @@ -134,13 +134,13 @@ func (u *AuthService) generateSession(c *gin.Context, name, authMethod string) ( } sessionUser, err := global.SESSION.Get(c) if err != nil { - err := global.SESSION.Set(c, sessionUser, httpsSetting.Value == "enable", lifeTime) + err := global.SESSION.Set(c, sessionUser, httpsSetting.Value == constant.StatusEnable, lifeTime) if err != nil { return nil, err } return &dto.UserLoginInfo{Name: name}, nil } - if err := global.SESSION.Set(c, sessionUser, httpsSetting.Value == "enable", lifeTime); err != nil { + if err := global.SESSION.Set(c, sessionUser, httpsSetting.Value == constant.StatusEnable, lifeTime); err != nil { return nil, err } @@ -154,7 +154,7 @@ func (u *AuthService) LogOut(c *gin.Context) error { } sID, _ := c.Cookie(constant.SessionName) if sID != "" { - c.SetCookie(constant.SessionName, sID, -1, "", "", httpsSetting.Value == "enable", true) + c.SetCookie(constant.SessionName, sID, -1, "", "", httpsSetting.Value == constant.StatusEnable, true) err := global.SESSION.Delete(c) if err != nil { return err diff --git a/core/app/service/setting.go b/core/app/service/setting.go index 113c8b4c6..14a2e5da9 100644 --- a/core/app/service/setting.go +++ b/core/app/service/setting.go @@ -189,8 +189,8 @@ func (u *SettingService) UpdatePort(port uint) error { func (u *SettingService) UpdateSSL(c *gin.Context, req dto.SSLUpdate) error { secretDir := path.Join(global.CONF.System.BaseDir, "1panel/secret") - if req.SSL == "disable" { - if err := settingRepo.Update("SSL", "disable"); err != nil { + if req.SSL == constant.StatusDisable { + if err := settingRepo.Update("SSL", constant.StatusDisable); err != nil { return err } if err := settingRepo.Update("SSLType", "self"); err != nil { @@ -275,7 +275,7 @@ func (u *SettingService) LoadFromCert() (*dto.SSLInfo, error) { if err != nil { return nil, err } - if ssl.Value == "disable" { + if ssl.Value == constant.StatusDisable { return &dto.SSLInfo{}, nil } sslType, err := settingRepo.Get(repo.WithByKey("SSLType")) diff --git a/core/app/service/upgrade.go b/core/app/service/upgrade.go index 1542e59ee..6e461de03 100644 --- a/core/app/service/upgrade.go +++ b/core/app/service/upgrade.go @@ -53,7 +53,7 @@ func (u *UpgradeService) SearchUpgrade() (*dto.UpgradeInfo, error) { if len(upgrade.NewVersion) != 0 { itemVersion = upgrade.NewVersion } - if (global.CONF.System.Mode == "dev" || DeveloperMode.Value == "enable") && len(upgrade.TestVersion) != 0 { + if (global.CONF.System.Mode == "dev" || DeveloperMode.Value == constant.StatusEnable) && len(upgrade.TestVersion) != 0 { itemVersion = upgrade.TestVersion } if len(itemVersion) == 0 { @@ -232,7 +232,7 @@ func (u *UpgradeService) loadVersionByMode(developer, currentVersion string) (st betaVersionLatest := "" latest = u.loadVersion(true, currentVersion, "stable") current = u.loadVersion(false, currentVersion, "stable") - if developer == "enable" { + if developer == constant.StatusEnable { betaVersionLatest = u.loadVersion(true, currentVersion, "beta") } if current != latest { diff --git a/core/cmd/server/cmd/listen-ip.go b/core/cmd/server/cmd/listen-ip.go index c0168878f..9935b9ce5 100644 --- a/core/cmd/server/cmd/listen-ip.go +++ b/core/cmd/server/cmd/listen-ip.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" + "github.com/1Panel-dev/1Panel/core/constant" "github.com/spf13/cobra" ) @@ -41,11 +42,11 @@ func updateBindInfo(protocol string) error { if err != nil { return err } - ipv6 := "disable" + ipv6 := constant.StatusDisable tcp := "tcp4" address := "0.0.0.0" if protocol == "ipv6" { - ipv6 = "enable" + ipv6 = constant.StatusEnable tcp = "tcp6" address = "::" } diff --git a/core/cmd/server/cmd/reset.go b/core/cmd/server/cmd/reset.go index d398b967c..95eb2e3c2 100644 --- a/core/cmd/server/cmd/reset.go +++ b/core/cmd/server/cmd/reset.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" + "github.com/1Panel-dev/1Panel/core/constant" "github.com/spf13/cobra" ) @@ -33,7 +34,7 @@ var resetMFACmd = &cobra.Command{ return err } - return setSettingByKey(db, "MFAStatus", "disable") + return setSettingByKey(db, "MFAStatus", constant.StatusDisable) }, } var resetSSLCmd = &cobra.Command{ @@ -49,7 +50,7 @@ var resetSSLCmd = &cobra.Command{ return err } - return setSettingByKey(db, "SSL", "disable") + return setSettingByKey(db, "SSL", constant.StatusDisable) }, } var resetEntranceCmd = &cobra.Command{ diff --git a/core/cmd/server/cmd/update.go b/core/cmd/server/cmd/update.go index 9b9709ec6..67f0a14fb 100644 --- a/core/cmd/server/cmd/update.go +++ b/core/cmd/server/cmd/update.go @@ -9,6 +9,7 @@ import ( "strings" "unicode" + "github.com/1Panel-dev/1Panel/core/constant" "github.com/1Panel-dev/1Panel/core/global" "github.com/1Panel-dev/1Panel/core/utils/cmd" "github.com/1Panel-dev/1Panel/core/utils/common" @@ -123,7 +124,7 @@ func password() { return } complexSetting := getSettingByKey(db, "ComplexityVerification") - if complexSetting == "enable" { + if complexSetting == constant.StatusEnable { if isValidPassword("newPassword") { fmt.Println("\n错误:面板密码仅支持字母、数字、特殊字符(!@#$%*_,.?),长度 8-30 位!") return diff --git a/core/constant/common.go b/core/constant/common.go index fd6f3888d..61976eda9 100644 --- a/core/constant/common.go +++ b/core/constant/common.go @@ -17,9 +17,6 @@ const ( OrderDesc = "descending" OrderAsc = "ascending" - StatusEnable = "Enable" - StatusDisable = "Disable" - // backup S3 = "S3" OSS = "OSS" diff --git a/core/constant/status.go b/core/constant/status.go index 69ae3eade..cc5979fde 100644 --- a/core/constant/status.go +++ b/core/constant/status.go @@ -1,22 +1,24 @@ package constant const ( - StatusSuccess = "success" - StatusFailed = "failed" + StatusSuccess = "Success" + StatusFailed = "Failed" // node - StatusWaiting = "waiting" - StatusDownloading = "downloading" - StatusPacking = "packing" - StatusSending = "sending" - StatusStarting = "starting" - StatusHealthy = "healthy" - StatusUnhealthy = "unhealthy" - StatusUpgrading = "upgrading" - StatusRunning = "running" - StatusFree = "free" - StatusBound = "bound" - StatusExceptional = "exceptional" - StatusRetrying = "retrying" - StatusLost = "lost" + StatusWaiting = "Waiting" + StatusPacking = "Packing" + StatusSending = "Sending" + StatusStarting = "Starting" + StatusHealthy = "Healthy" + StatusUnhealthy = "Unhealthy" + StatusUpgrading = "Upgrading" + StatusRunning = "Running" + StatusFree = "Free" + StatusBound = "Bound" + StatusExceptional = "Exceptional" + StatusRetrying = "Retrying" + StatusLost = "Lost" + + StatusEnable = "Enable" + StatusDisable = "Disable" ) diff --git a/core/init/migration/migrate.go b/core/init/migration/migrate.go index 162961815..1c5c442f0 100644 --- a/core/init/migration/migrate.go +++ b/core/init/migration/migrate.go @@ -19,6 +19,7 @@ func Init() { migrations.InitBackup, migrations.InitGoogle, migrations.AddTaskDB, + migrations.UpdateSettingStatus, }) if err := m.Migrate(); err != nil { global.LOG.Error(err) diff --git a/core/init/migration/migrations/init.go b/core/init/migration/migrations/init.go index e1e4f29c9..8d7b6e3c4 100644 --- a/core/init/migration/migrations/init.go +++ b/core/init/migration/migrations/init.go @@ -45,7 +45,7 @@ var InitSetting = &gormigrate.Migration{ if err := tx.Create(&model.Setting{Key: "Theme", Value: "light"}).Error; err != nil { return err } - if err := tx.Create(&model.Setting{Key: "MenuTabs", Value: "disable"}).Error; err != nil { + if err := tx.Create(&model.Setting{Key: "MenuTabs", Value: constant.StatusDisable}).Error; err != nil { return err } if err := tx.Create(&model.Setting{Key: "PanelName", Value: "1Panel"}).Error; err != nil { @@ -64,11 +64,11 @@ var InitSetting = &gormigrate.Migration{ if err := tx.Create(&model.Setting{Key: "SSLID", Value: "0"}).Error; err != nil { return err } - if err := tx.Create(&model.Setting{Key: "SSL", Value: "disable"}).Error; err != nil { + if err := tx.Create(&model.Setting{Key: "SSL", Value: constant.StatusDisable}).Error; err != nil { return err } - if err := tx.Create(&model.Setting{Key: "DeveloperMode", Value: "disable"}).Error; err != nil { + if err := tx.Create(&model.Setting{Key: "DeveloperMode", Value: constant.StatusDisable}).Error; err != nil { return err } if err := tx.Create(&model.Setting{Key: "ProxyType", Value: ""}).Error; err != nil { @@ -111,10 +111,10 @@ var InitSetting = &gormigrate.Migration{ if err := tx.Create(&model.Setting{Key: "ExpirationDays", Value: "0"}).Error; err != nil { return err } - if err := tx.Create(&model.Setting{Key: "ComplexityVerification", Value: "enable"}).Error; err != nil { + if err := tx.Create(&model.Setting{Key: "ComplexityVerification", Value: constant.StatusEnable}).Error; err != nil { return err } - if err := tx.Create(&model.Setting{Key: "MFAStatus", Value: "disable"}).Error; err != nil { + if err := tx.Create(&model.Setting{Key: "MFAStatus", Value: constant.StatusDisable}).Error; err != nil { return err } if err := tx.Create(&model.Setting{Key: "MFASecret", Value: ""}).Error; err != nil { @@ -132,7 +132,7 @@ var InitSetting = &gormigrate.Migration{ if err := tx.Create(&model.Setting{Key: "BindAddress", Value: "0.0.0.0"}).Error; err != nil { return err } - if err := tx.Create(&model.Setting{Key: "Ipv6", Value: "disable"}).Error; err != nil { + if err := tx.Create(&model.Setting{Key: "Ipv6", Value: constant.StatusDisable}).Error; err != nil { return err } if err := tx.Create(&model.Setting{Key: "BindDomain", Value: ""}).Error; err != nil { @@ -219,7 +219,7 @@ var InitTerminalSetting = &gormigrate.Migration{ if err := tx.Create(&model.Setting{Key: "FontSize", Value: "12"}).Error; err != nil { return err } - if err := tx.Create(&model.Setting{Key: "CursorBlink", Value: "enable"}).Error; err != nil { + if err := tx.Create(&model.Setting{Key: "CursorBlink", Value: constant.StatusEnable}).Error; err != nil { return err } if err := tx.Create(&model.Setting{Key: "CursorStyle", Value: "block"}).Error; err != nil { @@ -270,3 +270,16 @@ var AddTaskDB = &gormigrate.Migration{ ) }, } + +var UpdateSettingStatus = &gormigrate.Migration{ + ID: "20241218-update-setting-status", + Migrate: func(tx *gorm.DB) error { + if err := tx.Model(model.Setting{}).Where("value = ?", "enable").Update("value", constant.StatusEnable).Error; err != nil { + return err + } + if err := tx.Model(model.Setting{}).Where("value = ?", "disable").Update("value", constant.StatusDisable).Error; err != nil { + return err + } + return nil + }, +} diff --git a/core/middleware/session.go b/core/middleware/session.go index 7ee602ba7..7e9d6cd0e 100644 --- a/core/middleware/session.go +++ b/core/middleware/session.go @@ -38,7 +38,7 @@ func SessionAuth() gin.HandlerFunc { global.LOG.Errorf("create operation record failed, err: %v", err) return } - _ = global.SESSION.Set(c, psession, httpsSetting.Value == "enable", lifeTime) + _ = global.SESSION.Set(c, psession, httpsSetting.Value == constant.StatusEnable, lifeTime) c.Next() } } diff --git a/core/server/server.go b/core/server/server.go index 72dc4cd52..b0802defb 100644 --- a/core/server/server.go +++ b/core/server/server.go @@ -9,6 +9,7 @@ import ( "os" "path" + "github.com/1Panel-dev/1Panel/core/constant" "github.com/1Panel-dev/1Panel/core/global" "github.com/1Panel-dev/1Panel/core/i18n" "github.com/1Panel-dev/1Panel/core/init/cron" @@ -42,7 +43,7 @@ func Start() { rootRouter := router.Routers() tcpItem := "tcp4" - if global.CONF.System.Ipv6 == "enable" { + if global.CONF.System.Ipv6 == constant.StatusEnable { tcpItem = "tcp" global.CONF.System.BindAddress = fmt.Sprintf("[%s]", global.CONF.System.BindAddress) } @@ -57,7 +58,7 @@ func Start() { type tcpKeepAliveListener struct { *net.TCPListener } - if global.CONF.System.SSL == "enable" { + if global.CONF.System.SSL == constant.StatusEnable { certPath := path.Join(global.CONF.System.BaseDir, "1panel/secret/server.crt") keyPath := path.Join(global.CONF.System.BaseDir, "1panel/secret/server.key") certificate, err := os.ReadFile(certPath) diff --git a/frontend/src/api/interface/host.ts b/frontend/src/api/interface/host.ts index c6f202c6e..6bf7bc2eb 100644 --- a/frontend/src/api/interface/host.ts +++ b/frontend/src/api/interface/host.ts @@ -61,7 +61,8 @@ export namespace Host { export interface FirewallBase { name: string; - status: string; + isExist: boolean; + isActive: boolean; version: string; pingStatus: string; } @@ -148,7 +149,7 @@ export namespace Host { export interface SSHInfo { autoStart: boolean; - status: string; + isActive: boolean; message: string; port: string; listenAddress: string; diff --git a/frontend/src/components/app-status/index.vue b/frontend/src/components/app-status/index.vue index 3c1f9777f..4d84b12f7 100644 --- a/frontend/src/components/app-status/index.vue +++ b/frontend/src/components/app-status/index.vue @@ -4,7 +4,7 @@
{{ data.app }} - + {{ $t('app.version') }}{{ data.version }}
diff --git a/frontend/src/components/status/index.vue b/frontend/src/components/status/index.vue index 5e01dfd6f..0e9999aee 100644 --- a/frontend/src/components/status/index.vue +++ b/frontend/src/components/status/index.vue @@ -1,8 +1,22 @@ diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 1e7e3746e..b864a6918 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -12,6 +12,7 @@ const message = { false: 'false', example: 'e.g.:', fit2cloud: 'FIT2CLOUD', + colon: ': ', button: { prev: 'Previous', next: 'Next', @@ -252,7 +253,6 @@ const message = { scanFailed: 'Incomplete', success: 'Success', waiting: 'Waiting', - waiting1: 'Waiting', failed: 'Failed', stopped: 'Stopped', error: 'Error', @@ -277,7 +277,7 @@ const message = { deny: 'Denied', accept: 'Accepted', used: 'Used', - unUsed: 'Unused', + unused: 'Unused', starting: 'Starting', recreating: 'Recreating', creating: 'Creating', @@ -289,6 +289,17 @@ const message = { syncerr: 'Error', uperr: 'Error', uninstalling: 'Uninstalling', + lost: 'Lost Contact', + bound: 'Bound', + exceptional: 'Exceptional', + free: 'Free', + enable: 'Enabled', + disable: 'Disabled', + deleted: 'Deleted', + downloading: 'Downloading', + packing: 'Packing', + sending: 'Sending', + healthy: 'Normal', }, units: { second: 'Second', @@ -1762,10 +1773,6 @@ const message = { expiresAt: 'Expiration Date', productName: 'Product Name', productStatus: 'Product Status', - lost: 'Lost Contact', - bound: 'Bound', - exceptional: 'Exceptional', - free: 'Free', lostHelper: 'The license has reached the maximum number of retry attempts. Please manually click the sync button to ensure the professional version functions properly.', exceptionalHelper: diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 7a104f9a7..57cad1b04 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -11,6 +11,7 @@ const message = { false: '否', example: '例:', fit2cloud: '飛致雲', + colon: ': ', button: { prev: '上一步', next: '下一步', @@ -246,8 +247,7 @@ const message = { done: '已完成', scanFailed: '未完成', success: '成功', - waiting: '執行中', - waiting1: '等待中', + waiting: '請等待', failed: '失敗', stopped: '已停止', error: '失敗', @@ -272,7 +272,7 @@ const message = { deny: '已屏蔽', accept: '已放行', used: '已使用', - unUsed: '未使用', + unused: '未使用', starting: '啟動中', recreating: '重建中', creating: '創建中', @@ -284,6 +284,17 @@ const message = { syncerr: '失敗', uperr: '失败', uninstalling: '卸載中', + lost: '已失聯', + bound: '已綁定', + exceptional: '異常', + free: '空閒', + enable: '已啟用', + disable: '已停止', + deleted: '已刪除', + downloading: '下載中', + packing: '打包中', + sending: '下發中', + healthy: '正常', }, units: { second: '秒', @@ -1641,10 +1652,6 @@ const message = { expiresAt: '到期時間', productName: '產品名稱', productStatus: '產品狀態', - lost: '已失聯', - bound: '已綁定', - exceptional: '異常', - free: '空閒', lostHelper: '許可證已達到最大重試次數,請手動點擊同步按鈕,以確保專業版功能正常使用。', exceptionalHelper: '許可證同步驗證異常,請手動點擊同步按鈕,以確保專業版功能正常使用。', quickUpdate: '快速更新', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index a7e8d78a5..2c4c0737e 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -11,6 +11,7 @@ const message = { false: '否', example: '例:', fit2cloud: '飞致云', + colon: ': ', button: { prev: '上一步', next: '下一步', @@ -246,8 +247,7 @@ const message = { done: '已完成', scanFailed: '未完成', success: '成功', - waiting: '执行中', - waiting1: '等待中', + waiting: '请等待', failed: '失败', stopped: '已停止', error: '失败', @@ -272,7 +272,7 @@ const message = { deny: '已屏蔽', accept: '已放行', used: '已使用', - unUsed: '未使用', + unused: '未使用', starting: '启动中', recreating: '重建中', creating: '创建中', @@ -284,6 +284,17 @@ const message = { syncerr: '失败', uperr: '失败', uninstalling: '卸载中', + lost: '已失联', + bound: '已绑定', + exceptional: '异常', + free: '空闲', + enable: '已启用', + disable: '已停止', + deleted: '已删除', + downloading: '下载中', + packing: '打包中', + sending: '下发中', + healthy: '正常', }, units: { second: '秒', @@ -1641,10 +1652,6 @@ const message = { expiresAt: '到期时间', productName: '产品名称', productStatus: '产品状态', - lost: '已失联', - bound: '已绑定', - exceptional: '异常', - free: '空闲', lostHelper: '许可证已达到最大重试次数,请手动点击同步按钮,以确保专业版功能正常使用。', exceptionalHelper: '许可证同步验证异常,请手动点击同步按钮,以确保专业版功能正常使用。', quickUpdate: '快速更新', diff --git a/frontend/src/styles/common.scss b/frontend/src/styles/common.scss index a83e760ee..bce1bac66 100644 --- a/frontend/src/styles/common.scss +++ b/frontend/src/styles/common.scss @@ -407,10 +407,6 @@ html { width: 200px !important; } -.p-w-250 { - width: 250px !important; -} - .p-w-100 { width: 100px !important; } diff --git a/frontend/src/utils/xpack.ts b/frontend/src/utils/xpack.ts index 10a320aa9..f2a60c9e4 100644 --- a/frontend/src/utils/xpack.ts +++ b/frontend/src/utils/xpack.ts @@ -55,7 +55,7 @@ export async function loadProductProFromDB() { if (!res || !res.data) { globalStore.isProductPro = false; } else { - globalStore.isProductPro = res.data.status === 'bound'; + globalStore.isProductPro = res.data.status === 'Bound'; if (globalStore.isProductPro) { globalStore.productProExpires = Number(res.data.productPro); } @@ -68,7 +68,7 @@ export async function loadMasterProductProFromDB() { if (!res || !res.data) { globalStore.isMasterProductPro = false; } else { - globalStore.isMasterProductPro = res.data.status === 'bound'; + globalStore.isMasterProductPro = res.data.status === 'Bound'; } switchTheme(); initFavicon(); @@ -83,7 +83,7 @@ export async function getXpackSettingForTheme() { initFavicon(); return; } - globalStore.isMasterProductPro = res.data.status === 'bound'; + globalStore.isMasterProductPro = res.data.status === 'Bound'; if (!globalStore.isMasterProductPro) { globalStore.isMasterProductPro = false; resetXSetting(); diff --git a/frontend/src/views/container/compose/index.vue b/frontend/src/views/container/compose/index.vue index 55adbbf2f..236c69668 100644 --- a/frontend/src/views/container/compose/index.vue +++ b/frontend/src/views/container/compose/index.vue @@ -13,8 +13,8 @@