This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
{$layout}
<second-menu>
<menu-item href="/anti-ddos/packages">[购买实例]</menu-item>
</second-menu>
<p class="comment" v-if="userInstances.length == 0">暂时还没有实例,<a href="/anti-ddos/packages">[点此购买]</a></p>
<div v-if="userInstances.length > 0">
<table class="ui table selectable celled">
<thead>
<tr>
<th>高防产品</th>
<th>高防IP</th>
<th style="width: 7em">有效期</th>
<th style="width: 7em">开始日期</th>
<th style="width: 7em">结束日期</th>
<th class="width6">防护对象</th>
<th class="two op">操作</th>
</tr>
</thead>
<tr v-for="userInstance in userInstances">
<td>
<span v-if="userInstance.package.id > 0">{{userInstance.package.summary}}</span>
<span v-else class="red">已删除</span>
</td>
<td>
<div v-if="userInstance.ipAddresses != null && userInstance.ipAddresses.length > 0">
<div v-for="ip in userInstance.ipAddresses">
{{ip}}
</div>
</div>
<span v-else class="red">无有效IP</span>
</td>
<td>{{userInstance.periodCount}}{{userInstance.periodUnitName}}</td>
<td>{{userInstance.dayFrom}}</td>
<td>{{userInstance.dayTo}}
<div v-if="userInstance.isExpired">
<span v-if="userInstance.isExpired" class="small red">已过期</span>
</div>
</td>
<td>
<!-- 防护对象 -->
<a href="" v-if="userInstance.isAvailable" @click.prevent="updateObjectsPopup(userInstance.id)">
<span v-if="userInstance.countObjects > 0">{{userInstance.countObjects}}个对象</span>
<span v-else>设置</span>
</a>
<span v-else class="disabled">{{userInstance.countObjects}}</span>
&nbsp;
</td>
<td>
<!-- 续费 -->
<span v-if="userInstance.instance.userInstanceId == userInstance.id"><a :href="'/anti-ddos/instances/renew?userInstanceId=' + userInstance.id">续费</a></span>
<span v-else class="disabled">续费</span> &nbsp;
<!-- 删除 -->
<a href="" v-if="userInstance.canDelete" @click.prevent="deleteUserInstance(userInstance.id)">删除</a>
</td>
</tr>
</table>
<page-box></page-box>
</div>

View File

@@ -0,0 +1,33 @@
Tea.context(function () {
this.renewUserInstance = function (userInstanceId) {
teaweb.popup(".renewPopup?userInstanceId=" + userInstanceId, {
height: "26em",
callback: function () {
teaweb.successRefresh("续期成功")
}
})
}
this.updateObjectsPopup = function (userInstanceId) {
teaweb.popup(".updateObjectsPopup?userInstanceId=" + userInstanceId, {
width: "60em",
height: "40em",
callback: function () {
teaweb.successRefresh("保存成功")
}
})
}
this.deleteUserInstance = function (userInstanceId) {
let that = this
teaweb.confirm("确定要删除此实例吗?", function () {
that.$post(".delete")
.params({
userInstanceId: userInstanceId
})
.success(function () {
teaweb.successRefresh("删除成功")
})
})
}
})

View File

@@ -0,0 +1,62 @@
{$layout}
<!-- 步骤 -->
<div class="ui steps fluid">
<div class="step active">
<a href="/anti-ddos/instances">选择要续费的实例</a>
</div>
<div class="step">
<strong>支付</strong>
</div>
</div>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<input type="hidden" name="userInstanceId" :value="userInstance.id"/>
<input type="hidden" name="periodId" :value="selectedPeriodId"/>
<table class="ui table definition selectable">
<tr>
<td>高防产品</td>
<td>
<div v-if="userInstance.package.id > 0">{{userInstance.package.summary}}</div>
<span v-else class="red">已删除</span>
</td>
</tr>
<tr>
<td>高防IP</td>
<td>
<div v-if="userInstance.instance.id > 0">
<div v-for="ip in userInstance.instance.ipAddresses">{{ip}}</div>
</div>
<span v-else class="red">已删除</span>
</td>
</tr>
<tr>
<td>当前有效期</td>
<td>{{userInstance.dayTo}}
<p class="comment" v-if="userInstance.isExpired">
<span class="red">已过期,续费后新的有效期将会从今天({{userInstance.today}})开始。</span>
</p>
<p class="comment" v-else>续费后,将会在此基础上增加新的有效期。</p>
</td>
</tr>
<tr>
<td>新续有效期 *</td>
<td>
<div v-if="allPeriods.length > 0">
<a v-for="period in allPeriods" class="ui label basic" :class="{blue: period.id == selectedPeriodId}" @click.prevent="selectPeriod(period.id)">{{period.count}}{{period.unitName}}</a>
</div>
<span v-else class="red">没有可用的有效期</span>
</td>
</tr>
<tr>
<td>价格</td>
<td>
<span v-if="amount == 0" class="disabled">没有找到对应价格</span>
<span v-if="amount > 0">{{amount}}元</span>
<p class="comment">管理员操作时,此价格仅供展示,并不会从用户账户中扣款。</p>
</td>
</tr>
</table>
<button class="ui button primary" type="button" @click.prevent="goNext()" v-if="amount > 0">下一步</button>
</form>

View File

@@ -0,0 +1,29 @@
Tea.context(function () {
this.selectedPeriodId = 0
this.amount = -1
this.$delay(function () {
if (this.userInstance.periodId > 0) {
let that = this
if (this.allPeriods.$find(function (k, v) {
return that.userInstance.periodId == v.id
}) != null) {
this.selectPeriod(this.userInstance.periodId)
}
}
})
this.selectPeriod = function (periodId) {
this.selectedPeriodId = periodId
this.amount = this.prices.$find(function (k, v) {
return v.periodId == periodId
}).price
}
this.goNext = function () {
if (this.userInstance.id > 0 && this.selectedPeriodId > 0) {
window.location = "/anti-ddos/instances/renewConfirm?userInstanceId=" + this.userInstance.id + "&periodId=" + this.selectedPeriodId
}
}
})

View File

@@ -0,0 +1,37 @@
{$layout}
<!-- 步骤 -->
<div class="ui steps fluid">
<div class="step">
<a href="/anti-ddos/instances">选择要续费的实例</a>
</div>
<div class="step active">
<strong>支付</strong>
</div>
</div>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<input type="hidden" name="userInstanceId" :value="userInstanceId"/>
<input type="hidden" name="periodId" :value="periodId"/>
<table class="ui table definition selectable">
<tr>
<td class="title">高防实例</td>
<td>[{{packageSummary}} / <span v-for="(ipAddr, index) in ipAddresses">{{ipAddr}}<span v-if="index != ipAddresses.length -1">,</span></span> / 当前有效期至{{dayTo}} / 新增{{periodName}}]</td>
</tr>
<tr>
<td>价格</td>
<td>¥{{amount}}元</td>
</tr>
<tr>
<td>支付方式</td>
<td>
<pay-method-selector></pay-method-selector>
</td>
</tr>
</table>
<submit-btn v-show="amount > 0">确定购买</submit-btn><span class="red" v-if="amount == 0">参数错误,请返回重新选择。</span> &nbsp; <a href="/anti-ddos/packages">上一步</a>
</form>

View File

@@ -0,0 +1,23 @@
Tea.context(function () {
this.goBack = function () {
window.history.back()
}
this.success = function (resp) {
if (resp.data.success) {
teaweb.success("实例续费成功", function () {
window.location = "/anti-ddos/instances"
})
return
}
if (resp.data.orderCode.length > 0) {
window.location = "/finance/pay?code=" + resp.data.orderCode + "&from=" + window.escape(window.location.toString()) + "&returnURL=/anti-ddos/instances"
}
}
this.methodCode = "@balance"
this.changePayMethod = function (methodCode) {
this.methodCode = methodCode
}
})

View File

@@ -0,0 +1,38 @@
{$layout "layout_popup"}
<h3>设置防护对象</h3>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<input type="hidden" name="userInstanceId" :value="userInstance.id"/>
<table class="ui table selectable definition">
<tr>
<td class="title">高防产品</td>
<td>
<div v-if="userInstance.package.id > 0">{{userInstance.package.summary}}</div>
<span v-else class="red">已删除</span>
</td>
</tr>
<tr>
<td>高防IP</td>
<td>
<div v-if="userInstance.instance.id > 0">
<div v-for="ip in userInstance.instance.ipAddresses">{{ip}}</div>
</div>
<span v-else class="red">已删除</span>
</td>
</tr>
<tr>
<td>防护对象</td>
<td>
<div v-if="userInstance.isAvailable && userInstance.user.id > 0">
<ad-instance-objects-box :v-objects="userInstance.objects" :v-user-id="userInstance.user.id"></ad-instance-objects-box>
</div>
<span v-else class="red">实例已经失效,无法设置防护对象</span>
</td>
</tr>
</table>
<submit-btn v-show="userInstance.isAvailable && userInstance.user.id > 0"></submit-btn>
</form>