-
-
+
diff --git a/mayfly_go_web/src/views/ops/machine/MachineEdit.vue b/mayfly_go_web/src/views/ops/machine/MachineEdit.vue
index 2ee62052..605f13f0 100644
--- a/mayfly_go_web/src/views/ops/machine/MachineEdit.vue
+++ b/mayfly_go_web/src/views/ops/machine/MachineEdit.vue
@@ -5,12 +5,8 @@
-
-
+
+
@@ -100,6 +96,11 @@ const props = defineProps({
const emit = defineEmits(['update:visible', 'cancel', 'val-change'])
const rules = {
+ tagId: [{
+ required: true,
+ message: '请选择标签',
+ trigger: ['blur', 'change'],
+ }],
name: [
{
required: true,
@@ -250,7 +251,6 @@ const btnOk = async () => {
const getReqForm = () => {
const reqForm: any = { ...state.form };
- debugger
// 如果为密码认证,则置空授权凭证id
if (state.authType == 1) {
reqForm.authCertId = -1;
diff --git a/mayfly_go_web/src/views/ops/mongo/MongoEdit.vue b/mayfly_go_web/src/views/ops/mongo/MongoEdit.vue
index 55f1c7d9..f15dc45d 100644
--- a/mayfly_go_web/src/views/ops/mongo/MongoEdit.vue
+++ b/mayfly_go_web/src/views/ops/mongo/MongoEdit.vue
@@ -6,7 +6,7 @@
-
+
diff --git a/mayfly_go_web/src/views/ops/redis/RedisEdit.vue b/mayfly_go_web/src/views/ops/redis/RedisEdit.vue
index efbab2c9..bd17630f 100644
--- a/mayfly_go_web/src/views/ops/redis/RedisEdit.vue
+++ b/mayfly_go_web/src/views/ops/redis/RedisEdit.vue
@@ -6,7 +6,7 @@
-
+
@@ -89,6 +89,18 @@ const props = defineProps({
const emit = defineEmits(['update:visible', 'val-change', 'cancel'])
const rules = {
+ tagId: [{
+ required: true,
+ message: '请选择标签',
+ trigger: ['blur', 'change'],
+ }],
+ name: [
+ {
+ required: true,
+ message: '请输入名称',
+ trigger: ['change', 'blur'],
+ },
+ ],
host: [
{
required: true,
diff --git a/server/internal/db/api/form/db.go b/server/internal/db/api/form/db.go
index a69f63b2..642dac66 100644
--- a/server/internal/db/api/form/db.go
+++ b/server/internal/db/api/form/db.go
@@ -11,8 +11,8 @@ type DbForm struct {
Params string `json:"params"`
Database string `json:"database"`
Remark string `json:"remark"`
- TagId uint64 `json:"tagId"`
- TagPath string `json:"tagPath"`
+ TagId uint64 `binding:"required" json:"tagId"`
+ TagPath string `binding:"required" json:"tagPath"`
SshTunnelMachineId int `json:"sshTunnelMachineId"`
}
diff --git a/server/internal/machine/api/form/form.go b/server/internal/machine/api/form/form.go
index 00fb0443..4d32b734 100644
--- a/server/internal/machine/api/form/form.go
+++ b/server/internal/machine/api/form/form.go
@@ -8,7 +8,7 @@ type MachineForm struct {
// 资产授权凭证信息列表
AuthCertId int `json:"authCertId"`
- TagId uint64 `json:"tagId"`
+ TagId uint64 `json:"tagId" binding:"required"`
TagPath string `json:"tagPath" binding:"required"`
Username string `json:"username"`
Password string `json:"password"`
diff --git a/server/internal/mongo/api/form/mongo.go b/server/internal/mongo/api/form/mongo.go
index 2d64aea4..237e3733 100644
--- a/server/internal/mongo/api/form/mongo.go
+++ b/server/internal/mongo/api/form/mongo.go
@@ -6,7 +6,7 @@ type Mongo struct {
SshTunnelMachineId int `json:"sshTunnelMachineId"` // ssh隧道机器id
Name string `binding:"required" json:"name"`
TagId uint64 `binding:"required" json:"tagId"`
- TagPath string `json:"tagPath"`
+ TagPath string `binding:"required" json:"tagPath"`
}
type MongoCommand struct {
diff --git a/server/internal/redis/api/form/redis.go b/server/internal/redis/api/form/redis.go
index c4644cfe..b1156112 100644
--- a/server/internal/redis/api/form/redis.go
+++ b/server/internal/redis/api/form/redis.go
@@ -9,7 +9,7 @@ type Redis struct {
Db string `json:"db"`
SshTunnelMachineId int `json:"sshTunnelMachineId"` // ssh隧道机器id
TagId uint64 `binding:"required" json:"tagId"`
- TagPath string `json:"tagPath"`
+ TagPath string `binding:"required" json:"tagPath"`
Remark string `json:"remark"`
}