-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
231 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,211 @@ | ||
<import template="/admin/_header" /> | ||
<import template="/admin/_content" /> | ||
|
||
<div class="page-title"> | ||
<div class="title-env"> | ||
<h1 class="title" onclick="messageAdd();">消息管理 | ||
<a class="btn btn-success btn-sm" href="javascript:;" onclick="">添加</a></h1> | ||
<p class="description">请注意消息的分类!</p> | ||
</div> | ||
<div class="breadcrumb-env"> | ||
<ol class="breadcrumb bc-1"><li><a href="/admin"><i class="fa-home"></i>管理端</a></li><li><a href="/admin/message">消息管理</a></li></ol> | ||
</div> | ||
</div> | ||
<section class="content"> | ||
<div class="row"> | ||
<div class="col-xs-12"> | ||
<div class="box"> | ||
<div class="box-body table-responsive no-padding"> | ||
<table class="table table-hover"> | ||
<tbody> | ||
<tr> | ||
<th>ID</th> | ||
<th>内容</th> | ||
<th>结束推送时间</th> | ||
<th>推送至</th> | ||
<th>类型</th> | ||
<th>操作</th> | ||
</tr> | ||
<if condition="count($lists) > 0"> | ||
<loop variable="$lists" key="$key" value="$msg"> | ||
<tr id="msg-{$msg->id}"> | ||
<td>#{$msg->id}</td> | ||
<td> {(mb_substr(htmlspecialchars($msg->content),0,20,'utf-8'))}</td> | ||
<td> {(date("Y-m-d H:i:s", $msg->pushEndTime))}</td> | ||
<td><if condition="$msg->pushUsers == -1">系统消息<elseif condition="$msg->pushUsers == -2">系统固定消息<else>推送值特定用户</if></td> | ||
<td><if condition="$msg->type == -1">重复推送<elseif condition="$msg->type == -2">系统公告<elseif condition="$msg->type == -3">套餐处说明<elseif condition="$msg->type == -4">首页浮动提示<else>普通消息</if></td> | ||
<td> | ||
<a class="btn btn-info btn-sm" href="javascript:;" onclick="messageModify({$msg->id});">编辑</a> | ||
<if condition="$msg->pushUsers != -2"> | ||
<a class="btn btn-danger btn-sm" href="javascript:;" onclick="messageRemove({$msg->id});">删除</a> | ||
</if> | ||
</td> | ||
</tr> | ||
</loop> | ||
<else> | ||
<tr> | ||
<td>#</td> | ||
<td colspan="5">没有节点</td> | ||
</tr> | ||
</if> | ||
</tbody> | ||
</table> | ||
</div><!-- /.box-body --> | ||
</div><!-- /.box --> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
</div> | ||
<!-- Modal 6 (Long Modal)--> | ||
<div class="modal fade" id="modal-6"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
|
||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
<h4 class="modal-title">新增节点</h4> | ||
</div> | ||
<form role="form" id="form1" method="post" action="/admin/node/add" class="validate" onsubmit="return postJSON(this.id, this.action);"> | ||
<input type="hidden" name="form_add" value="{(time())}"/> | ||
<input type="hidden" name="node.id" id="node_id" value=""/> | ||
<div class="modal-body"> | ||
|
||
<div class="row"> | ||
<div class="col-md-6"> | ||
|
||
<div class="form-group"> | ||
<label for="field-1" class="control-label">节点名称</label> | ||
|
||
<input type="text" class="form-control" name="node.name" id="field-1" value="" data-validate="required" data-message-required="节点名称必须填写."> | ||
</div> | ||
|
||
</div> | ||
|
||
<div class="col-md-6"> | ||
|
||
<div class="form-group"> | ||
<label for="field-2" class="control-label">节点地址</label> | ||
|
||
<input type="text" class="form-control" name="node.server" id="field-2" placeholder="127.0.0.1" data-validate="required" data-message-required="服务器地址必须填写."> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-md-6"> | ||
|
||
<div class="form-group"> | ||
<label for="field-3" class="control-label">加密方式</label> | ||
|
||
<input type="text" class="form-control" name="node.method" id="field-3" placeholder="aes-128-cfb" data-validate="required" data-message-required="加密方式必须填写."> | ||
</div> | ||
|
||
</div> | ||
|
||
<div class="col-md-6"> | ||
|
||
<div class="form-group"> | ||
<label for="field-4" class="control-label">节点分类(0 普通 1 vip)</label> | ||
|
||
<input type="text" class="form-control" name="node.type" id="field-4" value="0" placeholder="0" data-validate="required" data-message-required="This is custom message for required field."> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-md-6"> | ||
<div class="form-group"> | ||
<label for="field-5" class="control-label">节点状态</label> | ||
<input type="text" class="form-control" name="node.status" id="field-5" placeholder="可用 / 不可用" data-validate="required" data-message-required="This is custom message for required field."> | ||
</div> | ||
</div> | ||
|
||
<div class="col-md-6"> | ||
<div class="form-group"> | ||
<label for="field-6" class="control-label">排序</label> | ||
<input type="text" class="form-control" name="node.order" id="field-6" value="0" placeholder="0" data-validate="required" data-message-required="This is custom message for required field."> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="form-group no-margin"> | ||
<label for="field-7" class="control-label">备注信息</label> | ||
<textarea class="form-control autogrow" name="node.info" id="field-7" placeholder="Write something about server info" ></textarea> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button> | ||
<button type="submit" class="btn btn-success">立即保存</button> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
<script type="text/javascript"> | ||
function nodeRemove(nodeId){ | ||
$.ajax({ | ||
url: "/admin/node/delete", | ||
method: "POST", | ||
dataType: "json", | ||
data: {node_id: nodeId}, | ||
success: function(data){ | ||
if(data.error == 0){ | ||
showToastr(data.message, 0); | ||
$("#node-" + nodeId).remove(); | ||
} else { | ||
showToastr(data.message, 0); | ||
} | ||
}, | ||
error: function(Xhr){ | ||
showToastr("出现未知错误,请重试或联系管理员", 0); | ||
} | ||
}); | ||
} | ||
function nodeModify(nodeId){ | ||
$.ajax({ | ||
url: "/admin/node/nodeInfo", | ||
method: "GET", | ||
dataType: "json", | ||
data: {node_id: nodeId}, | ||
success: function(result){ | ||
if(result.error == 0){ | ||
if(result.data != false && result.data != null) { | ||
var node = result.data; | ||
$("input[name='node.id']").val(node.id); | ||
$("input[name='node.name']").val(node.name); | ||
$("input[name='node.type']").val(node.type); | ||
$("input[name='node.server']").val(node.server); | ||
$("input[name='node.method']").val(node.method); | ||
$("textarea[name='node.info']").val(node.info); | ||
$("input[name='node.status']").val(node.status); | ||
$("input[name='node.order']").val(node.order); | ||
$("#form1").attr("action", "/admin/node/modify"); | ||
jQuery('#modal-6 .modal-title').html('修改节点'); | ||
jQuery('#modal-6').modal('show', {backdrop: 'static'}); | ||
} | ||
} else { | ||
showToastr(result.message, 0); | ||
} | ||
}, | ||
error: function(Xhr){ | ||
showToastr("出现未知错误,请重试或联系管理员", 0); | ||
} | ||
}); | ||
jQuery('#modal-6').modal('show', {backdrop: 'static'}); | ||
} | ||
function nodeAdd(){ | ||
$("#form1").attr("action", "/admin/node/add"); | ||
jQuery('#modal-6 .modal-title').html('新增节点'); | ||
jQuery('#modal-6').modal('show', {backdrop: 'static'}); | ||
} | ||
</script> | ||
<import template="/admin/_footer" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters