1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <extend name="Public:base" />
- <block name="content">
- <div class="page-header">
- <a href="{:U('Nodes/add')}" class="btn btn-primary">新增节点</a>
- </div>
- <div class="row">
- <div class="col-xs-12">
- <div id="append_parent"></div>
- <div class="table-responsive">
- <table class="table table-striped table-bordered table-hover">
- <thead>
- <tr>
- <td>节点结构</td>
- <td>节点名称</td>
- <td>节点类型</td>
- <td>状态</td>
- <td>操作</td>
- </tr>
- </thead>
- <tbody>
- <volist name="nodes" id="node">
- <tr align="center">
- <td align="left">{$node['fullname']}</td>
- <td>{$node['name']}</td>
- <td>{$node['type']}</td>
- <td><if condition="$node['status'] eq 1">已启用<else/>已禁用</if></td>
- <td>[ <a href="javascript:void(0);" value="{:U('Nodes/toggleStatus', array('id' => $node['id'], 'status' => $node['status']))}" name="{$node['title']}" status="{$node['status']}" class="toggle"><if condition="$node['status'] eq 1">禁用<else/>启用</if></a> ]</td>
- </tr>
- </volist>
- </tbody>
-
- </table>
- </div>
- </div>
- </div>
- </block>
- <block name="javascript">
- <script src="__JS__/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>
- <link rel="stylesheet" href="__JS__/dialog/dialog.css" />
- <script>
- $(function(){
- $(".toggle").click(function(){
- var url = $(this).attr("value");
- var name = $(this).attr("name");
- var status = $(this).attr("status") || 0;
-
- status = status ? '禁用' : '启用';
- var obj = $(this);
- showDialog('您确定'+ status + " <b>" + name + "</b> 节点吗?", 'confirm','温馨提示', function(){
-
- $.getJSON(url, function(json){
- if(json.state == 1)
- {
- showSucc(json.msg);
- } else {
- //showSucc(json.msg)
- showError(json.msg);
- }
- });
-
- })
-
- return false;
- });
- });
- </script>
- <style type="text/css">
- a.dialog-bottom-btn{
- height:auto;
- }
- </style>
- </block>
|