Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agent/app/service/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (u *DeviceService) UpdateSwap(req dto.SwapHelper) error {
cmdMgr := cmd.NewCommandMgr(cmd.WithTask(*taskItem))
if !req.IsNew {
if err := cmdMgr.RunBashCf("%s swapoff %s", cmd.SudoHandleCmd(), req.Path); err != nil {
return fmt.Errorf("handle swapoff %s failed, %v", req.Path)
return fmt.Errorf("handle swapoff %s failed, %v", req.Path, err)
}
}
if req.Size == 0 {
Expand Down
7 changes: 5 additions & 2 deletions agent/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ require (
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 // indirect
github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.13 // indirect
github.com/alibabacloud-go/debug v1.0.1 // indirect
github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect
github.com/alibabacloud-go/openapi-util v0.1.1 // indirect
github.com/alibabacloud-go/tea v1.3.13 // indirect
github.com/alibabacloud-go/tea-utils/v2 v2.0.7 // indirect
github.com/aliyun/credentials-go v1.4.7 // indirect
Expand All @@ -81,6 +79,7 @@ require (
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/clbanning/mxj v1.8.4 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
Expand All @@ -105,6 +104,7 @@ require (
github.com/dsnet/compress v0.0.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/ebitengine/purego v0.8.4 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fvbommel/sortorder v1.1.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
Expand All @@ -121,6 +121,7 @@ require (
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/goccy/go-yaml v1.9.8 // indirect
github.com/gofrs/flock v0.12.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
Expand Down Expand Up @@ -151,6 +152,7 @@ require (
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.9 // indirect
github.com/matishsiao/goInfo v0.0.0-20210923090445-da2e3fa8d45f // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
Expand Down Expand Up @@ -239,6 +241,7 @@ require (
golang.org/x/sync v0.17.0 // indirect
golang.org/x/time v0.14.0 // indirect
golang.org/x/tools v0.37.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251002232023-7c0ddcbb5797 // indirect
google.golang.org/grpc v1.75.1 // indirect
Expand Down
111 changes: 31 additions & 80 deletions agent/go.sum

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions core/app/service/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/1Panel-dev/1Panel/core/utils/controller"
"github.com/1Panel-dev/1Panel/core/utils/files"
"github.com/1Panel-dev/1Panel/core/utils/req_helper"
"github.com/1Panel-dev/1Panel/core/utils/xpack"
)

type UpgradeService struct{}
Expand Down Expand Up @@ -201,6 +202,7 @@ func (u *UpgradeService) Upgrade(req dto.Upgrade) error {

global.LOG.Info("upgrade successful!")
dropBackupCopies()
xpack.AutoUpgradeWithMaster()
go writeLogs(req.Version)
_ = settingRepo.Update("SystemVersion", req.Version)
_ = global.AgentDB.Model(&model.Setting{}).Where("key = ?", "SystemVersion").Updates(map[string]interface{}{"value": req.Version}).Error
Expand Down
25 changes: 13 additions & 12 deletions core/constant/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ const (
StatusFailed = "Failed"

// node
StatusWaiting = "Waiting"
StatusHealthy = "Healthy"
StatusStarting = "Starting"
StatusUnhealthy = "Unhealthy"
StatusUpgrading = "Upgrading"
StatusRunning = "Running"
StatusFree = "Free"
StatusBound = "Bound"
StatusExceptional = "Exceptional"
StatusRetrying = "Retrying"
StatusLost = "Lost"
StatusExecuting = "Executing"
StatusWaiting = "Waiting"
StatusHealthy = "Healthy"
StatusStarting = "Starting"
StatusUnhealthy = "Unhealthy"
StatusWaitForUpgrade = "WaitForUpgrade"
StatusUpgrading = "Upgrading"
StatusRunning = "Running"
StatusFree = "Free"
StatusBound = "Bound"
StatusExceptional = "Exceptional"
StatusRetrying = "Retrying"
StatusLost = "Lost"
StatusExecuting = "Executing"

StatusEnable = "Enable"
StatusDisable = "Disable"
Expand Down
2 changes: 2 additions & 0 deletions core/utils/xpack/xpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ func LoadNodeInfo(currentNode string) (*ssh.ConnInfo, string, error) {
}

func Sync(dataType string) error { return nil }

func AutoUpgradeWithMaster() {}
5 changes: 5 additions & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const message = {
get: 'Get',
upgrade: 'Upgrade',
update: 'Update',
updateNow: 'Update Now',
ignore: 'Ignore upgrade',
copy: 'Copy',
random: 'Random',
Expand Down Expand Up @@ -285,6 +286,7 @@ const message = {
scanFailed: 'Incomplete',
success: 'Success',
waiting: 'Waiting',
waitForUpgrade: 'Wait for Upgrade',
failed: 'Failed',
stopped: 'Stopped',
error: 'Error',
Expand Down Expand Up @@ -3611,6 +3613,9 @@ const message = {
'Master node backup is not currently configured. To ensure data security, please set up a backup node as soon as possible to facilitate manual switching to a new master node in case of failure.',
node: 'Node',
addr: 'Address',
nodeUpgrade: 'Update Settings',
nodeUpgradeHelper:
'Selected nodes will automatically start upgrading after the master node upgrade is completed, no manual operation required.',
nodeUnhealthy: 'Node status abnormal',
deletedNode: 'Deleted node {0} does not currently support upgrade operations!',
nodeUnhealthyHelper: 'Abnormal node status detected. Please check in [Node Management] and try again!',
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/lang/modules/es-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const message = {
get: 'Obtener',
upgrade: 'Actualizar',
update: 'Actualizar',
updateNow: 'Actualizar Ahora',
ignore: 'Ignorar actualización',
copy: 'Copiar',
random: 'Aleatorio',
Expand Down Expand Up @@ -292,6 +293,7 @@ const message = {
scanFailed: 'Incompleto',
success: 'Completado con éxito',
waiting: 'En espera',
waitForUpgrade: 'Esperar Actualización',
failed: 'Fallido',
stopped: 'Detenido',
error: 'Error',
Expand Down Expand Up @@ -3564,6 +3566,9 @@ const message = {
'No se ha configurado un respaldo del nodo principal. Para garantizar la seguridad de los datos, configura un nodo de respaldo lo antes posible y así facilitar el cambio manual en caso de fallo.',
node: 'Nodo',
addr: 'Dirección',
nodeUpgrade: 'Configuración de Actualización',
nodeUpgradeHelper:
'Los nodos seleccionados comenzarán a actualizarse automáticamente después de que se complete la actualización del nodo maestro, sin necesidad de operación manual.',
nodeUnhealthy: 'Estado del nodo anómalo',
deletedNode: 'El nodo eliminado {0} no soporta operaciones de actualización.',
nodeUnhealthyHelper:
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const message = {
get: '得る',
upgrade: 'アップグレード',
update: '編集',
updateNow: '今すぐ更新',
ignore: '更新を無視する',
copy: 'コピー',
random: 'ランダム',
Expand Down Expand Up @@ -273,6 +274,7 @@ const message = {
scanFailed: '不完全',
success: '成功',
waiting: '待っている',
waitForUpgrade: 'アップグレード待機中',
waiting1: '待っている',
failed: '失敗した',
stopped: '停止',
Expand Down Expand Up @@ -3496,6 +3498,9 @@ const message = {
'現在マスターノードのバックアップが設定されていません。データセキュリティを確保するため、障害時に新しいマスターノードに手動で切り替えられるよう、速やかにバックアップノードを設定してください。',
node: 'ノード',
addr: 'アドレス',
nodeUpgrade: '更新設定',
nodeUpgradeHelper:
'選択したノードは、マスターノードのアップグレード完了後に自動的にアップグレードを開始し、手動操作は不要です。',
nodeUnhealthy: 'ノード状態異常',
deletedNode: '削除済みノード {0} は現在アップグレード操作をサポートしていません!',
nodeUnhealthyHelper: 'ノード状態異常を検出しました。[ノード管理]で確認してから再試行してください!',
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const message = {
get: '가져오기',
upgrade: '업그레이드',
update: '업데이트',
updateNow: '지금 업데이트',
ignore: '업그레이드 무시',
install: '설치',
copy: '복사',
Expand Down Expand Up @@ -275,6 +276,7 @@ const message = {
scanFailed: '불완전',
success: '성공',
waiting: '대기 중',
waitForUpgrade: '업그레이드 대기 중',
waiting1: '대기 중',
failed: '실패',
stopped: '중지됨',
Expand Down Expand Up @@ -3430,6 +3432,9 @@ const message = {
'현재 마스터 노드 백업이 구성되지 않았습니다. 데이터 보안을 위해 장애 시 새로운 마스터 노드로 수동 전환이 가능하도록 가능한 빨리 백업 노드를 설정하십시오.',
node: '노드',
addr: '주소',
nodeUpgrade: '업데이트 설정',
nodeUpgradeHelper:
'선택된 노드는 마스터 노드 업그레이드 완료 후 자동으로 업그레이드를 시작하며 수동 작업이 필요하지 않습니다.',
nodeUnhealthy: '노드 상태 이상',
deletedNode: '삭제된 노드 {0}은(는) 현재 업그레이드 작업을 지원하지 않습니다!',
nodeUnhealthyHelper: '노드 상태 이상이 감지되었습니다. [노드 관리]에서 확인 후 다시 시도하세요!',
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const message = {
get: 'Dapatkan',
upgrade: 'Tingkatkan',
update: 'kemas kini',
updateNow: 'Kemas Kini Sekarang',
ignore: 'Abaikan peningkatan',
install: 'pasang',
copy: 'Salin',
Expand Down Expand Up @@ -281,6 +282,7 @@ const message = {
scanFailed: 'Tidak Lengkap',
success: 'Berjaya',
waiting: 'Menunggu',
waitForUpgrade: 'Tunggu Naik Taraf',
waiting1: 'Menunggu',
failed: 'Gagal',
stopped: 'Dihentikan',
Expand Down Expand Up @@ -3566,6 +3568,9 @@ const message = {
'Sandaran nod master belum dikonfigurasikan. Untuk memastikan keselamatan data, sila sediakan nod sandaran secepat mungkin untuk memudahkan pertukaran manual ke nod master baru sekiranya berlaku kegagalan.',
node: 'Nod',
addr: 'Alamat',
nodeUpgrade: 'Tetapan Kemas Kini',
nodeUpgradeHelper:
'Nod terpilih akan mula dinaik taraf secara automatik selepas naik taraf nod induk selesai, tiada operasi manual diperlukan.',
nodeUnhealthy: 'Status nod tidak normal',
deletedNode: 'Nod {0} yang telah dipadam tidak menyokong operasi naik taraf buat masa ini!',
nodeUnhealthyHelper: 'Status nod tidak normal dikesan. Sila semak dalam [Pengurusan Nod] dan cuba lagi!',
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const message = {
get: 'Obter',
upgrade: 'Atualizar versão',
update: 'atualizar',
updateNow: 'Atualizar Agora',
ignore: 'Ignorar atualização',
install: 'instalar',
copy: 'Copiar',
Expand Down Expand Up @@ -279,6 +280,7 @@ const message = {
scanFailed: 'Incompleto',
success: 'Sucesso',
waiting: 'Aguardando',
waitForUpgrade: 'Aguardar Atualização',
waiting1: 'Aguardando',
failed: 'Falhou',
stopped: 'Parado',
Expand Down Expand Up @@ -3585,6 +3587,9 @@ const message = {
'O backup do nó mestre não está configurado atualmente. Para garantir a segurança dos dados, configure um nó de backup o mais rápido possível para facilitar a troca manual para um novo nó mestre em caso de falha.',
node: 'Nó',
addr: 'Endereço',
nodeUpgrade: 'Configurações de Atualização',
nodeUpgradeHelper:
'Os nós selecionados começarão a atualizar automaticamente após a conclusão da atualização do nó mestre, nenhuma operação manual necessária.',
nodeUnhealthy: 'Estado do nó anormal',
deletedNode: 'O nó excluído {0} não suporta atualmente operações de atualização!',
nodeUnhealthyHelper:
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const message = {
get: 'Получить',
upgrade: 'Обновить',
update: 'обновление',
updateNow: 'Обновить Сейчас',
ignore: 'Игнорировать обновление',
install: 'установить',
copy: 'Копировать',
Expand Down Expand Up @@ -276,6 +277,7 @@ const message = {
scanFailed: 'Неполный',
success: 'Успешно',
waiting: 'Ожидание',
waitForUpgrade: 'Ожидание Обновления',
waiting1: 'Ожидание',
failed: 'Ошибка',
stopped: 'Остановлен',
Expand Down Expand Up @@ -3574,6 +3576,9 @@ const message = {
'Резервное копирование главного узла не настроено. Для обеспечения безопасности данных, пожалуйста, настройте резервный узел как можно скорее, чтобы можно было вручную переключиться на новый главный узел в случае сбоя.',
node: 'Узел',
addr: 'Адрес',
nodeUpgrade: 'Настройки Обновления',
nodeUpgradeHelper:
'Выбранные узлы автоматически начнут обновляться после завершения обновления основного узла, ручное вмешательство не требуется.',
nodeUnhealthy: 'Некорректное состояние узла',
deletedNode: 'Удалённый узел {0} в настоящее время не поддерживает операции обновления!',
nodeUnhealthyHelper:
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/lang/modules/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const message = {
get: 'Al',
upgrade: 'Yükselt',
update: 'Güncelle',
updateNow: 'Şimdi Güncelle',
ignore: 'Yükseltmeyi yoksay',
copy: 'Kopyala',
random: 'Rastgele',
Expand Down Expand Up @@ -289,6 +290,7 @@ const message = {
scanFailed: 'Eksik',
success: 'Başarılı',
waiting: 'Bekliyor',
waitForUpgrade: 'Yükseltme Bekleniyor',
failed: 'Başarısız',
stopped: 'Durduruldu',
error: 'Hata',
Expand Down Expand Up @@ -3652,6 +3654,9 @@ const message = {
'Ana düğüm yedeklemesi şu anda yapılandırılmamış. Veri güvenliği için, lütfen arıza durumunda yeni bir ana düğüme manuel geçiş yapabilmek amacıyla en kısa sürede bir yedek düğüm ayarlayın.',
node: 'Düğüm',
addr: 'Adres',
nodeUpgrade: 'Güncelleme Ayarları',
nodeUpgradeHelper:
'Seçilen düğümler, ana düğüm yükseltmesi tamamlandıktan sonra otomatik olarak yükseltmeye başlayacaktır, manuel işlem gerekmez.',
nodeUnhealthy: 'Düğüm durumu anormal',
deletedNode: 'Silinmiş düğüm {0} şu anda yükseltme işlemlerini desteklemiyor!',
nodeUnhealthyHelper:
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const message = {
get: '取得',
upgrade: '升級',
update: '更新',
updateNow: '立即更新',
ignore: '忽略升級',
copy: '複製',
random: '隨機密碼',
Expand Down Expand Up @@ -274,6 +275,7 @@ const message = {
scanFailed: '未完成',
success: '成功',
waiting: '請等待',
waitForUpgrade: '等待升級',
failed: '失敗',
stopped: '已停止',
error: '失敗',
Expand Down Expand Up @@ -3341,6 +3343,8 @@ const message = {
'目前未配置主節點備份,為保障資料安全,請盡快設定備份節點,便於主節點故障時可人工切換新主節點。',
node: '節點',
addr: '地址',
nodeUpgrade: '更新設定',
nodeUpgradeHelper: '選中的節點將在主節點升級完成後自動開始升級,無需手動操作。',
nodeUnhealthy: '節點狀態異常',
deletedNode: '已刪除節點 {0} 暫不支援升級操作!',
nodeUnhealthyHelper: '檢測到該節點狀態異常,請在 [節點管理] 中檢查後重試!',
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const message = {
get: '获取',
upgrade: '升级',
update: '更新',
updateNow: '立即更新',
ignore: '忽略升级',
copy: '复制',
random: '随机密码',
Expand Down Expand Up @@ -274,6 +275,7 @@ const message = {
scanFailed: '未完成',
success: '成功',
waiting: '请等待',
waitForUpgrade: '等待升级',
failed: '失败',
stopped: '已停止',
error: '失败',
Expand Down Expand Up @@ -3327,6 +3329,8 @@ const message = {
'当前未配置主节点备份,为保障数据安全,请尽快设置备份节点,便于主节点故障时可人工切换新主节点。',
node: '节点',
addr: '地址',
nodeUpgrade: '更新设置',
nodeUpgradeHelper: '选中的节点将在主节点升级完成后自动开始升级,无需手动操作。',
nodeUnhealthy: '节点状态异常',
deletedNode: '已删除节点 {0} 暂不支持升级操作!',
nodeUnhealthyHelper: '检测到该节点状态异常,请在 [节点管理] 中检查后重试!',
Expand Down
Loading