removed ServerStatus.js
This commit is contained in:
parent
ab4e1edac0
commit
6b418276b6
|
@ -14,12 +14,9 @@ namespace NzbDrone.Core.Notifications
|
||||||
|
|
||||||
public class NotificationFactory : ProviderFactory<INotification, NotificationDefinition>, INotificationFactory
|
public class NotificationFactory : ProviderFactory<INotification, NotificationDefinition>, INotificationFactory
|
||||||
{
|
{
|
||||||
private IEnumerable<INotification> _providers;
|
|
||||||
|
|
||||||
public NotificationFactory(INotificationRepository providerRepository, IEnumerable<INotification> providers, IContainer container, Logger logger)
|
public NotificationFactory(INotificationRepository providerRepository, IEnumerable<INotification> providers, IContainer container, Logger logger)
|
||||||
: base(providerRepository, providers, container, logger)
|
: base(providerRepository, providers, container, logger)
|
||||||
{
|
{
|
||||||
_providers = providers;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<INotification> OnGrabEnabled()
|
public List<INotification> OnGrabEnabled()
|
||||||
|
|
|
@ -6,8 +6,9 @@ define(
|
||||||
'marionette',
|
'marionette',
|
||||||
'moment',
|
'moment',
|
||||||
'Calendar/Collection',
|
'Calendar/Collection',
|
||||||
|
'System/StatusModel',
|
||||||
'fullcalendar'
|
'fullcalendar'
|
||||||
], function (vent, Marionette, moment, CalendarCollection) {
|
], function (vent, Marionette, moment, CalendarCollection, StatusModel) {
|
||||||
|
|
||||||
var _instance;
|
var _instance;
|
||||||
|
|
||||||
|
@ -24,7 +25,7 @@ define(
|
||||||
allDayDefault : false,
|
allDayDefault : false,
|
||||||
ignoreTimezone: false,
|
ignoreTimezone: false,
|
||||||
weekMode : 'variable',
|
weekMode : 'variable',
|
||||||
firstDay : window.NzbDrone.ServerStatus.startOfWeek,
|
firstDay : StatusModel.get('startOfWeek'),
|
||||||
timeFormat : 'h(:mm)tt',
|
timeFormat : 'h(:mm)tt',
|
||||||
header : {
|
header : {
|
||||||
left : 'prev,next today',
|
left : 'prev,next today',
|
||||||
|
|
|
@ -179,3 +179,7 @@ footer {
|
||||||
.error {
|
.error {
|
||||||
.formFieldState(@errorText, @errorText, @errorBackground);
|
.formFieldState(@errorText, @errorText, @errorBackground);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#errors{
|
||||||
|
display : none;
|
||||||
|
}
|
|
@ -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;
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
require.config({
|
require.config({
|
||||||
|
urlArgs: 'v=' + window.NzbDrone.Version,
|
||||||
paths: {
|
paths: {
|
||||||
'backbone' : 'JsLibraries/backbone',
|
'backbone' : 'JsLibraries/backbone',
|
||||||
'moment' : 'JsLibraries/moment',
|
'moment' : 'JsLibraries/moment',
|
||||||
|
@ -28,19 +29,15 @@ require.config({
|
||||||
},
|
},
|
||||||
|
|
||||||
shim: {
|
shim: {
|
||||||
|
|
||||||
|
|
||||||
jquery :{
|
jquery :{
|
||||||
exports: '$'
|
exports: '$'
|
||||||
},
|
},
|
||||||
|
|
||||||
signalR: {
|
signalR: {
|
||||||
deps:
|
deps:
|
||||||
[
|
[
|
||||||
'jquery'
|
'jquery'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
bootstrap: {
|
bootstrap: {
|
||||||
deps:
|
deps:
|
||||||
[
|
[
|
||||||
|
@ -52,14 +49,12 @@ require.config({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
backstrech: {
|
backstrech: {
|
||||||
deps:
|
deps:
|
||||||
[
|
[
|
||||||
'jquery'
|
'jquery'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
underscore: {
|
underscore: {
|
||||||
deps :
|
deps :
|
||||||
[
|
[
|
||||||
|
@ -67,7 +62,6 @@ require.config({
|
||||||
],
|
],
|
||||||
exports: '_'
|
exports: '_'
|
||||||
},
|
},
|
||||||
|
|
||||||
backbone: {
|
backbone: {
|
||||||
deps:
|
deps:
|
||||||
[
|
[
|
||||||
|
@ -75,14 +69,10 @@ require.config({
|
||||||
'underscore',
|
'underscore',
|
||||||
'Mixins/jquery.ajax',
|
'Mixins/jquery.ajax',
|
||||||
'jQuery/ToTheTop'
|
'jQuery/ToTheTop'
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
exports: 'Backbone'
|
exports: 'Backbone'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
marionette: {
|
marionette: {
|
||||||
deps:
|
deps:
|
||||||
[
|
[
|
||||||
|
@ -98,21 +88,18 @@ require.config({
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
'jquery.knob': {
|
'jquery.knob': {
|
||||||
deps:
|
deps:
|
||||||
[
|
[
|
||||||
'jquery'
|
'jquery'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
'jquery.dotdotdot': {
|
'jquery.dotdotdot': {
|
||||||
deps:
|
deps:
|
||||||
[
|
[
|
||||||
'jquery'
|
'jquery'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
'backbone.pageable': {
|
'backbone.pageable': {
|
||||||
deps:
|
deps:
|
||||||
[
|
[
|
||||||
|
@ -139,7 +126,6 @@ require.config({
|
||||||
'backbone'
|
'backbone'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
backgrid : {
|
backgrid : {
|
||||||
deps:
|
deps:
|
||||||
[
|
[
|
||||||
|
@ -189,10 +175,6 @@ require.config({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
require.config({
|
|
||||||
urlArgs: 'v=' + window.NzbDrone.ServerStatus.version
|
|
||||||
});
|
|
||||||
|
|
||||||
define(
|
define(
|
||||||
[
|
[
|
||||||
'jquery',
|
'jquery',
|
||||||
|
@ -205,9 +187,10 @@ define(
|
||||||
'Series/SeriesController',
|
'Series/SeriesController',
|
||||||
'Router',
|
'Router',
|
||||||
'Shared/Modal/Controller',
|
'Shared/Modal/Controller',
|
||||||
|
'System/StatusModel',
|
||||||
'Instrumentation/StringFormat',
|
'Instrumentation/StringFormat',
|
||||||
'LifeCycle'
|
'LifeCycle'
|
||||||
], function ($, Backbone, Marionette, RouteBinder, SignalRBroadcaster, NavbarView, AppLayout, SeriesController, Router, ModalController) {
|
], function ($, Backbone, Marionette, RouteBinder, SignalRBroadcaster, NavbarView, AppLayout, SeriesController, Router, ModalController, serverStatusModel) {
|
||||||
|
|
||||||
new SeriesController();
|
new SeriesController();
|
||||||
new ModalController();
|
new ModalController();
|
||||||
|
@ -230,5 +213,16 @@ define(
|
||||||
$('body').addClass('started');
|
$('body').addClass('started');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.addInitializer(function () {
|
||||||
|
|
||||||
|
var footerText = serverStatusModel.get('version');
|
||||||
|
|
||||||
|
if (serverStatusModel.get('branch') !== 'master') {
|
||||||
|
footerText += '</br>' + serverStatusModel.get('branch');
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#footer-region .version').html(footerText);
|
||||||
|
});
|
||||||
|
|
||||||
app.start();
|
app.start();
|
||||||
});
|
});
|
|
@ -61,18 +61,19 @@
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
<div id="errors">
|
<div id="errors"></div>
|
||||||
</div>
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.NzbDrone = window.NzbDrone || {};
|
window.NzbDrone = {
|
||||||
window.NzbDrone.ApiKey = 'API_KEY';
|
ApiRoot: '/api',
|
||||||
|
ApiKey : 'API_KEY',
|
||||||
|
Version: 'APP_VERSION'
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="/polyfills.js"></script>
|
<script src="/polyfills.js"></script>
|
||||||
<script src="/JsLibraries/jquery.js"></script>
|
<script src="/JsLibraries/jquery.js"></script>
|
||||||
<script src="/JsLibraries/messenger.js"></script>
|
<script src="/JsLibraries/messenger.js"></script>
|
||||||
<script src="/Instrumentation/ErrorHandler.js"></script>
|
<script src="/Instrumentation/ErrorHandler.js"></script>
|
||||||
<script src="/ServerStatus.js"></script>
|
|
||||||
|
|
||||||
<script data-main="/app" src="/JsLibraries/require.js"></script>
|
<script data-main="/app" src="/JsLibraries/require.js"></script>
|
||||||
<script src="/JsLibraries/xrayquire.js"></script>
|
<script src="/JsLibraries/xrayquire.js"></script>
|
||||||
|
|
Loading…
Reference in New Issue