添加和修改域名只需要点击一次保存按钮

This commit is contained in:
GoEdgeLab
2024-05-15 13:50:11 +08:00
parent 7eae39fe1c
commit 7c7ab225db

View File

@@ -19,6 +19,7 @@ Vue.component("server-name-box", {
callback: function (resp) { callback: function (resp) {
var serverName = resp.data.serverName var serverName = resp.data.serverName
that.serverNames.push(serverName) that.serverNames.push(serverName)
setTimeout(that.submitForm, 100)
} }
}); });
}, },
@@ -34,6 +35,7 @@ Vue.component("server-name-box", {
callback: function (resp) { callback: function (resp) {
var serverName = resp.data.serverName var serverName = resp.data.serverName
Vue.set(that.serverNames, index, serverName) Vue.set(that.serverNames, index, serverName)
setTimeout(that.submitForm, 100)
} }
}); });
}, },
@@ -69,6 +71,9 @@ Vue.component("server-name-box", {
} }
}) })
return result return result
},
submitForm: function () {
Tea.runActionOn(this.$refs.serverNamesRef.form)
} }
}, },
watch: { watch: {
@@ -95,7 +100,7 @@ Vue.component("server-name-box", {
} }
}, },
template: `<div> template: `<div>
<input type="hidden" name="serverNames" :value="JSON.stringify(serverNames)"/> <input type="hidden" name="serverNames" :value="JSON.stringify(serverNames)" ref="serverNamesRef"/>
<div v-if="serverNames.length > 0"> <div v-if="serverNames.length > 0">
<div v-for="(serverName, index) in serverNames" class="ui label small basic" :class="{hidden: serverName.isShowing === false}"> <div v-for="(serverName, index) in serverNames" class="ui label small basic" :class="{hidden: serverName.isShowing === false}">
<em v-if="serverName.type != 'full'">{{serverName.type}}</em> <em v-if="serverName.type != 'full'">{{serverName.type}}</em>