Convert template to DataTables column
This commit is contained in:
@@ -1,6 +1,19 @@
|
|||||||
<a href="[% settings.plugin_observium.location %]/device/hostname=[% device.dns || device.name | uri %]/tab=port/ifdescr=[% row.base64url_port %]/"
|
{
|
||||||
|
"title": 'Traffic',
|
||||||
|
"name": 'observium',
|
||||||
|
"data": null,
|
||||||
|
"visible": true,
|
||||||
|
"orderable": false,
|
||||||
|
"searchable": false,
|
||||||
|
"render": function ( data, type, row, meta ) {
|
||||||
|
var cell_str = '';
|
||||||
|
cell_str = cell_str + '<a href="[% settings.plugin_observium.location %]/device/hostname=[% device.dns || device.name | uri %]/tab=port/ifdescr=';
|
||||||
|
cell_str = cell_str + Base64.encode(row.port) + '/"';
|
||||||
[% 'target="_blank"' UNLESS settings.plugin_observium.open_in_same_window %]
|
[% 'target="_blank"' UNLESS settings.plugin_observium.open_in_same_window %]
|
||||||
class="btn nd_observium"
|
cell_str = cell_str + 'class="btn nd_observium"';
|
||||||
data-content='
|
cell_str = cell_str + 'data-content=\''
|
||||||
<img src="[% settings.plugin_observium.location %]/graph.php?type=port_bits&device=[% device.dns || device.name | uri %]&port=[% row.port | uri %]&from=-1w&to=now&width=208&height=100&title=yes"/>'
|
cell_str = cell_str + '<img src="[% settings.plugin_observium.location %]/graph.php?type=port_bits&device=[% device.dns || device.name | uri %]&port=[% row.port | uri %]&from=-1w&to=now&width=208&height=100&title=yes"/>\''
|
||||||
><i class="icon-bar-chart"></i></a>
|
cell_str = cell_str + '><i class="icon-bar-chart"></i></a>';
|
||||||
|
return cell_str;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user