+
+
diff --git a/web/templates/res-restore.html b/web/templates/res-restore.html
new file mode 100644
index 0000000..3b6afda
--- /dev/null
+++ b/web/templates/res-restore.html
@@ -0,0 +1,300 @@
+
복구
+
+ - 복구
+ - Restore
+
+
+
+
+
\ No newline at end of file
diff --git a/web/templates/task.html b/web/templates/task.html
new file mode 100644
index 0000000..1b52eb6
--- /dev/null
+++ b/web/templates/task.html
@@ -0,0 +1,84 @@
+
백업
+
+ - 백업
+ - Back Up
+
+
+
\ No newline at end of file
diff --git a/websrc/controllers/backupHandlers.go b/websrc/controllers/backupHandlers.go
index 9e48e3a..bc51955 100644
--- a/websrc/controllers/backupHandlers.go
+++ b/websrc/controllers/backupHandlers.go
@@ -33,7 +33,7 @@ import (
//
// @Summary Export data from objectstorage
// @Description Export data from a objectstorage to files.
-// @Tags [Data Export], [Object Storage]
+// @Tags [Data Backup], [Object Storage]
// @Accept json
// @Produce json
// @Param RequestBody body models.BackupTask true "Parameters required for backup"
@@ -72,7 +72,7 @@ func BackupOSPostHandler(ctx echo.Context) error {
//
// @Summary Export data from MySQL
// @Description Export data from a MySQL database to SQL files.
-// @Tags [Data Export], [RDBMS]
+// @Tags [Data Backup], [RDBMS]
// @Accept json
// @Produce json
// @Param RequestBody body models.BackupTask true "Parameters required for backup"
@@ -160,7 +160,7 @@ func BackupRDBPostHandler(ctx echo.Context) error {
//
// @Summary Export data from MySQL
// @Description Export data from a MySQL database to SQL files.
-// @Tags [Data Export], [RDBMS]
+// @Tags [Data Backup], [RDBMS]
// @Accept json
// @Produce json
// @Param RequestBody body models.BackupTask true "Parameters required for backup"
@@ -177,33 +177,37 @@ func BackupNRDBPostHandler(ctx echo.Context) error {
params := models.BackupTask{}
if !getDataWithReBind(logger, start, ctx, ¶ms) {
+ errorMsg := fmt.Sprintf("err getDataWithReBind: %v", params)
return ctx.JSON(http.StatusOK, models.BasicResponse{
Result: logstrings.String(),
- Error: nil,
+ Error: &errorMsg,
})
}
-
+ logger.Debug().Msgf("%+v", params)
NRDBC, err = auth.GetNRDMS(¶ms.SourcePoint)
if err != nil {
+ errorMsg := fmt.Sprintf("err provider: %v", err)
return ctx.JSON(http.StatusInternalServerError, models.BasicResponse{
Result: logstrings.String(),
- Error: nil,
+ Error: &errorMsg,
})
}
err = os.MkdirAll(params.TargetPoint.Path, 0755)
if err != nil {
+ errorMsg := fmt.Sprintf("err Mkdir: %v", err)
return ctx.JSON(http.StatusInternalServerError, models.BasicResponse{
Result: logstrings.String(),
- Error: nil,
+ Error: &errorMsg,
})
}
tableList, err := NRDBC.ListTables()
if err != nil {
+ errorMsg := fmt.Sprintf("err Get ListTables: %v", err)
return ctx.JSON(http.StatusInternalServerError, models.BasicResponse{
Result: logstrings.String(),
- Error: nil,
+ Error: &errorMsg,
})
}
diff --git a/websrc/controllers/pageHandlers.go b/websrc/controllers/pageHandlers.go
index 489531a..6f020a5 100644
--- a/websrc/controllers/pageHandlers.go
+++ b/websrc/controllers/pageHandlers.go
@@ -33,6 +33,22 @@ func MainGetHandler(ctx echo.Context) error {
})
}
+///////////////////////////////////////////////////////////////////////////////////////////////
+// Page handlers related to Dashboard data
+
+func DashBoardHandler(ctx echo.Context) error {
+ logger := getLogger("dashboard")
+ logger.Info().Msg("dashboard get page accessed")
+ return ctx.Render(http.StatusOK, "index.html", models.BasicPageResponse{
+ Content: "dashboard",
+ AWSRegions: GetAWSRegions(),
+ GCPRegions: GetGCPRegions(),
+ NCPRegions: GetNCPRegions(),
+ OS: runtime.GOOS,
+ Error: nil,
+ })
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////
// Page handlers related to generate data
@@ -147,14 +163,32 @@ func BackupHandler(ctx echo.Context) error {
logger := getLogger("backup")
logger.Info().Msg("backup get page accessed")
return ctx.Render(http.StatusOK, "index.html", models.BasicPageResponse{
- Content: "Backup",
- Regions: GetAWSRegions(),
- OS: runtime.GOOS,
- Error: nil,
+ Content: "Backup",
+ AWSRegions: GetAWSRegions(),
+ GCPRegions: GetGCPRegions(),
+ NCPRegions: GetNCPRegions(),
+ OS: runtime.GOOS,
+ Error: nil,
})
}
///////////////////////////////////////////////////////////////////////////////////////////////
+// Page handlers related to backup data
+
+func RestoreHandler(ctx echo.Context) error {
+ logger := getLogger("restore")
+ logger.Info().Msg("restore get page accessed")
+ return ctx.Render(http.StatusOK, "index.html", models.BasicPageResponse{
+ Content: "Restore",
+ AWSRegions: GetAWSRegions(),
+ GCPRegions: GetGCPRegions(),
+ NCPRegions: GetNCPRegions(),
+ OS: runtime.GOOS,
+ Error: nil,
+ })
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////
// Page handlers related to migration data
// linux to object storage
diff --git a/websrc/controllers/restoreHandlers.go b/websrc/controllers/restoreHandlers.go
index 0278221..d73d778 100644
--- a/websrc/controllers/restoreHandlers.go
+++ b/websrc/controllers/restoreHandlers.go
@@ -37,7 +37,7 @@ import (
// @ID RestoreOSPostHandler
// @Summary Import data from objectstorage
// @Description Import data from a objectstorage to files.
-// @Tags [Data Import], [Object Storage]
+// @Tags [Data Restore], [Object Storage]
// @Accept json
// @Produce json
// @Param RequestBody body models.RestoreTask true "Parameters required for Restore"
@@ -77,7 +77,7 @@ func RestoreOSPostHandler(ctx echo.Context) error {
// @ID RestoreRDBPostHandler
// @Summary Import data from MySQL
// @Description Import data from a MySQL database to SQL files.
-// @Tags [Data Import], [RDBMS]
+// @Tags [Data Restore], [RDBMS]
// @Accept json
// @Produce json
// @Param RequestBody body models.RestoreTask true "Parameters required for Restore"
@@ -165,7 +165,7 @@ func RestoreRDBPostHandler(ctx echo.Context) error {
// @ID RestoreNRDBPostHandler
// @Summary Import data from MySQL
// @Description Import data from a MySQL database to SQL files.
-// @Tags [Data Import], [RDBMS]
+// @Tags [Data Restore], [RDBMS]
// @Accept json
// @Produce json
// @Param RequestBody body models.RestoreTask true "Parameters required for Restore"
diff --git a/websrc/routes/restoreRoutes.go b/websrc/routes/restoreRoutes.go
index 1bc2b84..df17432 100644
--- a/websrc/routes/restoreRoutes.go
+++ b/websrc/routes/restoreRoutes.go
@@ -33,7 +33,7 @@ func RestoreRoutes(g *echo.Group) {
}
func RestoreRoot(g *echo.Group) {
- // g.GET("", controllers.RestoreHandler)
+ g.GET("", controllers.RestoreHandler)
}
func RestoreObjectStorage(g *echo.Group) {
diff --git a/websrc/routes/taskRoutes.go b/websrc/routes/taskRoutes.go
index 6e986ca..9562f82 100644
--- a/websrc/routes/taskRoutes.go
+++ b/websrc/routes/taskRoutes.go
@@ -37,4 +37,5 @@ func TaskRoot(g *echo.Group, scheduleManager *task.FileScheduleManager) {
g.POST("", taskController.CreateTaskHandler) // Create a new task
g.PUT("/:id", taskController.UpdateTaskHandler) // Update an existing task by ID or OperationID
g.DELETE("/:id", taskController.DeleteTaskHandler) // Delete a task by ID or OperationID
+ g.GET("/dash", controllers.DashBoardHandler)
}