parent
ab4e1edac0
commit
6b418276b6
@ -1,25 +0,0 @@
|
|||||||
window.NzbDrone.ApiRoot = '/api';
|
|
||||||
|
|
||||||
var statusText = window.$.ajax({
|
|
||||||
type : 'GET',
|
|
||||||
url : window.NzbDrone.ApiRoot + '/system/status',
|
|
||||||
async: false,
|
|
||||||
headers: {
|
|
||||||
Authorization: window.NzbDrone.ApiKey
|
|
||||||
}
|
|
||||||
}).responseText;
|
|
||||||
|
|
||||||
window.NzbDrone.ServerStatus = JSON.parse(statusText);
|
|
||||||
|
|
||||||
var footerText = window.NzbDrone.ServerStatus.version;
|
|
||||||
|
|
||||||
window.$(document).ready(function () {
|
|
||||||
if (window.NzbDrone.ServerStatus.branch !== 'master') {
|
|
||||||
footerText += '</br>' + window.NzbDrone.ServerStatus.branch;
|
|
||||||
}
|
|
||||||
window.$('#footer-region .version').html(footerText);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
define(
|
define(
|
||||||
[
|
[
|
||||||
'backbone'
|
'backbone',
|
||||||
], function (Backbone) {
|
'api!system/status'
|
||||||
|
], function (Backbone, statusData) {
|
||||||
|
|
||||||
var StatusModel = Backbone.Model.extend({
|
var StatusModel = Backbone.Model.extend({
|
||||||
url: window.NzbDrone.ApiRoot + '/system/status'
|
url: window.NzbDrone.ApiRoot + '/system/status'
|
||||||
});
|
});
|
||||||
|
|
||||||
var instance = new StatusModel();
|
var instance = new StatusModel(statusData);
|
||||||
instance.fetch();
|
|
||||||
return instance;
|
return instance;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in new issue