Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI: JS - status tab - use zoom icon and clicked() callback like in…
… the epg grid
  • Loading branch information
perexg committed Sep 28, 2014
1 parent 74794ab commit 2238be7
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions src/webui/static/app/status.js
Expand Up @@ -63,8 +63,7 @@ tvheadend.status_subs = function(panel, index)

function renderBw(value, item, record) {
var txt = parseInt(value / 125);
var href = 'javascript:tvheadend.subscription_bw_monitor(' + record.id + ');';
return '<a href="' + href + '">' + txt + '</a>';
return '<span class="x-zoom">&nbsp;</span>' + txt;
}

var subsCm = new Ext.grid.ColumnModel([
Expand Down Expand Up @@ -125,16 +124,26 @@ tvheadend.status_subs = function(panel, index)
id: 'in',
header: "Input (kb/s)",
dataIndex: 'in',
listeners: { click: { fn: clicked } },
renderer: renderBw,
},
{
width: 50,
id: 'out',
header: "Output (kb/s)",
dataIndex: 'out',
renderer: renderBw
listeners: { click: { fn: clicked } },
renderer: renderBw,
}
]);

function clicked(column, grid, index, e) {
if (column.dataIndex == 'in' || column.dataIndex == 'out') {
var id = grid.getStore().getAt(index).id;
tvheadend.subscription_bw_monitor(id);
return false;
}
}

subs = new Ext.grid.GridPanel({
border: false,
Expand All @@ -152,7 +161,7 @@ tvheadend.status_subs = function(panel, index)
dpanel.add(subs);
dpanel.doLayout(false, true);
}

function destroyer() {
if (subs === null || !tvheadend.dynamic)
return;
Expand Down Expand Up @@ -255,8 +264,7 @@ tvheadend.status_streams = function(panel, index)

function renderBw(value, item, record) {
var txt = parseInt(value / 1024);
var href = "javascript:tvheadend.stream_bw_monitor('" + record.id + "');";
return '<a href="' + href + '">' + txt + '</a>';
return '<span class="x-zoom">&nbsp;</span>' + txt;
}

function renderBer(value, item, store) {
Expand Down Expand Up @@ -302,7 +310,8 @@ tvheadend.status_streams = function(panel, index)
width: 50,
header: "Bandwidth (kb/s)",
dataIndex: 'bps',
renderer: renderBw
renderer: renderBw,
listeners: { click: { fn: clicked } },
},
{
width: 50,
Expand Down Expand Up @@ -333,6 +342,14 @@ tvheadend.status_streams = function(panel, index)
}
]);

function clicked(column, grid, index, e) {
if (column.dataIndex == 'bps') {
var id = grid.getStore().getAt(index).id;
tvheadend.stream_bw_monitor(id);
return false;
}
}

cm.config.push(new Ext.ux.grid.ProgressColumn({
header: "SNR",
dataIndex: 'snr',
Expand Down Expand Up @@ -680,21 +697,21 @@ tvheadend.stream_bw_monitor = function(id) {
render: {
scope: this,
fn: function(item) {
chart.streamTo(item.el.dom, 1000);
chart.streamTo(item.el.dom, 15000);
}
},
resize: {
scope: this,
fn: function(item) {
chart.render(item.el.dom, 1000);
chart.render(item.el.dom, 15000);
}
}
}
}
});

var task = {
interval: 10000,
interval: 1000,
run: function() {
var store = tvheadend.streamStatusStore;
var r = store ? store.getById(id) : null;
Expand Down

0 comments on commit 2238be7

Please sign in to comment.