Initial commit (code only without large binaries)
This commit is contained in:
6
EdgeAdmin/web/views/@default/plans/plan/@menu.html
Normal file
6
EdgeAdmin/web/views/@default/plans/plan/@menu.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<first-menu>
|
||||
<menu-item href="/plans">所有套餐</menu-item>
|
||||
<span class="item disabled">|</span>
|
||||
<menu-item :href="'/plans/plan?planId=' + plan.id" code="index">"{{plan.name}}"详情</menu-item>
|
||||
<menu-item :href="'/plans/plan/update?planId=' + plan.id" code="update">修改</menu-item>
|
||||
</first-menu>
|
||||
133
EdgeAdmin/web/views/@default/plans/plan/index.html
Normal file
133
EdgeAdmin/web/views/@default/plans/plan/index.html
Normal file
@@ -0,0 +1,133 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">套餐名称</td>
|
||||
<td>
|
||||
{{plan.name}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>状态</td>
|
||||
<td><label-on :v-is-on="plan.isOn"></label-on></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>套餐简介</td>
|
||||
<td>
|
||||
<span v-if="plan.description.length > 0">{{plan.description}}</span>
|
||||
<span v-else class="disabled">还没有简介。</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>关联集群</td>
|
||||
<td>
|
||||
<span v-if="plan.cluster.id > 0">
|
||||
<link-icon :href="'/clusters/cluster?clusterId=' + plan.cluster.id">{{plan.cluster.name}}</link-icon>
|
||||
</span>
|
||||
<span v-else class="red">[已删除]</span>
|
||||
<p class="comment">使用当前套餐的网站都将会部署在此集群上。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>价格设置</td>
|
||||
<td>
|
||||
<plan-price-view :v-plan="plan"></plan-price-view>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">流量限制</td>
|
||||
<td>
|
||||
<div v-if="plan.trafficLimit != null && plan.trafficLimit.isOn">
|
||||
<plan-limit-view :value="plan" :v-single-mode="true"></plan-limit-view>
|
||||
</div>
|
||||
<span v-else class="disabled">没有限制</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>带宽限制</td>
|
||||
<td>
|
||||
<div v-if="plan.bandwidthLimitPerNode != null && plan.bandwidthLimitPerNode.count > 0">
|
||||
<bandwidth-size-capacity-view :v-value="plan.bandwidthLimitPerNode"></bandwidth-size-capacity-view>
|
||||
</div>
|
||||
<span v-else class="disabled">没有限制</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>总网站数限制</td>
|
||||
<td>
|
||||
<span v-if="plan.totalServers > 0">{{plan.totalServers}}</span>
|
||||
<span v-else class="disabled">没有限制</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>总域名数限制</td>
|
||||
<td>
|
||||
<span v-if="plan.totalServerNames > 0">{{plan.totalServerNames}}</span>
|
||||
<span v-else class="disabled">没有限制</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>每个网站最多域名数</td>
|
||||
<td>
|
||||
<span v-if="plan.totalServerNamesPerServer > 0">{{plan.totalServerNamesPerServer}}</span>
|
||||
<span v-else class="disabled">没有限制</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单日请求数限制</td>
|
||||
<td>
|
||||
<span v-if="plan.dailyRequests > 0">{{plan.dailyRequestsFormat}}次/日</span>
|
||||
<span v-else class="disabled">没有限制</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单月请求数限制</td>
|
||||
<td>
|
||||
<span v-if="plan.monthlyRequests > 0">{{plan.monthlyRequestsFormat}}次/月</span>
|
||||
<span v-else class="disabled">没有限制</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单日Websocket连接数限制</td>
|
||||
<td>
|
||||
<span v-if="plan.dailyWebsocketConnections > 0">{{plan.dailyWebsocketConnections}}次/日</span>
|
||||
<span v-else class="disabled">没有限制</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单月Websocket连接数限制</td>
|
||||
<td>
|
||||
<span v-if="plan.monthlyWebsocketConnections > 0">{{plan.monthlyWebsocketConnections}}次/月</span>
|
||||
<span v-else class="disabled">没有限制</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>文件上传最大尺寸</td>
|
||||
<td>
|
||||
<span v-if="plan.maxUploadSize != null && plan.maxUploadSize.count > 0">
|
||||
<size-capacity-view :v-value="plan.maxUploadSize"></size-capacity-view>
|
||||
</span>
|
||||
<span v-else class="disabled">没有限制</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">支持的功能</td>
|
||||
<td>
|
||||
<div v-if="plan.hasFullFeatures">所有功能</div>
|
||||
<div v-else>
|
||||
<span v-if="plan.features == null || plan.features.length == 0" class="disabled">没有任何功能</span>
|
||||
<span v-else>
|
||||
<span class="ui label basic small" v-for="feature in plan.features" :class="{disabled: !feature.isChecked}">{{feature.name}}</span>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
4
EdgeAdmin/web/views/@default/plans/plan/index.js
Normal file
4
EdgeAdmin/web/views/@default/plans/plan/index.js
Normal file
@@ -0,0 +1,4 @@
|
||||
Tea.context(function () {
|
||||
this.plan.dailyRequestsFormat = teaweb.formatNumber(this.plan.dailyRequests)
|
||||
this.plan.monthlyRequestsFormat = teaweb.formatNumber(this.plan.monthlyRequests)
|
||||
})
|
||||
9
EdgeAdmin/web/views/@default/plans/plan/update.css
Normal file
9
EdgeAdmin/web/views/@default/plans/plan/update.css
Normal file
@@ -0,0 +1,9 @@
|
||||
.feature-boxes .feature-box {
|
||||
margin-bottom: 1em;
|
||||
width: 24em;
|
||||
float: left;
|
||||
}
|
||||
.feature-boxes .feature-box:hover label {
|
||||
font-weight: bold;
|
||||
}
|
||||
/*# sourceMappingURL=update.css.map */
|
||||
1
EdgeAdmin/web/views/@default/plans/plan/update.css.map
Normal file
1
EdgeAdmin/web/views/@default/plans/plan/update.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["update.less"],"names":[],"mappings":"AAAA,cACC;EACC,kBAAA;EACA,WAAA;EACA,WAAA;;AAJF,cAOC,aAAY,MACX;EACC,iBAAA","file":"update.css"}
|
||||
160
EdgeAdmin/web/views/@default/plans/plan/update.html
Normal file
160
EdgeAdmin/web/views/@default/plans/plan/update.html
Normal file
@@ -0,0 +1,160 @@
|
||||
{$layout}
|
||||
{$template "menu"}
|
||||
|
||||
<div class="ui warning message">注意:修改套餐内容后,用户所有相关已购套餐也会自动变更。</div>
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="planId" :value="plan.id"/>
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">套餐名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" ref="focus" maxlength="100" v-model="plan.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>套餐简介</td>
|
||||
<td>
|
||||
<input type="text" name="description" maxlength="100" v-model="plan.description"/>
|
||||
<p class="comment">为用户介绍当前套餐的应用场景。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>关联集群 *</td>
|
||||
<td>
|
||||
<cluster-selector :v-cluster-id="plan.cluster.id"></cluster-selector>
|
||||
<p class="comment">使用当前套餐的网站都将会部署在此集群上。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>价格设置 *</td>
|
||||
<td>
|
||||
<plan-price-config-box
|
||||
:v-price-type="plan.priceType"
|
||||
:v-monthly-price="plan.monthlyPrice"
|
||||
:v-seasonally-price="plan.seasonallyPrice"
|
||||
:v-yearly-price="plan.yearlyPrice"
|
||||
:v-traffic-price="plan.trafficPrice"
|
||||
:v-bandwidth-price="plan.bandwidthPrice">
|
||||
</plan-price-config-box>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="ui definition selectable table">
|
||||
<tr>
|
||||
<td class="title">流量限制</td>
|
||||
<td>
|
||||
<traffic-limit-config-box :v-traffic-limit="plan.trafficLimit"></traffic-limit-config-box>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>带宽限制</td>
|
||||
<td>
|
||||
<bandwidth-size-capacity-box :v-name="'bandwidthLimitPerNodeJSON'" :v-value="plan.bandwidthLimitPerNode"></bandwidth-size-capacity-box>
|
||||
<p class="comment">该套餐在单个CDN节点上的带宽限制,不填或者为0表示不限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>总网站数限制</td>
|
||||
<td>
|
||||
<digit-input name="totalServers" size="6" style="width: 6em" value="0" maxlength="6" v-model="plan.totalServers"></digit-input>
|
||||
<p class="comment">当前套餐能够绑定的总网站数量,0表示不限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>总域名数限制</td>
|
||||
<td>
|
||||
<digit-input name="totalServerNames" size="6" style="width: 6em" value="0" maxlength="6" v-model="plan.totalServerNames"></digit-input>
|
||||
<p class="comment">当前套餐能够绑定的总域名数量(即每个网站的所有域名总数量),0表示不限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>每个网站最多域名数</td>
|
||||
<td>
|
||||
<digit-input name="totalServerNamesPerServer" size="6" style="width: 6em" value="0" maxlength="6" v-model="plan.totalServerNamesPerServer"></digit-input>
|
||||
<p class="comment">当前套餐能够绑定的单个网站能够添加的最多域名数量,0表示不限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单日请求数限制</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<digit-input name="dailyRequests" size="16" style="width: 12em" value="0" maxlength="16" @input="changeDailyRequests" v-model="plan.dailyRequests"></digit-input>
|
||||
<span class="ui label">次/每日</span>
|
||||
</div>
|
||||
<p class="comment"><span v-if="dailyRequestsFormat.length > 0">当前输入:{{dailyRequestsFormat}}。</span>当前套餐下的所有网站每天可以处理的请求数限制,0表示不限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单月请求数限制</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<digit-input name="monthlyRequests" size="16" style="width: 12em" value="0" maxlength="16" @input="changeMonthlyRequests" v-model="plan.monthlyRequests"></digit-input>
|
||||
<span class="ui label">次/每月</span>
|
||||
</div>
|
||||
<p class="comment"><span v-if="monthlyRequestsFormat.length > 0">当前输入:{{monthlyRequestsFormat}}。</span>当前套餐下的所有网站每月可以处理的请求数限制,0表示不限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单日Websocket连接数限制</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<digit-input name="dailyWebsocketConnections" size="16" style="width: 12em" value="0" maxlength="16" @input="changeDailyWebsocketConnections" v-model="plan.dailyWebsocketConnections"></digit-input>
|
||||
<span class="ui label">次/每日</span>
|
||||
</div>
|
||||
<p class="comment"><span v-if="dailyWebsocketConnectionsFormat.length > 0">当前输入:{{dailyWebsocketConnectionsFormat}}。</span>当前套餐下的所有网站每天可以接受的Websocket连接数限制,0表示不限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>单月Websocket连接数限制</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<digit-input name="monthlyWebsocketConnections" size="16" style="width: 12em" value="0" maxlength="16" @input="changeMonthlyWebsocketConnections" v-model="plan.monthlyWebsocketConnections"></digit-input>
|
||||
<span class="ui label">次/每月</span>
|
||||
</div>
|
||||
<p class="comment"><span v-if="monthlyWebsocketConnectionsFormat.length > 0">当前输入:{{monthlyWebsocketConnectionsFormat}}。</span>当前套餐下的所有网站每月可以接受的Websocket连接数限制,0表示不限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>文件上传最大尺寸</td>
|
||||
<td>
|
||||
<size-capacity-box :v-name="'maxUploadSizeJSON'" :v-value="plan.maxUploadSize"></size-capacity-box>
|
||||
<p class="comment">单次上传的文件最大内容尺寸;0表示不限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">包含所有功能</td>
|
||||
<td>
|
||||
<checkbox name="hasFullFeatures" v-model="plan.hasFullFeatures"></checkbox>
|
||||
<p class="comment">选中后,表示当前套餐用户包含所有功能;取消选中后,可以选择支持的功能。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="!plan.hasFullFeatures">
|
||||
<td>选择支持的功能</td>
|
||||
<td>
|
||||
<div class="feature-boxes">
|
||||
<div class="feature-box" v-for="feature in features">
|
||||
<checkbox name="featureCodes" :v-value="feature.code" v-model="feature.isChecked">{{feature.name}}</checkbox>
|
||||
<p class="comment">{{feature.description}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">启用当前套餐</td>
|
||||
<td>
|
||||
<checkbox name="isOn" v-model="plan.isOn"></checkbox>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
61
EdgeAdmin/web/views/@default/plans/plan/update.js
Normal file
61
EdgeAdmin/web/views/@default/plans/plan/update.js
Normal file
@@ -0,0 +1,61 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifySuccess("保存成功", "/plans/plan?planId=" + this.plan.id)
|
||||
|
||||
this.$delay(function () {
|
||||
this.changeDailyRequests(this.plan.dailyRequests)
|
||||
this.changeMonthlyRequests(this.plan.monthlyRequests)
|
||||
})
|
||||
|
||||
this.dailyRequestsFormat = ""
|
||||
this.changeDailyRequests = function (v) {
|
||||
if (v <= 0) {
|
||||
this.dailyRequestsFormat = ""
|
||||
} else {
|
||||
this.dailyRequestsFormat = teaweb.formatNumber(v) + this.formatZHW(v)
|
||||
}
|
||||
}
|
||||
|
||||
this.monthlyRequestsFormat = ""
|
||||
this.changeMonthlyRequests = function (v) {
|
||||
if (v <= 0) {
|
||||
this.monthlyRequestsFormat = ""
|
||||
} else {
|
||||
this.monthlyRequestsFormat = teaweb.formatNumber(v) + this.formatZHW(v)
|
||||
}
|
||||
}
|
||||
|
||||
this.dailyWebsocketConnectionsFormat = ""
|
||||
this.changeDailyWebsocketConnections = function (v) {
|
||||
if (v <= 0) {
|
||||
this.dailyWebsocketConnectionsFormat = ""
|
||||
} else {
|
||||
this.dailyWebsocketConnectionsFormat = teaweb.formatNumber(v) + this.formatZHW(v)
|
||||
}
|
||||
}
|
||||
|
||||
this.monthlyWebsocketConnectionsFormat = ""
|
||||
this.changeMonthlyWebsocketConnections = function (v) {
|
||||
if (v <= 0) {
|
||||
this.monthlyWebsocketConnectionsFormat = ""
|
||||
} else {
|
||||
this.monthlyWebsocketConnectionsFormat = teaweb.formatNumber(v) + this.formatZHW(v)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* format number to zh-cn|tw|hk wan(s)
|
||||
*/
|
||||
this.formatZHW = function (v) {
|
||||
let count = v / 10000
|
||||
if (v >= 1000000000000) {
|
||||
return ",相当于" + (v / 1000000000000) + "兆"
|
||||
}
|
||||
if (v >= 100000000) {
|
||||
return ",相当于" + (v / 100000000) + "亿"
|
||||
}
|
||||
if (v >= 10000) {
|
||||
return ",相当于" + (v / 10000) + "万"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
})
|
||||
13
EdgeAdmin/web/views/@default/plans/plan/update.less
Normal file
13
EdgeAdmin/web/views/@default/plans/plan/update.less
Normal file
@@ -0,0 +1,13 @@
|
||||
.feature-boxes {
|
||||
.feature-box {
|
||||
margin-bottom: 1em;
|
||||
width: 24em;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.feature-box:hover {
|
||||
label {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user