Initial commit (code only without large binaries)

This commit is contained in:
robin
2026-02-15 18:58:44 +08:00
commit 35df75498f
9442 changed files with 1495866 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
// 显示流量限制说明
Vue.component("plan-limit-view", {
props: ["value", "v-single-mode"],
data: function () {
let config = this.value
let hasLimit = false
if (!this.vSingleMode) {
if (config.trafficLimit != null && config.trafficLimit.isOn && ((config.trafficLimit.dailySize != null && config.trafficLimit.dailySize.count > 0) || (config.trafficLimit.monthlySize != null && config.trafficLimit.monthlySize.count > 0))) {
hasLimit = true
} else if (config.dailyRequests > 0 || config.monthlyRequests > 0) {
hasLimit = true
}
}
return {
config: config,
hasLimit: hasLimit
}
},
methods: {
formatNumber: function (n) {
return teaweb.formatNumber(n)
},
composeCapacity: function (capacity) {
return teaweb.convertSizeCapacityToString(capacity)
}
},
template: `<div style="font-size: 0.8em; color: grey">
<div class="ui divider" v-if="hasLimit"></div>
<div v-if="config.trafficLimit != null && config.trafficLimit.isOn">
<span v-if="config.trafficLimit.dailySize != null && config.trafficLimit.dailySize.count > 0">日流量限制:{{composeCapacity(config.trafficLimit.dailySize)}}<br/></span>
<span v-if="config.trafficLimit.monthlySize != null && config.trafficLimit.monthlySize.count > 0">月流量限制:{{composeCapacity(config.trafficLimit.monthlySize)}}<br/></span>
</div>
<div v-if="config.dailyRequests > 0">单日请求数限制:{{formatNumber(config.dailyRequests)}}</div>
<div v-if="config.monthlyRequests > 0">单月请求数限制:{{formatNumber(config.monthlyRequests)}}</div>
<div v-if="config.dailyWebsocketConnections > 0">单日Websocket限制{{formatNumber(config.dailyWebsocketConnections)}}</div>
<div v-if="config.monthlyWebsocketConnections > 0">单月Websocket限制{{formatNumber(config.monthlyWebsocketConnections)}}</div>
<div v-if="config.maxUploadSize != null && config.maxUploadSize.count > 0">文件上传限制:{{composeCapacity(config.maxUploadSize)}}</div>
</div>`
})