Commit bf745dea authored by Franco Fichtner's avatar Franco Fichtner

dashboard: consistent style for status keyword

parent bcb39d0c
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
tr_content.push('<td><small><strong>'+gateway['name']+'</strong><br/>'+gateway['address']+'</small></td>'); tr_content.push('<td><small><strong>'+gateway['name']+'</strong><br/>'+gateway['address']+'</small></td>');
tr_content.push('<td>'+gateway['delay']+'</td>'); tr_content.push('<td>'+gateway['delay']+'</td>');
tr_content.push('<td>'+gateway['loss']+'</td>'); tr_content.push('<td>'+gateway['loss']+'</td>');
tr_content.push('<td><div class="" style="width:40px;">'+gateway['status_translated']+'</div></td>'); tr_content.push('<td><font>'+gateway['status_translated']+'</font></td>');
tr_content.push('</tr>'); tr_content.push('</tr>');
tbody.append(tr_content.join('')); tbody.append(tr_content.join(''));
} else { } else {
...@@ -51,24 +51,28 @@ ...@@ -51,24 +51,28 @@
// set color on status text // set color on status text
switch (gateway['status']) { switch (gateway['status']) {
case 'force_down': case 'force_down':
status_color = 'danger'; status_color = 'red';
break; break;
case 'down': case 'down':
status_color = 'danger'; status_color = 'red';
break; break;
case 'loss': case 'loss':
status_color = 'warning'; status_color = 'purple';
break; break;
case 'delay': case 'delay':
status_color = 'warning'; status_color = 'purple';
break; break;
case 'none': case 'none':
status_color = 'success'; status_color = 'green';
break; break;
default: default:
status_color = 'info'; status_color = '';
break;
}
$("#"+tr_id+" > td:eq(3) > font").removeAttr('color');
if (status_color != '') {
$("#"+tr_id+" > td:eq(3) > font").attr('color', status_color);
} }
$("#"+tr_id+" > td:eq(3) > div").removeClass().addClass('bg-'+status_color);
}); });
} }
</script> </script>
...@@ -80,7 +84,7 @@ ...@@ -80,7 +84,7 @@
<th><?=gettext('Name')?></th> <th><?=gettext('Name')?></th>
<th><?=gettext('RTT')?></th> <th><?=gettext('RTT')?></th>
<th><?=gettext('Loss')?></th> <th><?=gettext('Loss')?></th>
<th style="width:160px;"><?=gettext('Status')?></th> <th><?=gettext('Status')?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment