浏览代码

admin update

xiaoyu 3 年之前
父节点
当前提交
4f8b8a6a22
共有 4 个文件被更改,包括 158 次插入0 次删除
  1. 38 0
      admin/control/arw_monitor.php
  2. 2 0
      admin/include/limit.php
  3. 1 0
      admin/include/menu.php
  4. 117 0
      admin/templates/default/arw.monitor.php

+ 38 - 0
admin/control/arw_monitor.php

@@ -0,0 +1,38 @@
+<?php
+
+class arw_monitorControl extends SystemControl
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function indexOp()
+    {
+        $ins = Cache::getInstance('cacheredis');
+        $name = 'disk_monitor';
+        $hash_data = $ins->hget($name, '');
+        $result = [];
+        foreach ($hash_data as $ip => $str)
+        {
+            $str = str_replace('\t', "", $str);
+            $str = ltrim($str,'#');
+            $arrs = explode('#', $str);
+            foreach ($arrs as $arr) {
+                $data = explode(':', $arr);
+                $key = ltrim($data[0],'_');
+                $value = $data[1];
+                if($key == 'cur_time') {
+                    $cur_time = explode('-',$value);
+                    $value = "$cur_time[0]-$cur_time[1]-$cur_time[2] $cur_time[3]:$cur_time[4]:$cur_time[5]";
+                }else{
+                    $key = str_replace('_', "/", $key);
+                }
+                $item[$key] = $value;
+            }
+            $result[$ip] = $item;
+        }
+        Tpl::output('data', $result);
+        Tpl::showpage('arw.monitor');
+    }
+}

+ 2 - 0
admin/include/limit.php

@@ -52,6 +52,8 @@ $_limit =  array(
         array('name'=> '通道价格明细', 'op'=>null, 'act'=>'provider_price'),
         array('name'=> '任务列表', 'op'=>null, 'act'=>'task'),
         array('name'=> '异常订单列表', 'op'=>null, 'act'=>'refill_error'),
+        array('name'=> '服务器磁盘监控', 'op'=>null, 'act'=>'arw_monitor'),
+
     )),
 	array('name'=>$lang['nc_store'], 'child'=>array(
 		array('name'=>$lang['nc_store_manage'], 'op'=>null, 'act'=>'store'),

+ 1 - 0
admin/include/menu.php

@@ -116,6 +116,7 @@ $arr = array(
 					array('args'=>'index,provider_price&card_type=2,merchant',			'text'=>'通道价格明细'),
 					array('args'=>'index,task,merchant',					'text'=>'任务列表'),
 					array('args'=>'index,refill_error,merchant',			'text'=>'异常订单列表'),
+					array('args'=>'index,arw_monitor,merchant',			'text'=>'服务器磁盘监控'),
 				)
 			),
 			4 => array(

+ 117 - 0
admin/templates/default/arw.monitor.php

@@ -0,0 +1,117 @@
+<style>
+    th label { display: inline-block;width: 60px; }
+    .lineLi {
+        min-width: 150px;
+        font-size: 12px;
+        color:#000;
+    }
+    #prompt ul .noLineLi {
+        background:none;
+    }
+    #prompt div {
+        display:inline-block;
+        background:none
+    }
+    #prompt ul .lineLi {
+        color:#000;
+    }
+    th {
+        width: 10px;
+    }
+    .txt2 {
+        position: relative;
+    }
+    .btn-search {
+        position: absolute;
+        left: 332px;
+        margin-top: 3px;
+    }
+
+</style>
+
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>服务器磁盘监控</h3>
+            <ul class="tab-base">
+                <li><a href="JavaScript:void(0);" class="current"><span>监控列表</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+        <table class="tb-type1 noborder search" style="min-width:1400px">
+            <tbody>
+            <tr>
+                <td class="tip_info">
+                    _dev_开头:总量,可用 <br/>
+                    _mnt_开头:总占用 <br/>
+                    cur_time:信息更新日期
+                </td>
+            </tr>
+            </tbody>
+        </table>
+    <table class="table tb-type2 nobdb" style="min-width:1400px">
+        <thead>
+        <tr class="thead">
+            <th class="align-center">服务器ip</th>
+            <th class="align-left">详细信息</th>
+        </thead>
+        <tbody id="tbody">
+        <?php if (count($output['data']) > 0) { ?>
+            <?php
+            foreach ($output['data'] as $key => $value) { ?>
+                <tr class="hover trFlex">
+                    <td class="align-center"><?php echo $key; ?></td>
+                    <td class="align-left">
+                    <?php foreach ($value as $k => $v){ ?>
+                        <span style="color: red">
+                                <?php echo $k;?>
+                        </span>
+                        <span style="color: green">
+                                <?php echo $v;?>
+                        </span>
+                        <br/>
+                    <?php }?>
+                    </td>
+                </tr>
+            <?php } ?>
+        <?php } else { ?>
+            <tr class="no_data">
+                <td colspan="8"><?php echo $lang['nc_no_record']; ?></td>
+            </tr>
+        <?php } ?>
+        </tbody>
+        <tfoot>
+        <tr class="tfoot">
+            <td colspan="8" id="dataFuncs">
+                <div class="pagination"> <?php echo $output['show_page']; ?> </div>
+            </td>
+        </tr>
+        </tfoot>
+    </table>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
+        charset="utf-8"></script>
+<link rel="stylesheet" type="text/css"
+      href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/js/xm-select.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
+<script type="text/javascript">
+    $(function () {
+        $('#ncsubmit').click(function () {
+
+            $('#formSearch').submit();
+        });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+    })
+</script>