Przeglądaj źródła

host失联后,host列表页面,失联后的host项置为灰色显示

James Iter 8 lat temu
rodzic
commit
02f4ac5c94
3 zmienionych plików z 12 dodań i 3 usunięć
  1. 1 1
      docs/todo.md
  2. 2 2
      templates/hosts_show.html
  3. 9 0
      templates/layout.html

+ 1 - 1
docs/todo.md

@@ -38,7 +38,7 @@
 - [x] 重新设计 JimV-N 到 JimV-C 的回调机制,现有实现比较混乱。改进为基于对象的回调
 - [x] 重新设计创建虚拟机机制,批量创建虚拟机时,依照宿主机负载大小,倒序依次挨个分配虚拟机的创建任务
 - [x] 规范日志路径。把日志路径调整至 /var/log/ 下
-- [x] 除15天前的监控日志
+- [x] 除15天前的监控日志
 - [ ] 初始化页面检测redis、mysql是否准备好
 - [ ] 允许删除创建失败的虚拟机
 - [ ] 日志里面加入操作轨迹

+ 2 - 2
templates/hosts_show.html

@@ -76,7 +76,7 @@
                 <div class="row">
                     {% for item in hosts_ret.data %}
                     <div class="col-md-4" onmouseover="panel_onmouseover(this);" onmouseout="panel_onmouseout(this);">
-                        <div class="host-box content-box">
+                        <div class="host-box content-box {% if not item.alive %}panel-gray{% endif %}">
                             <h2 class="bg-black host-title">{{ item.hostname }}
                                 <i style="float: right;" class="glyph-icon icon-circle font-size-23 {% if item.alive == true %}font-green{% else %}font-red{% endif %}"></i>
                             </h2>
@@ -91,7 +91,7 @@
                                 <span>{{(((item.memory - item.memory_available) / item.memory) * 100) | int}}%</span>
                                 <i>内存使用率</i>
                             </div>
-                            <ul>
+                            <ul {% if not item.alive %}class="bg-gray"{% endif %}>
                                 <li>CPU: {{ item.cpu }} 核</li>
                                 <li>内存: {{ (item.memory / 1024 / 1024 / 1024)|int }} GB</li>
                                 <!--<li><i class="glyph-icon icon-circle font-size-23 {% if item.alive == true %}font-green{% else %}font-red{% endif %}"></i></li>-->

+ 9 - 0
templates/layout.html

@@ -30,6 +30,15 @@
             padding-bottom: .5rem !important;
         }
 
+        .panel-gray {
+            -webkit-filter:grayscale(100%);
+            -moz-filter:grayscale(100%);
+            -ms-filter:grayscale(100%);
+            -o-filter:grayscale(100%);
+            filter:grayscale(100%);
+            filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
+        }
+
         @font-face {
             font-family: 'Baskerville';
             src: url('/static/fonts/Baskerville/Baskerville-Italic.eot');