removed ServerStatus.js

This commit is contained in:
kayone 2013-11-19 17:43:31 -08:00
parent ab4e1edac0
commit 6b418276b6
7 changed files with 32 additions and 60 deletions

View File

@ -14,12 +14,9 @@ namespace NzbDrone.Core.Notifications
public class NotificationFactory : ProviderFactory<INotification, NotificationDefinition>, INotificationFactory
{
private IEnumerable<INotification> _providers;
public NotificationFactory(INotificationRepository providerRepository, IEnumerable<INotification> providers, IContainer container, Logger logger)
: base(providerRepository, providers, container, logger)
{
_providers = providers;
}
public List<INotification> OnGrabEnabled()

View File

@ -6,8 +6,9 @@ define(
'marionette',
'moment',
'Calendar/Collection',
'System/StatusModel',
'fullcalendar'
], function (vent, Marionette, moment, CalendarCollection) {
], function (vent, Marionette, moment, CalendarCollection, StatusModel) {
var _instance;
@ -24,7 +25,7 @@ define(
allDayDefault : false,
ignoreTimezone: false,
weekMode : 'variable',
firstDay : window.NzbDrone.ServerStatus.startOfWeek,
firstDay : StatusModel.get('startOfWeek'),
timeFormat : 'h(:mm)tt',
header : {
left : 'prev,next today',

View File

@ -179,3 +179,7 @@ footer {
.error {
.formFieldState(@errorText, @errorText, @errorBackground);
}
#errors{
display : none;
}

View File

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

View File

@ -1,14 +1,14 @@
'use strict';
define(
[
'backbone'
], function (Backbone) {
'backbone',
'api!system/status'
], function (Backbone, statusData) {
var StatusModel = Backbone.Model.extend({
url: window.NzbDrone.ApiRoot + '/system/status'
});
var instance = new StatusModel();
instance.fetch();
var instance = new StatusModel(statusData);
return instance;
});

View File

@ -1,5 +1,6 @@
'use strict';
require.config({
urlArgs: 'v=' + window.NzbDrone.Version,
paths: {
'backbone' : 'JsLibraries/backbone',
'moment' : 'JsLibraries/moment',
@ -28,19 +29,15 @@ require.config({
},
shim: {
jquery :{
exports: '$'
},
signalR: {
deps:
[
'jquery'
]
},
bootstrap: {
deps:
[
@ -52,14 +49,12 @@ require.config({
});
}
},
backstrech: {
deps:
[
'jquery'
]
},
underscore: {
deps :
[
@ -67,7 +62,6 @@ require.config({
],
exports: '_'
},
backbone: {
deps:
[
@ -75,14 +69,10 @@ require.config({
'underscore',
'Mixins/jquery.ajax',
'jQuery/ToTheTop'
],
exports: 'Backbone'
},
marionette: {
deps:
[
@ -98,21 +88,18 @@ require.config({
}
},
'jquery.knob': {
deps:
[
'jquery'
]
},
'jquery.dotdotdot': {
deps:
[
'jquery'
]
},
'backbone.pageable': {
deps:
[
@ -139,7 +126,6 @@ require.config({
'backbone'
]
},
backgrid : {
deps:
[
@ -189,10 +175,6 @@ require.config({
}
});
require.config({
urlArgs: 'v=' + window.NzbDrone.ServerStatus.version
});
define(
[
'jquery',
@ -205,9 +187,10 @@ define(
'Series/SeriesController',
'Router',
'Shared/Modal/Controller',
'System/StatusModel',
'Instrumentation/StringFormat',
'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 ModalController();
@ -230,5 +213,16 @@ define(
$('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();
});

View File

@ -61,18 +61,19 @@
</div>
</footer>
</body>
<div id="errors">
</div>
<div id="errors"></div>
<script type="text/javascript">
window.NzbDrone = window.NzbDrone || {};
window.NzbDrone.ApiKey = 'API_KEY';
window.NzbDrone = {
ApiRoot: '/api',
ApiKey : 'API_KEY',
Version: 'APP_VERSION'
};
</script>
<script src="/polyfills.js"></script>
<script src="/JsLibraries/jquery.js"></script>
<script src="/JsLibraries/messenger.js"></script>
<script src="/Instrumentation/ErrorHandler.js"></script>
<script src="/ServerStatus.js"></script>
<script data-main="/app" src="/JsLibraries/require.js"></script>
<script src="/JsLibraries/xrayquire.js"></script>