1.4.5.2
This commit is contained in:
36
EdgeAdmin/web/views/@default/servers/user-scripts/index.html
Normal file
36
EdgeAdmin/web/views/@default/servers/user-scripts/index.html
Normal file
@@ -0,0 +1,36 @@
|
||||
{$layout}
|
||||
|
||||
<first-menu>
|
||||
<menu-item href="." code="auditing">审核中</menu-item>
|
||||
<menu-item href=".?type=audited" code="audited">已审核</menu-item>
|
||||
<span class="item"><tip-icon content="在这里可以审核用户填写的脚本,脚本审核通过之后方可在边缘节点运行。"></tip-icon></span>
|
||||
</first-menu>
|
||||
|
||||
<div v-if="scripts.length == 0">
|
||||
<not-found-box>暂时还没有用户脚本。</not-found-box>
|
||||
</div>
|
||||
|
||||
<table class="ui table celled selectable" v-if="scripts.length > 0" style="max-width: 40em">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="six wide">脚本创建时间</th>
|
||||
<th>用户</th>
|
||||
<th class="width5">状态</th>
|
||||
<th class="one op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="script in scripts">
|
||||
<td>{{script.createdTime}}</td>
|
||||
<td><user-link :v-user="script.user"></user-link></td>
|
||||
<td>
|
||||
<span v-if="script.isRejected" class="red">已驳回</span>
|
||||
<span v-else-if="script.isPassed" class="green">已通过</span>
|
||||
<span v-else>未审核</span>
|
||||
</td>
|
||||
<td>
|
||||
<a :href="'/servers/user-scripts/script?scriptId=' + script.id + '&type=' + type + '&prevURL=' + currentURL">详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<page-box></page-box>
|
||||
@@ -0,0 +1,50 @@
|
||||
{$layout}
|
||||
{$template "/code_editor"}
|
||||
|
||||
<first-menu>
|
||||
<menu-item class="active" :href="prevURL">{{(type == 'auditing') ? '审核中' : '已审核'}}</menu-item>
|
||||
<raquo-item></raquo-item>
|
||||
<span class="item">脚本详情</span>
|
||||
</first-menu>
|
||||
|
||||
<table class="ui selectable definition table">
|
||||
<tr>
|
||||
<td class="title">状态</td>
|
||||
<td>
|
||||
<span v-if="script.isRejected" class="red">已驳回
|
||||
<br/>
|
||||
<span class="grey small">驳回理由:{{script.rejectedReason}}</span>
|
||||
</span>
|
||||
<span v-else-if="script.isPassed" class="green">已通过</span>
|
||||
<span v-else>未审核</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>操作</td>
|
||||
<td>
|
||||
<div v-if="script.isRejected">
|
||||
<a href="" @click.prevent="pass(script.id)">[重新通过]</a>
|
||||
</div>
|
||||
<div v-else-if="script.isPassed">
|
||||
<a href="" @click.prevent="reject(script.id)">[重新驳回]</a>
|
||||
</div>
|
||||
<div v-else>
|
||||
<a href="" @click.prevent="pass(script.id)">[通过]</a> <a href="" @click.prevent="reject(script.id)">[驳回]</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">代码</td>
|
||||
<td>
|
||||
<source-code-box type="text/javascript">{{script.code}}</source-code-box>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>脚本创建时间</td>
|
||||
<td>{{script.createdTime}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>用户</td>
|
||||
<td><user-link :v-user="script.user"></user-link></td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,16 @@
|
||||
Tea.context(function () {
|
||||
this.pass = function (scriptId) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要通过此脚本吗?", function () {
|
||||
that.$post(".pass")
|
||||
.params({ scriptId: scriptId})
|
||||
.success(function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
this.reject = function (scriptId) {
|
||||
teaweb.popupSuccess(".rejectPopup?scriptId=" + scriptId)
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,17 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>驳回脚本</h3>
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="scriptId" :value="scriptId"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">驳回理由 *</td>
|
||||
<td>
|
||||
<textarea rows="3" ref="focus" maxlength="100" name="reason"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
Reference in New Issue
Block a user