diff --git a/backend/app/service/snapshot.go b/backend/app/service/snapshot.go index cc5a6d72088f..8b616a9b0aac 100644 --- a/backend/app/service/snapshot.go +++ b/backend/app/service/snapshot.go @@ -72,7 +72,7 @@ func (u *SnapshotService) SnapshotImport(req dto.SnapshotImport) error { for _, snap := range req.Names { shortName := strings.TrimPrefix(snap, "snapshot_") nameItems := strings.Split(shortName, "_") - if !strings.HasPrefix(shortName, "1panel_v") || !strings.HasSuffix(shortName, ".tar.gz") || len(nameItems) != 3 { + if !strings.HasPrefix(shortName, "1panel_v") || !strings.HasSuffix(shortName, ".tar.gz") || len(nameItems) < 3 { return fmt.Errorf("incorrect snapshot name format of %s", shortName) } if strings.HasSuffix(snap, ".tar.gz") { diff --git a/backend/app/service/snapshot_create.go b/backend/app/service/snapshot_create.go index bfd171a6269a..3919b1f82cb3 100644 --- a/backend/app/service/snapshot_create.go +++ b/backend/app/service/snapshot_create.go @@ -140,6 +140,8 @@ func snapPanelData(snap snapHelper, localDir, targetDir string) { } _ = snapshotRepo.Update(snap.SnapID, map[string]interface{}{"status": "OnSaveData"}) + sysIP, _ := settingRepo.Get(settingRepo.WithByKey("SystemIP")) + _ = settingRepo.Update("SystemIP", "") checkPointOfWal() if err := handleSnapTar(dataDir, targetDir, "1panel_data.tar.gz", exclusionRules); err != nil { status = err.Error() @@ -148,6 +150,7 @@ func snapPanelData(snap snapHelper, localDir, targetDir string) { snap.Status.PanelData = status _ = snapshotRepo.UpdateStatus(snap.Status.ID, map[string]interface{}{"panel_data": status}) + _ = settingRepo.Update("SystemIP", sysIP.Value) } func snapCompress(snap snapHelper, rootDir string) { diff --git a/backend/router/ro_dashboard.go b/backend/router/ro_dashboard.go index 6dcc0808e9c8..7a4109b3259a 100644 --- a/backend/router/ro_dashboard.go +++ b/backend/router/ro_dashboard.go @@ -16,6 +16,7 @@ func (s *DashboardRouter) InitRouter(Router *gin.RouterGroup) { Use(middleware.PasswordExpired()) baseApi := v1.ApiGroupApp.BaseApi { + cmdRouter.GET("/base/os", baseApi.LoadDashboardOsInfo) cmdRouter.GET("/base/:ioOption/:netOption", baseApi.LoadDashboardBaseInfo) cmdRouter.GET("/current/:ioOption/:netOption", baseApi.LoadDashboardCurrentInfo) cmdRouter.POST("/system/restart/:operation", baseApi.SystemRestart)