bug fix with layout

community
Steve L. Nyemba 6 years ago
parent f07611d141
commit e9c7b3e9e3

@ -219,6 +219,7 @@ def get_board():
args['app_summary'] = session['apps.summary'] args['app_summary'] = session['apps.summary']
args['app_grid'] = session['apps.grid'] args['app_grid'] = session['apps.grid']
args['folders_summary'] = session['folders.summary'] args['folders_summary'] = session['folders.summary']
# args['resource'] = session['resource']
args['folder_size'] = session['folders.max_size'] args['folder_size'] = session['folders.max_size']

@ -4,7 +4,7 @@
--> -->
<link href="{{context}}/static/css/default.css" type="text/css" rel="stylesheet"> <link href="{{context}}/static/css/default.css" type="text/css" rel="stylesheet">
<link href="{{context}}/static/css/fa/css/font-awesome.css" type="text/css" rel="stylesheet"> <link href="{{context}}/static/css/fa/css/font-awesome.css" type="text/css" rel="stylesheet">
<link href="{{context}}/static/css/fa/animation.css" rel="stylesheet" type="text/css"> <link href="{{context}}/static/css/fa/font-awesome-animation.css" rel="stylesheet" type="text/css">
<script src="{{context}}/static/js/jquery/jquery.min.js"></script> <script src="{{context}}/static/js/jquery/jquery.min.js"></script>
<script src="{{context}}/static/js/jx/dom.js"></script> <script src="{{context}}/static/js/jx/dom.js"></script>
<link href="{{context}}/static/js/jsgrid/jsgrid.css" rel="stylesheet" type="text/css"> <link href="{{context}}/static/js/jsgrid/jsgrid.css" rel="stylesheet" type="text/css">
@ -20,7 +20,8 @@
display:grid ; display:grid ;
grid-template-rows: 32px auto; grid-template-rows: 32px auto;
grid-gap:4px; grid-gap:4px;
height:99%; height:99%;
} }
@ -34,7 +35,7 @@
.widget { .widget {
width:100%; width:100%;
height:90%; height:90%;
} }
.widget .title { .widget .title {
@ -102,6 +103,13 @@
.fa-times {color:maroon} .fa-times {color:maroon}
.fa-folder-open {color:#FF7F24;} .fa-folder-open {color:#FF7F24;}
.fa-cog {color:#d3d3d3} .fa-cog {color:#d3d3d3}
.busy {
display:flex ;
align-items: center;
justify-content: center;
height:100%;
}
</style> </style>
<script> <script>
@ -139,7 +147,18 @@
jx.utils.patterns.visitor(xi,jx.dom.hide) jx.utils.patterns.visitor(xi,jx.dom.hide)
jx.utils.patterns.visitor(xo,jx.dom.show) jx.utils.patterns.visitor(xo,jx.dom.show)
} }
$(document).ready(function(){
})
</script> </script>
<div class="busy">
<div align="center">
<i class="fa fa-cog fa-5x fa-spin" style="color:darkgray"></i>
<i class="fa fa-cog fa-3x faa-wrench animated"></i>
<i class="fa fa-cog fa-spin fa-4x" style="color:darkgray"></i>
<div class="small bold" style="margin-top:10px; color:#4682B4">Loading dashboard ...</div>
</div>
</div>
<div class="board"> <div class="board">
<div class="search"> <div class="search">
<input type="text" placeholder="[Node/Data Collector]"> <input type="text" placeholder="[Node/Data Collector]">
@ -172,7 +191,7 @@
<div align="center" class="bold"> <div align="center" class="bold">
Status Counts Status Counts
</div> </div>
<p></p> <br>
<div class="stat-board"> <div class="stat-board">
<div class="number border"> <div class="number border">
<div class="value">{{ app_summary[loop.index-1].crash}}</div> <div class="value">{{ app_summary[loop.index-1].crash}}</div>
@ -189,7 +208,30 @@
<div align="center"> <div align="center">
<h3>Resource Usage</h3> <h3>Resource Usage</h3>
</div> </div>
<iframe class="no-border" src="{{context}}/1/plot/html/bar/apps.resource?index={{loop.index -1}}" scrolling="no"></iframe> <iframe class="no-border" src="{{context}}/1/plot/html/bar/apps.resource?index={{loop.index -1}}" scrolling="no"></iframe>
<div align="center" class="bold">
Total Resource Usage
</div>
<br>
<div class="stat-board">
<div class="number border">
<div class="value">
{{session['apps.resource'][loop.index -1].x[0][1] + session['apps.resource'][loop.index -1].x[0][0] }}
<span class="small">%</span>
</div>
<div class="unit">CPU</div>
</div>
<div class="number border">
<div class="value">
{{session['apps.resource'][loop.index -1].x[1][0] + session['apps.resource'][loop.index -1].x[1][1]}}
<span class="small">%</span>
</div>
<div class="unit">RAM</div>
</div>
</div>
</div> </div>
<div class="border-left"> <div class="border-left">
<div align="center"> <div align="center">
@ -208,17 +250,34 @@
<div class="value">{{ row.files}}</div> <div class="value">{{ row.files}}</div>
<div class="unit small">Files</div> <div class="unit small">Files</div>
</div> </div>
<div class="number border">
<div class="value">{{ row.size}}</div> {% if row.size > 1000 %}
<div class="unit small">MB Used</div> <div class="number border">
</div> <div class="value">{{ (row.size / 1000) | round(2) }}</div>
<div class="number border"> <div class="unit small">GB Used</div>
<div class="value">{{ row.max_size}}</div> </div>
<div class="small unit">MB Threshold</div> <div class="number border">
</div> <div class="value">{{ (row.max_size / 1000) | round(2) }}</div>
<div class="small unit">GB Threshold</div>
</div>
{% else %}
<div class="number border">
<div class="value">{{ row.size }}</div>
<div class="unit small">MB Used</div>
</div>
<div class="number border">
<div class="value">{{ row.max_size}}</div>
<div class="small unit">MB Threshold</div>
</div>
{% endif %}
</div> </div>
{% endif %} {% endif %}
{% if loop.index == nodes|length %}
<script>$('.busy').slideUp()</script>
{% endif %}
{% endfor %} {% endfor %}
<div> <div>
@ -230,10 +289,16 @@
<div id="{{name}}_data"class="grid no-border" style="display:none;"> <div id="{{name}}_data"class="grid no-border" style="display:none;">
<div id="app_grid_{{name}}" style="margin-top:10px;"></div> <div id="app_grid_{{name}}" style="margin-top:10px;"></div>
<script> <script>
render_grid('{{name}}') render_grid('{{name}}')
</script> </script>
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>

@ -137,7 +137,7 @@ class HTMLGraph(Graph):
config["data"]["labels"] = labels config["data"]["labels"] = labels
if isinstance(X[0],list) == False : if isinstance(X[0],list) == False :
X = [X[0]] X = [X[0]]
print series
for row in X : for row in X :
index = X.index(row) index = X.index(row)

@ -134,7 +134,8 @@ class apps(analytics) :
N = df.shape[0] - 1 N = df.shape[0] - 1
other_df = pd.DataFrame(df[df.name.str.contains('other',na=False)]) other_df = pd.DataFrame(df[df.name.str.contains('other',na=False)])
watch_df = pd.DataFrame(df[df.name.str.contains('other',na=False)==False]) watch_df = pd.DataFrame(df[df.name.str.contains('other',na=False)==False])
X = [[other_df.cpu.sum(),other_df.mem.sum()],[watch_df.cpu.sum(),watch_df.mem.sum()]] X = [[other_df.cpu.sum(),watch_df.cpu.sum()],[other_df.mem.sum(),watch_df.mem.sum()]]
date= data[node]['date']['long'] date= data[node]['date']['long']
q.append({"node":node, "x":X,"labels":labels, "title":title,"series":series,"ylabel":ylabel}) q.append({"node":node, "x":X,"labels":labels, "title":title,"series":series,"ylabel":ylabel})
crash = watch_df.status.str.contains('X').sum() crash = watch_df.status.str.contains('X').sum()
@ -188,8 +189,7 @@ class folders(analytics):
self.set('max_size',max_size) self.set('max_size',max_size)
for node in data : for node in data :
df = pd.DataFrame(data[node]['logs']) df = pd.DataFrame(data[node]['logs'])
N = df.shape[0] N = df.shape[0]
print ' --- ',df.size_in_kb.values
df = pd.DataFrame(df.mean()[['size_in_kb','files','age_in_days']]).T df = pd.DataFrame(df.mean()[['size_in_kb','files','age_in_days']]).T
r.append({"node":node,"folders":N, "max_size":max_size,"size":np.round(df.size_in_kb.values[0]*.000001,2),"age":df.age_in_days.values[0].round(2),"files":df.files.values[0].round(2)}) r.append({"node":node,"folders":N, "max_size":max_size,"size":np.round(df.size_in_kb.values[0]*.000001,2),"age":df.age_in_days.values[0].round(2),"files":df.files.values[0].round(2)})

Loading…
Cancel
Save