parent
90a6bcaa47
commit
c8ae9f40fb
@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Cells/NzbDroneCell'
|
||||
], function (NzbDroneCell) {
|
||||
return NzbDroneCell.extend({
|
||||
|
||||
className: 'log-level-cell',
|
||||
|
||||
render: function () {
|
||||
|
||||
var level = this._getValue();
|
||||
this.$el.html('<i class="icon-nd-health-{0}" title="{1}"/>'.format(this._getValue().toLowerCase(), level));
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
@ -0,0 +1,55 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'Health/HealthCollection',
|
||||
'System/Info/Health/HealthCell',
|
||||
'System/Info/Health/HealthOkView'
|
||||
], function (Marionette, Backgrid, HealthCollection, HealthCell, HealthOkView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'System/Info/Health/HealthLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
grid: '#x-health-grid'
|
||||
},
|
||||
|
||||
columns:
|
||||
[
|
||||
{
|
||||
name: 'type',
|
||||
label: '',
|
||||
cell: HealthCell
|
||||
},
|
||||
{
|
||||
name: 'message',
|
||||
label: 'Message',
|
||||
cell: 'string'
|
||||
}
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
this.listenTo(HealthCollection, 'sync', this.render);
|
||||
HealthCollection.fetch();
|
||||
},
|
||||
|
||||
onRender : function() {
|
||||
if (HealthCollection.length === 0) {
|
||||
this.grid.show(new HealthOkView());
|
||||
}
|
||||
|
||||
else {
|
||||
this._showTable();
|
||||
}
|
||||
},
|
||||
|
||||
_showTable: function() {
|
||||
this.grid.show(new Backgrid.Grid({
|
||||
row: Backgrid.Row,
|
||||
columns: this.columns,
|
||||
collection: HealthCollection,
|
||||
className:'table table-hover'
|
||||
}));
|
||||
}
|
||||
});
|
||||
});
|
@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette'
|
||||
], function (Marionette) {
|
||||
return Marionette.ItemView.extend({
|
||||
template: 'System/Info/Health/HealthOkViewTemplate'
|
||||
});
|
||||
});
|
@ -0,0 +1,2 @@
|
||||
No issues with your configuration
|
||||
|
Loading…
Reference in new issue