mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-12 03:10:26 +08:00
阶段性提交
This commit is contained in:
46
web/public/js/components/server/gzip-box.js
Normal file
46
web/public/js/components/server/gzip-box.js
Normal file
@@ -0,0 +1,46 @@
|
||||
Vue.component("gzip-box", {
|
||||
props: ["v-gzip-config"],
|
||||
data: function () {
|
||||
let gzip = this.vGzipConfig
|
||||
if (gzip == null) {
|
||||
gzip = {
|
||||
isOn: true,
|
||||
level: 0,
|
||||
minLength: null,
|
||||
maxLength: null
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
gzip: gzip,
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">压缩级别</td>
|
||||
<td>
|
||||
<select class="dropdown auto-width" name="level" v-model="gzip.level">
|
||||
<option value="0">不压缩</option>
|
||||
<option v-for="i in 9" :value="i">{{i}}</option>
|
||||
</select>
|
||||
<p class="comment">级别越高,压缩比例越大。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gzip内容最小长度</td>
|
||||
<td>
|
||||
<size-capacity-box :v-name="'minLength'" :v-value="gzip.minLength" :v-unit="'kb'"></size-capacity-box>
|
||||
<p class="comment">0表示不限制,内容长度从文件尺寸或Content-Length中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gzip内容最大长度</td>
|
||||
<td>
|
||||
<size-capacity-box :v-name="'maxLength'" :v-value="gzip.maxLength" :v-unit="'mb'"></size-capacity-box>
|
||||
<p class="comment">0表示不限制,内容长度从文件尺寸或Content-Length中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>`
|
||||
})
|
||||
37
web/public/js/components/server/server-name-box.js
Normal file
37
web/public/js/components/server/server-name-box.js
Normal file
@@ -0,0 +1,37 @@
|
||||
Vue.component("server-name-box", {
|
||||
props: ["v-server-names"],
|
||||
data: function () {
|
||||
let serverNames = this.vServerNames;
|
||||
if (serverNames == null) {
|
||||
serverNames = []
|
||||
}
|
||||
return {
|
||||
serverNames: serverNames
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addServerName: function () {
|
||||
let that = this
|
||||
teaweb.popup("/servers/addServerNamePopup", {
|
||||
callback: function (resp) {
|
||||
var serverName = resp.data.serverName
|
||||
that.serverNames.push(serverName)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
removeServerName: function (index) {
|
||||
this.serverNames.$remove(index)
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<input type="hidden" name="serverNames" :value="JSON.stringify(serverNames)"/>
|
||||
<div v-if="serverNames.length > 0">
|
||||
<div v-for="(serverName, index) in serverNames" class="ui label small">
|
||||
<em v-if="serverName.type != 'full'">{{serverName.type}}</em> {{serverName.name}} <a href="" title="删除" @click.prevent="removeServerName(index)"><i class="icon remove"></i></a>
|
||||
</div>
|
||||
<div class="ui divider"></div>
|
||||
</div>
|
||||
<a href="" @click.prevent="addServerName()">[添加域名绑定]</a>
|
||||
</div>`
|
||||
})
|
||||
Reference in New Issue
Block a user