fix: Exclude system ip from snapshot backups (#10100)

Refs  #9991
This commit is contained in:
ssongliu 2025-08-22 11:05:50 +08:00 committed by GitHub
parent fd9c421969
commit 5fd9d20f99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 2 deletions

View file

@ -121,7 +121,7 @@ func (u *SnapshotService) LoadSnapshotData() (dto.SnapshotData, error) {
}
i := 0
for _, item := range itemBackups {
if item.Label != "app" && item.Label != "system_snapshot" {
if item.Label != "app" && item.Label != "system_snapshot" && item.Label != "tmp" {
itemBackups[i] = item
i++
}

View file

@ -242,6 +242,7 @@ func loadDbConn(snap *snapHelper, targetDir string, req dto.SnapshotCreate) erro
return err
}
snap.snapAgentDB = agentDb
_ = snap.snapAgentDB.Model(&model.Setting{}).Where("key = ?", "SystemIP").Updates(map[string]interface{}{"value": ""}).Error
coreDb, err := common.LoadDBConnByPathWithErr(path.Join(targetDir, "db/core.db"), "core.db")
snap.Task.LogWithStatus(i18n.GetWithName("SnapNewDB", "core"), err)
if err != nil {

View file

@ -136,7 +136,7 @@ export const updateAppStoreConfig = (req: App.AppStoreConfigUpdate) => {
// snapshot
export const loadSnapshotInfo = () => {
return http.get<Setting.SnapshotData>(`/settings/snapshot/load`);
return http.get<Setting.SnapshotData>(`/settings/snapshot/load`, {}, TimeoutEnum.T_60S);
};
export const snapshotCreate = (param: Setting.SnapshotCreate) => {
return http.post(`/settings/snapshot`, param);

View file

@ -397,6 +397,8 @@ const load18n = (node: any, label: string) => {
return i18n.global.t('setting.' + label + 'Label');
case 'system_snapshot':
return i18n.global.t('setting.snapshotLabel');
case 'master':
return i18n.global.t('xpack.node.masterBackup');
default:
return label;
}