mirror of
https://github.com/netcccyun/dnsmgr.git
synced 2026-06-29 04:45:48 +08:00
1b1605400d
feat(cloudflare): 添加 Cloudflare Tunnels 和增强功能支持 - 在 .gitignore 中添加 .ace-tool/ 忽略规则 - 更新 Cloudflare 配置项,添加详细的使用说明和 API 令牌认证支持 - 新增 Account ID 配置字段用于 Cloudflare Tunnels 功能 - 在账户管理页面添加 Tunnels 功能入口按钮 - 实现智能账户名称自动生成逻辑,优先使用关键认证字段 - 添加 Cloudflare 增强功能菜单项,仅对管理员可见 - 定义完整的 Cloudflare 相关路由,包括 hostnames、tunnels 等功能模块 ```
103 lines
3.0 KiB
HTML
103 lines
3.0 KiB
HTML
{extend name="common/layout" /}
|
|
{block name="title"}域名账户{/block}
|
|
{block name="main"}
|
|
<div class="row">
|
|
<div class="col-xs-12 center-block" style="float: none;">
|
|
<div class="panel panel-default panel-intro">
|
|
<div class="panel-body">
|
|
|
|
<form onsubmit="return searchSubmit()" method="GET" class="form-inline" id="searchToolbar">
|
|
<div class="form-group">
|
|
<label>搜索</label>
|
|
<input type="text" class="form-control" name="kw" placeholder="账户名称或备注">
|
|
</div>
|
|
<button type="submit" class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button>
|
|
<a href="javascript:searchClear()" class="btn btn-default" title="刷新域名账户列表"><i class="fa fa-refresh"></i> 刷新</a>
|
|
<a href="/account/add" class="btn btn-success"><i class="fa fa-plus"></i> 添加</a>
|
|
</form>
|
|
|
|
<table id="listTable">
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/block}
|
|
{block name="script"}
|
|
<script src="/static/js/layer/layer.js"></script>
|
|
<script src="/static/js/bootstrap-table-1.21.4.min.js"></script>
|
|
<script src="/static/js/bootstrap-table-page-jump-to-1.21.4.min.js"></script>
|
|
<script src="/static/js/custom.js"></script>
|
|
<script>
|
|
$(document).ready(function(){
|
|
updateToolbar();
|
|
const defaultPageSize = 15;
|
|
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
|
|
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
|
|
|
|
$("#listTable").bootstrapTable({
|
|
url: '/account/data',
|
|
pageNumber: pageNumber,
|
|
pageSize: pageSize,
|
|
classes: 'table table-striped table-hover table-bordered',
|
|
columns: [
|
|
{
|
|
field: 'id',
|
|
title: 'ID'
|
|
},
|
|
{
|
|
field: 'typename',
|
|
title: '所属平台',
|
|
formatter: function(value, row, index) {
|
|
return '<img src="/static/images/'+row.icon+'" class="type-logo"></img>'+value;
|
|
}
|
|
},
|
|
{
|
|
field: 'name',
|
|
title: '账户名称'
|
|
},
|
|
{
|
|
field: 'remark',
|
|
title: '备注'
|
|
},
|
|
{
|
|
field: 'addtime',
|
|
title: '添加时间'
|
|
},
|
|
{
|
|
field: 'action',
|
|
title: '操作',
|
|
formatter: function(value, row, index) {
|
|
var html = '<a href="/account/edit?id='+row.id+'" class="btn btn-info btn-xs">编辑</a> <a href="javascript:delItem('+row.id+')" class="btn btn-danger btn-xs">删除</a> <a href="/domain?aid='+row.id+'" class="btn btn-default btn-xs">域名</a>';
|
|
if(row.type === 'cloudflare'){
|
|
html += ' <a href="/cloudflare/tunnels/'+row.id+'" class="btn btn-primary btn-xs">Tunnels</a>';
|
|
}
|
|
return html;
|
|
}
|
|
},
|
|
],
|
|
})
|
|
})
|
|
function delItem(id) {
|
|
layer.confirm('确定要删除此域名账户吗?', {title: '提示', icon: 0}, function(){
|
|
var ii = layer.load(2);
|
|
$.ajax({
|
|
type : 'POST',
|
|
url : '/account/del',
|
|
data : {id: id},
|
|
dataType : 'json',
|
|
success : function(data) {
|
|
layer.close(ii);
|
|
if(data.code == 0){
|
|
layer.closeAll();
|
|
searchRefresh();
|
|
}else{
|
|
layer.alert(data.msg, {icon: 2});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
</script>
|
|
{/block}
|