mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-28 23:27:08 -04:00
rjs -> webpack
This commit is contained in:
@@ -1,18 +1,10 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Cells/NzbDroneCell'
|
||||
], function (NzbDroneCell) {
|
||||
return NzbDroneCell.extend({
|
||||
var NzbDroneCell = require('../../../Cells/NzbDroneCell');
|
||||
|
||||
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;
|
||||
}
|
||||
});
|
||||
});
|
||||
module.exports = 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;
|
||||
}
|
||||
});
|
||||
@@ -1,64 +1,47 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'Health/HealthCollection',
|
||||
'System/Info/Health/HealthCell',
|
||||
'System/Info/Health/HealthWikiCell',
|
||||
'System/Info/Health/HealthOkView'
|
||||
], function (Marionette, Backgrid, HealthCollection, HealthCell, HealthWikiCell, HealthOkView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'System/Info/Health/HealthLayoutTemplate',
|
||||
var Marionette = require('marionette');
|
||||
var Backgrid = require('backgrid');
|
||||
var HealthCollection = require('../../../Health/HealthCollection');
|
||||
var HealthCell = require('./HealthCell');
|
||||
var HealthWikiCell = require('./HealthWikiCell');
|
||||
var HealthOkView = require('./HealthOkView');
|
||||
|
||||
regions: {
|
||||
grid: '#x-health-grid'
|
||||
},
|
||||
|
||||
columns:
|
||||
[
|
||||
{
|
||||
name: 'type',
|
||||
label: '',
|
||||
cell: HealthCell,
|
||||
sortable: false
|
||||
},
|
||||
{
|
||||
name: 'message',
|
||||
label: 'Message',
|
||||
cell: 'string',
|
||||
sortable: false
|
||||
},
|
||||
{
|
||||
name: 'wikiUrl',
|
||||
label: '',
|
||||
cell: HealthWikiCell,
|
||||
sortable: false
|
||||
}
|
||||
],
|
||||
|
||||
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'
|
||||
}));
|
||||
}
|
||||
});
|
||||
});
|
||||
module.exports = Marionette.Layout.extend({
|
||||
template : 'System/Info/Health/HealthLayoutTemplate',
|
||||
regions : {grid : '#x-health-grid'},
|
||||
columns : [{
|
||||
name : 'type',
|
||||
label : '',
|
||||
cell : HealthCell,
|
||||
sortable : false
|
||||
}, {
|
||||
name : 'message',
|
||||
label : 'Message',
|
||||
cell : 'string',
|
||||
sortable : false
|
||||
}, {
|
||||
name : 'wikiUrl',
|
||||
label : '',
|
||||
cell : HealthWikiCell,
|
||||
sortable : false
|
||||
}],
|
||||
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'
|
||||
}));
|
||||
}
|
||||
});
|
||||
@@ -1,9 +1,3 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette'
|
||||
], function (Marionette) {
|
||||
return Marionette.ItemView.extend({
|
||||
template: 'System/Info/Health/HealthOkViewTemplate'
|
||||
});
|
||||
});
|
||||
var Marionette = require('marionette');
|
||||
|
||||
module.exports = Marionette.ItemView.extend({template : 'System/Info/Health/HealthOkViewTemplate'});
|
||||
@@ -1,29 +1,21 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'jquery',
|
||||
'backgrid'
|
||||
], function ($, Backgrid) {
|
||||
return Backgrid.UriCell.extend({
|
||||
var $ = require('jquery');
|
||||
var Backgrid = require('backgrid');
|
||||
|
||||
className: 'wiki-link-cell',
|
||||
|
||||
title: 'Read the Wiki for more information',
|
||||
|
||||
text: 'Wiki',
|
||||
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
var rawValue = this.model.get(this.column.get("name"));
|
||||
var formattedValue = this.formatter.fromRaw(rawValue, this.model);
|
||||
this.$el.append($("<a>", {
|
||||
tabIndex: -1,
|
||||
href: rawValue,
|
||||
title: this.title || formattedValue,
|
||||
target: this.target
|
||||
}).text(this.text));
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
module.exports = Backgrid.UriCell.extend({
|
||||
className : 'wiki-link-cell',
|
||||
title : 'Read the Wiki for more information',
|
||||
text : 'Wiki',
|
||||
render : function(){
|
||||
this.$el.empty();
|
||||
var rawValue = this.model.get(this.column.get('name'));
|
||||
var formattedValue = this.formatter.fromRaw(rawValue, this.model);
|
||||
this.$el.append($('<a>', {
|
||||
tabIndex : -1,
|
||||
href : rawValue,
|
||||
title : this.title || formattedValue,
|
||||
target : this.target
|
||||
}).text(this.text));
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user