diff --git a/web/public/js/components.js b/web/public/js/components.js index 3bebc773..029dc22e 100755 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -321,6 +321,33 @@ Vue.component("cluster-selector", { ` }) +Vue.component("node-cluster-combo-box", { + props: ["v-cluster-id"], + data: function () { + let that = this + Tea.action("/clusters/options") + .post() + .success(function (resp) { + that.clusters = resp.data.clusters + }) + return { + clusters: [] + } + }, + methods: { + change: function (item) { + if (item == null) { + this.$emit("change", 0) + } else { + this.$emit("change", item.value) + } + } + }, + template: `
+ +
` +}) + // 一个节点的多个集群选择器 Vue.component("node-clusters-selector", { props: ["v-primary-cluster", "v-secondary-clusters"], @@ -7836,14 +7863,7 @@ Vue.component("http-remote-addr-config-box", { // 访问日志搜索框 Vue.component("http-access-log-search-box", { - props: ["v-ip", "v-domain", "v-keyword", "v-cluster-id", "v-node-id", "v-clusters"], - mounted: function () { - if (this.vClusterId >0) { - this.changeCluster({ - value: this.vClusterId - }) - } - }, + props: ["v-ip", "v-domain", "v-keyword", "v-cluster-id", "v-node-id"], data: function () { let ip = this.vIp if (ip == null) { @@ -7864,7 +7884,7 @@ Vue.component("http-access-log-search-box", { ip: ip, domain: domain, keyword: keyword, - nodes: [] + clusterId: this.vClusterId } }, methods: { @@ -7897,19 +7917,8 @@ Vue.component("http-access-log-search-box", { }, 500) } }, - changeCluster: function (item) { - this.nodes = [] - if (item != null) { - let that = this - Tea.action("/servers/logs/nodeOptions") - .params({ - clusterId: item.value - }) - .post() - .success(function (resp) { - that.nodes = resp.data.nodes - }) - } + changeCluster: function (clusterId) { + this.clusterId = clusterId } }, template: `
@@ -7939,11 +7948,11 @@ Vue.component("http-access-log-search-box", {
-
- +
+
-
- +
+
@@ -11719,9 +11728,32 @@ Vue.component("combo-box", { }, change: function () { this.$emit("change", this.selectedItem) + + let that = this + setTimeout(function () { + if (that.$refs.selectedLabel != null) { + that.$refs.selectedLabel.focus() + } + }) + }, + submitForm: function (event) { + if (event.target.tagName != "A") { + return + } + let parentBox = this.$refs.selectedLabel.parentNode + while (true) { + parentBox = parentBox.parentNode + if (parentBox == null || parentBox.tagName == "BODY") { + return + } + if (parentBox.tagName == "FORM") { + parentBox.submit() + break + } + } } }, - template: `
+ template: `
@@ -11730,14 +11762,14 @@ Vue.component("combo-box", {
- {{title}}:{{selectedItem.name}} - - + {{title}}:{{selectedItem.name}} + +
- @@ -13446,6 +13478,27 @@ Vue.component("node-region-selector", {
` }) +Vue.component("node-combo-box", { + props: ["v-cluster-id", "v-node-id"], + data: function () { + let that = this + Tea.action("/clusters/nodeOptions") + .params({ + clusterId: this.vClusterId + }) + .post() + .success(function (resp) { + that.nodes = resp.data.nodes + }) + return { + nodes: [] + } + }, + template: `
+ +
` +}) + Vue.component("dns-route-selector", { props: ["v-all-routes", "v-routes"], data: function () {