diff --git a/core/cmd/server/cmd/update.go b/core/cmd/server/cmd/update.go index dcae9f5c3..4f7802dab 100644 --- a/core/cmd/server/cmd/update.go +++ b/core/cmd/server/cmd/update.go @@ -29,6 +29,8 @@ func init() { updateCmd.AddCommand(updateUserName) updateCmd.AddCommand(updatePassword) updateCmd.AddCommand(updatePort) + + updateCmd.AddCommand(updateVersion) } var updateCmd = &cobra.Command{ @@ -79,6 +81,32 @@ var updatePort = &cobra.Command{ return nil }, } +var updateVersion = &cobra.Command{ + Use: "version", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + i18n.UseI18nForCmd(language) + if !isRoot() { + fmt.Println(i18n.GetMsgWithMapForCmd("SudoHelper", map[string]interface{}{"cmd": "sudo 1pctl update version"})) + return nil + } + version := args[0] + if len(version) == 0 || !strings.HasPrefix(version, "v2.") { + fmt.Println("err version in param input") + return nil + } + db, err := loadDBConn("core.db") + if err != nil { + fmt.Println(i18n.GetMsgWithMapForCmd("DBConnErr", map[string]interface{}{"err": err.Error()})) + return err + } + if err := setSettingByKey(db, "SystemVersion", version); err != nil { + fmt.Println(i18n.GetMsgWithMapForCmd("UpdateUserErr", map[string]interface{}{"err": err.Error()})) + return err + } + return nil + }, +} func username() { reader := bufio.NewReader(os.Stdin) diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 08defedc5..b819ef17e 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1605,7 +1605,7 @@ const message = { syncHelper: 'The sync operation will clean invalid keys and sync new complete key pairs. Continue?', input: 'Manual Input', import: 'File Upload', - authKeys: 'Public Key Management', + authKeys: 'Authorization Keys', authKeysHelper: 'Save current public key information?', pubkey: 'Key info', pubKeyHelper: 'The current key information only takes effect for user {0}', diff --git a/frontend/src/lang/modules/es-es.ts b/frontend/src/lang/modules/es-es.ts index a04d11a27..497a8ab43 100644 --- a/frontend/src/lang/modules/es-es.ts +++ b/frontend/src/lang/modules/es-es.ts @@ -1602,7 +1602,7 @@ const message = { 'La operación de sincronización limpiará las claves inválidas y sincronizará nuevos pares de claves completos. ¿Desea continuar?', input: 'Entrada manual', import: 'Subir archivo', - authKeys: 'Gestión de Claves Públicas', + authKeys: 'Claves de Autorización', authKeysHelper: '¿Guardar información actual de clave pública?', pubkey: 'Información de clave', pubKeyHelper: 'La información de la clave actual solo tiene efecto para el usuario {0}', diff --git a/frontend/src/lang/modules/ja.ts b/frontend/src/lang/modules/ja.ts index 4240225ef..de5e6b9a1 100644 --- a/frontend/src/lang/modules/ja.ts +++ b/frontend/src/lang/modules/ja.ts @@ -1550,7 +1550,7 @@ const message = { syncHelper: '同期操作は無効なキーをクリーンアップし、新しい完全なキーペアを同期します。続行しますか?', input: '手動入力', import: 'ファイルアップロード', - authKeys: '公開鍵管理', + authKeys: '認証キー', authKeysHelper: '現在の公開鍵情報を保存しますか?', pubkey: '重要な情報', encryptionMode: '暗号化モード', diff --git a/frontend/src/lang/modules/ko.ts b/frontend/src/lang/modules/ko.ts index bb74701fc..85f13648a 100644 --- a/frontend/src/lang/modules/ko.ts +++ b/frontend/src/lang/modules/ko.ts @@ -1531,7 +1531,7 @@ const message = { syncHelper: '동기화 작업으로 유효하지 않은 키를 정리하고 새로운 완전한 키 쌍을 동기화합니다. 계속하시겠습니까?', input: '수동 입력', import: '파일 업로드', - authKeys: '공개 키 관리', + authKeys: 'Kunci Pengesahan', authKeysHelper: '현재 공개 키 정보를 저장하시겠습니까?', pubkey: '키 정보', encryptionMode: '암호화 모드', diff --git a/frontend/src/lang/modules/ms.ts b/frontend/src/lang/modules/ms.ts index 77973e328..c5e5abb2f 100644 --- a/frontend/src/lang/modules/ms.ts +++ b/frontend/src/lang/modules/ms.ts @@ -1595,7 +1595,7 @@ const message = { 'Operasi segerak akan membersihkan kunci tidak sah dan menyegerakkan pasangan kunci baru yang lengkap. Teruskan?', input: 'Input Manual', import: 'Muat Naik Fail', - authKeys: 'Pengurusan Kunci Awam', + authKeys: 'Kunci Pengesahan', authKeysHelper: 'Simpan maklumat kunci awam semasa?', pubkey: 'Maklumat kunci', pubKeyHelper: 'Maklumat kunci semasa hanya berkuat kuasa untuk pengguna {0}', diff --git a/frontend/src/lang/modules/pt-br.ts b/frontend/src/lang/modules/pt-br.ts index 1b3333602..82aed9963 100644 --- a/frontend/src/lang/modules/pt-br.ts +++ b/frontend/src/lang/modules/pt-br.ts @@ -1585,7 +1585,7 @@ const message = { 'A operação de sincronização limpará chaves inválidas e sincronizará novos pares de chaves completos. Continuar?', input: 'Entrada Manual', import: 'Upload de Arquivo', - authKeys: 'Gerenciamento de Chaves Públicas', + authKeys: 'Chaves de Autorização', authKeysHelper: 'Salvar informações atuais da chave pública?', pubkey: 'Informações da chave', pubKeyHelper: 'A informação da chave atual só tem efeito para o usuário {0}', diff --git a/frontend/src/lang/modules/ru.ts b/frontend/src/lang/modules/ru.ts index 31806bab6..43d24b9da 100644 --- a/frontend/src/lang/modules/ru.ts +++ b/frontend/src/lang/modules/ru.ts @@ -1588,7 +1588,7 @@ const message = { 'Операция синхронизации удалит недействительные ключи и синхронизирует новые полные ключевые пары. Продолжить?', input: 'Ручной ввод', import: 'Загрузка файла', - authKeys: 'Управление Открытыми Ключами', + authKeys: 'Ключи Авторизации', authKeysHelper: 'Сохранить текущую информацию об открытом ключе?', pubkey: 'Информация о ключе', pubKeyHelper: 'Текущая информация о ключе действительна только для пользователя {0}', diff --git a/frontend/src/lang/modules/tr.ts b/frontend/src/lang/modules/tr.ts index 6efbf3687..722ff09ba 100644 --- a/frontend/src/lang/modules/tr.ts +++ b/frontend/src/lang/modules/tr.ts @@ -1625,7 +1625,7 @@ const message = { 'Eşitleme işlemi geçersiz anahtarları temizleyecek ve yeni tam anahtar çiftlerini eşitleyecek. Devam edilsin mi?', input: 'Manuel Giriş', import: 'Dosya Yükleme', - authKeys: 'Ortak Anahtar Yönetimi', + authKeys: 'Yetki Anahtarları', authKeysHelper: 'Mevcut ortak anahtar bilgilerini kaydet?', pubkey: 'Anahtar bilgisi', pubKeyHelper: 'Mevcut anahtar bilgileri yalnızca {0} kullanıcısı için geçerlidir', diff --git a/frontend/src/lang/modules/zh-Hant.ts b/frontend/src/lang/modules/zh-Hant.ts index 11c40e818..fab51e853 100644 --- a/frontend/src/lang/modules/zh-Hant.ts +++ b/frontend/src/lang/modules/zh-Hant.ts @@ -1524,7 +1524,7 @@ const message = { syncHelper: '同步操作將清理失效金鑰並同步新增的完整金鑰對,是否繼續?', input: '手動輸入', import: '文件上傳', - authKeys: '公鑰管理', + authKeys: '授權金鑰', authKeysHelper: '是否儲存目前公鑰資訊?', pubkey: '金鑰資訊', pubKeyHelper: '目前金鑰資訊僅對使用者 {0} 生效', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 1a46ed1b1..3bd3eb2b0 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1520,7 +1520,7 @@ const message = { syncHelper: '同步操作将清理失效密钥并同步新增的完整密钥对,是否继续?', input: '手动输入', import: '文件上传', - authKeys: '公钥管理', + authKeys: '授权密钥', authKeysHelper: '是否保存当前公钥信息?', pubkey: '密钥信息', pubKeyHelper: '当前密钥信息仅对用户 {0} 生效', diff --git a/frontend/src/views/container/image/tag/index.vue b/frontend/src/views/container/image/tag/index.vue index 87a66526d..e76e19bd6 100644 --- a/frontend/src/views/container/image/tag/index.vue +++ b/frontend/src/views/container/image/tag/index.vue @@ -1,6 +1,14 @@