ip-list.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {template 'common/header'}
  2. <!--ip白名单-->
  3. <div class="iplist" ng-controller="ipWhiteListCtrl" ng-cloak>
  4. <div class="search-box we7-margin-bottom">
  5. <form action="{php url('system/ipwhitelist')}" method="post" class="search-form">
  6. <div class="input-group" style="width: 400px;">
  7. <input type="text" placeholder="输入要搜索的ip地址" class="form-control" name="keyword" value="{$keyword}"/>
  8. <span class="input-group-btn">
  9. <button class="btn btn-default">
  10. <i class="wi wi-search"></i>
  11. </button>
  12. </span>
  13. </div>
  14. </form>
  15. <a href="#" class="btn btn-primary we7-padding-horizontal" data-toggle="modal" data-target="#myModalIp">添加白名单</a>
  16. </div>
  17. <table class="table we7-table table-hover vertical-middle" ng-cloak>
  18. <col />
  19. <col />
  20. <col />
  21. <tr>
  22. <th>IP地址</th>
  23. <th>是否生效</th>
  24. <th class="text-right">操作</th>
  25. </tr>
  26. <tr ng-repeat="list in lists">
  27. <td>
  28. {{list.ip}}
  29. <!--<span class="color-gray we7-margin-left">中国 山西 太原 联通</span>-->
  30. </td>
  31. <td>
  32. <div class="we7-form">
  33. <input class='we7-toggle' type="checkbox" name='check-3' checked='checked' ng-if="list.status==1" ng-click="changeStatus(list.ip)"/>
  34. <input class='we7-toggle' type="checkbox" name='check-3' ng-if="list.status==0" ng-click="changeStatus(list.ip)"/>
  35. </div>
  36. </td>
  37. <td>
  38. <div class="link-group">
  39. <a href="{{links.delete_link_ip}}ip={{list.ip}}" class="del">删除</a>
  40. </div>
  41. </td>
  42. </tr>
  43. <tr ng-if="lists | we7IsEmpty">
  44. <td colspan="100">
  45. <div class="we7-empty-block">暂无IP白名单</div>
  46. </td>
  47. </tr>
  48. </table>
  49. <div class="modal fade" id="myModalIp" tabindex="-1" role="dialog" aria-labelledby="myModalLabel6">
  50. <div class="modal-dialog">
  51. <div class="modal-content">
  52. <div class="modal-header">
  53. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  54. <h4 class="modal-title" id="myModalLabel6">添加白名单</h4>
  55. </div>
  56. <div class="modal-body we7-padding">
  57. <div class="we7-margin-bottom-sm">请输入有效IP地址 <span class="color-gray">(如: 183.184.176.181)</span></div>
  58. <div class="panel panel-default">
  59. <div class="panel-body">
  60. <textarea ng-model="ips" name="ips" id="addips" rows="5" class="form-control" style="border: none; outline:none; box-shadow: none; resize:none; "></textarea>
  61. </div>
  62. <div class="panel-footer text-right color-gray">
  63. 按"回车"添加多个
  64. </div>
  65. </div>
  66. </div>
  67. <div class="modal-footer">
  68. <button type="button" class="btn btn-primary" ng-click="saveIp()">确定</button>
  69. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. <!--end ip白名单-->
  76. <script type="text/javascript">
  77. angular.module('systemApp').value('config', {
  78. 'lists': {php echo !empty($lists) ? json_encode($lists) : 'null'},
  79. 'links' : {
  80. 'add_link_ips': "{php echo url('system/ipwhitelist/add')}",
  81. 'change_status': "{php echo url('system/ipwhitelist/change_status')}",
  82. 'delete_link_ip': "{php echo url('system/ipwhitelist/delete')}",
  83. },
  84. });
  85. angular.bootstrap($('.iplist'), ['systemApp']);
  86. </script>
  87. {template 'common/footer'}