Vue.component("http-fastcgi-box", { props: ["v-fastcgi-ref", "v-fastcgi-configs", "v-is-location"], data: function () { let fastcgiRef = this.vFastcgiRef if (fastcgiRef == null) { fastcgiRef = { isPrior: false, isOn: false, fastcgiIds: [] } } let fastcgiConfigs = this.vFastcgiConfigs if (fastcgiConfigs == null) { fastcgiConfigs = [] } else { fastcgiRef.fastcgiIds = fastcgiConfigs.map(function (v) { return v.id }) } return { fastcgiRef: fastcgiRef, fastcgiConfigs: fastcgiConfigs, advancedVisible: false } }, methods: { isOn: function () { return (!this.vIsLocation || this.fastcgiRef.isPrior) && this.fastcgiRef.isOn }, createFastcgi: function () { let that = this teaweb.popup("/servers/server/settings/fastcgi/createPopup", { height: "26em", callback: function (resp) { teaweb.success("添加成功", function () { that.fastcgiConfigs.push(resp.data.fastcgi) that.fastcgiRef.fastcgiIds.push(resp.data.fastcgi.id) }) } }) }, updateFastcgi: function (fastcgiId, index) { let that = this teaweb.popup("/servers/server/settings/fastcgi/updatePopup?fastcgiId=" + fastcgiId, { callback: function (resp) { teaweb.success("修改成功", function () { Vue.set(that.fastcgiConfigs, index, resp.data.fastcgi) }) } }) }, removeFastcgi: function (index) { this.fastcgiRef.fastcgiIds.$remove(index) this.fastcgiConfigs.$remove(index) } }, template: `
启用配置
Fastcgi服务
{{fastcgi.address}}    
` })