-
Notifications
You must be signed in to change notification settings - Fork 61
/
index.html
92 lines (88 loc) · 2.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{% extends './base.html' %}
{% block title %}Redis Ctl{% endblock %}
{% block head %}
<style>
tr.adv-user-display { background-color: #ffc0c0; }
.error-only .node-healthy { display: none }
.migrating-only .node-stable { display: none }
</style>
<script src='/static/js/cluster_task.js'></script>
<script src='/static/js/redis_node.js'></script>
{% endblock %}
{% block body %}
<div class="panel panel-success">
<div class="panel-heading panel-heading-hide-content"><strong data-localize='clusters-info'>Clusters Info</strong></div>
<table class='table table-striped text-center'>
<thead>
<tr>
<th>#</th>
<th style='width: 320px;' data-localize='cluster-description'>Description</th>
<th data-localize='nodes-num'>Redis</th>
<th data-localize='proxy-num'>Proxy</th>
</tr>
</thead>
<tbody>
{% autoescape false %}
{% for cluster in clusters %}
{{ render('components/cluster/row.html', cluster=cluster) }}
{% endfor %}
{% endautoescape %}
</tbody>
</table>
</div>
<div class="panel panel-success">
<div class="panel-heading panel-heading-hide-content">
<div class="row">
<div class='col-xs-4' style="margin-top: 10px;">
<strong data-localize='nodes-info'>Redis Info</strong>
</div>
<div class='col-xs-4' style="float:right">
<select class="select-primary" id="selectmenu">
<option value='all' data-localize='opt-all-nodes'>All</option>
<option value='error' data-localize='opt-error-only'>Unreachables</option>
<option value='migrating' data-localize='opt-migrating-only'>Migrating</option>
</select>
</div>
</div>
</div>
<table class='table table-striped text-center'>
<thead>
<tr>
<th data-localize='address'>Address</th>
<th data-localize='node-memory-usage'>Memory Usage</th>
<th data-localize='cluster'>Cluster</th>
<th data-localize='node-ops'></th>
</tr>
</thead>
<tbody>
{% autoescape false %}
{% for node in nodes %}
{{ render('components/node/row.html', node=node, stats_enabled=stats_enabled) }}
{% endfor %}
{% endautoescape %}
</tbody>
</table>
</div>
<script>
$('select').select2({dropdownCssClass: 'dropdown-inverse'});
$(function() {
$('#selectmenu').change(function() {
var chooseValues = $('#selectmenu').val();
switch (chooseValues) {
case 'error':
return setDisplayClass('error-only');
case 'migrating':
return setDisplayClass('migrating-only');
default:
return clearDisplayClasses();
}
});
function clearDisplayClasses() {
return $('#nodes-area').removeClass('error-only').removeClass('migrating-only');
}
function setDisplayClass(cls) {
clearDisplayClasses().addClass(cls);
}
});
</script>
{% endblock %}