// 访问日志搜索框 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 }) } }, data: function () { let ip = this.vIp if (ip == null) { ip = "" } let domain = this.vDomain if (domain == null) { domain = "" } let keyword = this.vKeyword if (keyword == null) { keyword = "" } return { ip: ip, domain: domain, keyword: keyword, nodes: [] } }, methods: { cleanIP: function () { this.ip = "" this.submit() }, cleanDomain: function () { this.domain = "" this.submit() }, cleanKeyword: function () { this.keyword = "" this.submit() }, submit: function () { let parent = this.$el.parentNode while (true) { if (parent == null) { break } if (parent.tagName == "FORM") { break } parent = parent.parentNode } if (parent != null) { setTimeout(function () { parent.submit() }, 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 }) } } }, template: `
` })