1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-16 21:15:33 -04:00

New: App health displayed in UI

This commit is contained in:
Mark McDowall
2014-02-25 21:40:47 -08:00
parent 90a6bcaa47
commit c8ae9f40fb
54 changed files with 873 additions and 44 deletions

View File

@@ -1,7 +1,7 @@
'use strict';
define([
'vent',
'marionette',
'vent',
'marionette',
'backgrid',
'System/Info/DiskSpace/DiskSpaceCollection',
'Shared/LoadingView',
@@ -14,6 +14,7 @@ define([
regions: {
grid: '#x-grid'
},
columns:
[
{
@@ -37,6 +38,7 @@ define([
this.collection = new DiskSpaceCollection();
this.listenTo(this.collection, 'sync', this._showTable);
},
onRender : function() {
this.grid.show(new LoadingView());
},
@@ -44,6 +46,7 @@ define([
onShow: function() {
this.collection.fetch();
},
_showTable: function() {
this.grid.show(new Backgrid.Grid({
row: Backgrid.Row,

View File

@@ -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;
}
});
});

View File

@@ -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'
}));
}
});
});

View File

@@ -0,0 +1,6 @@
<fieldset class="x-health">
<legend>Health</legend>
<div id="x-health-grid"/>
</fieldset>

View File

@@ -0,0 +1,9 @@
'use strict';
define(
[
'marionette'
], function (Marionette) {
return Marionette.ItemView.extend({
template: 'System/Info/Health/HealthOkViewTemplate'
});
});

View File

@@ -0,0 +1,2 @@
No issues with your configuration

View File

@@ -4,22 +4,26 @@ define(
'backbone',
'marionette',
'System/Info/About/AboutView',
'System/Info/DiskSpace/DiskSpaceLayout'
'System/Info/DiskSpace/DiskSpaceLayout',
'System/Info/Health/HealthLayout'
], function (Backbone,
Marionette,
AboutView,
DiskSpaceLayout) {
DiskSpaceLayout,
HealthLayout) {
return Marionette.Layout.extend({
template: 'System/Info/SystemInfoLayoutTemplate',
regions: {
about : '#about',
diskSpace: '#diskspace'
diskSpace: '#diskspace',
health : '#health'
},
onRender: function () {
this.about.show(new AboutView());
this.diskSpace.show(new DiskSpaceLayout());
this.health.show(new HealthLayout());
}
});
});

View File

@@ -1,4 +1,8 @@
<div class="row">
<div class="span12" id="health"></div>
</div>
<div class="row">
<div class="span12" id="about"></div>
</div>