Revision bd80f212
b/ui/static/main.css | ||
---|---|---|
3112 | 3112 |
width: 220px; |
3113 | 3113 |
} |
3114 | 3114 |
|
3115 |
.vm-stats div.stat-content { |
|
3116 |
height: 18px; |
|
3117 |
} |
|
3118 |
|
|
3119 |
.vm-stats div.stat-content img { |
|
3120 |
margin: 0; |
|
3121 |
} |
|
3122 |
|
|
3123 |
.vm-stats div.stat-content img.busy { |
|
3124 |
margin-left: 95px; |
|
3125 |
} |
|
3126 |
|
|
3127 |
.vm-stats div.stat-error { |
|
3128 |
display:none; |
|
3129 |
} |
|
3130 |
|
|
3115 | 3131 |
.vm-details { |
3116 | 3132 |
width: 130px; |
3117 | 3133 |
margin-left:17px; |
... | ... | |
3159 | 3175 |
color: #383838; |
3160 | 3176 |
} |
3161 | 3177 |
|
3162 |
a.manage-metadata { |
|
3178 |
a.manage-metadata, a.stats-report {
|
|
3163 | 3179 |
font-size: 100%; |
3164 | 3180 |
color: black; |
3165 | 3181 |
margin-left:17px; |
3166 | 3182 |
text-decoration: underline; |
3167 | 3183 |
} |
3168 | 3184 |
|
3185 |
a.stats-report { |
|
3186 |
margin: 15px 0 0 80px; |
|
3187 |
} |
|
3188 |
|
|
3169 | 3189 |
div.machine a.manage-metadata:hover { |
3170 | 3190 |
background-color: transparent; |
3171 | 3191 |
} |
... | ... | |
3208 | 3228 |
height:20000em; |
3209 | 3229 |
} |
3210 | 3230 |
|
3211 |
.metadata-bar { |
|
3212 |
float: right !important; |
|
3213 |
margin: 1px 7px 0 !important; |
|
3214 |
} |
|
3215 |
|
|
3216 | 3231 |
/* single view */ |
3217 | 3232 |
.single { |
3218 | 3233 |
color: #383838; |
b/ui/static/synnefo.js | ||
---|---|---|
1212 | 1212 |
dataType: "json", |
1213 | 1213 |
timeout: TIMEOUT, |
1214 | 1214 |
error: function(jqXHR, textStatus, errorThrown) { |
1215 |
try { |
|
1216 |
ajax_error(jqXHR.status, undefined, 'Get stats', jqXHR.responseText); |
|
1217 |
} catch (err) { |
|
1218 |
ajax_error(err); |
|
1219 |
} |
|
1215 |
// report error as text inline |
|
1216 |
$('#' + serverID + ' img.busy').hide(); |
|
1217 |
$('#' + serverID + ' div.stat-error').show(); |
|
1220 | 1218 |
}, |
1221 | 1219 |
success: function(data, textStatus, jqXHR) { |
1222 | 1220 |
// in icon view |
1223 | 1221 |
if ( $.cookie('view') == 0 ) { |
1222 |
$('#' + serverID + ' img.busy').removeClass('busy'); |
|
1224 | 1223 |
$('#' + serverID + ' img.cpu').attr("src", data.stats.cpuBar); |
1225 | 1224 |
$('#' + serverID + ' img.net').attr("src", data.stats.netBar); |
1226 | 1225 |
} |
b/ui/templates/machines_icon.html | ||
---|---|---|
72 | 72 |
{% trans "Image Size" %}: <span class="image-size-data">2.3</span> (GB) |
73 | 73 |
</div> |
74 | 74 |
<div class="vm-stats metadata-column"> |
75 |
{% trans "CPU" %} <br /> |
|
76 |
<img src="http://stats.okeanos.grnet.gr/test/cpu-bar.png" class="cpu metadata-bar" /> |
|
77 |
{% trans "Net" %} <br /> |
|
78 |
<img src="http://stats.okeanos.grnet.gr/test/net-bar.png" class="net metadata-bar" /><br /> |
|
75 |
<div class='stat-label'>{% trans "CPU" %}</div> |
|
76 |
<div class='stat-content'> |
|
77 |
<img src="./static/icons/indicators/small/progress.gif" class="cpu busy" /> |
|
78 |
<div class='stat-error'>{% trans "Could not fetch CPU stats." %}</div> |
|
79 |
</div> |
|
80 |
<div class='stat-label'>{% trans "Net" %}</div> |
|
81 |
<div class='stat-content'> |
|
82 |
<img src="./static/icons/indicators/small/progress.gif" class="net busy" /> |
|
83 |
<div class='stat-error'>{% trans "Could not fetch Net stats." %}</div> |
|
84 |
</div> |
|
85 |
<a href="#" class="stats-report">{% trans "Full report" %}</a> |
|
79 | 86 |
</div> |
80 | 87 |
<div class="vm-metadata metadata-column"> |
81 | 88 |
<div class="metadata-left"> |
... | ... | |
218 | 225 |
$(this).find('.info-label').removeClass('darker'); |
219 | 226 |
$(this).parent().parent().removeClass('light-background'); |
220 | 227 |
} else { |
221 |
// make the get stats call |
|
228 |
// reset stats |
|
229 |
$(this).closest('.machine-container').find('.vm-stats div.stat-error').hide(); |
|
230 |
$(this).closest('.machine-container').find('.vm-stats img.cpu').attr('src', './static/icons/indicators/small/progress.gif').addClass('busy').show(); |
|
231 |
$(this).closest('.machine-container').find('.vm-stats img.net').attr('src', './static/icons/indicators/small/progress.gif').addClass('busy').show(); |
|
232 |
// get new stats |
|
222 | 233 |
var serverID = $(this).closest('.machine-container').attr('id'); |
223 | 234 |
get_server_stats(serverID); |
224 | 235 |
// toggle drop-down pane |
Also available in: Unified diff