Log details

New: Logs now have details available
pull/4/head
Mark McDowall 11 years ago
parent 436644318b
commit e7ac2247ab

@ -22,6 +22,9 @@ namespace NzbDrone.Core.Test.ParserTests
* [TestCase("Desparate Housewives - S07E22 - 7x23 - And Lots of Security.. [HDTV-720p].mkv", "Desparate Housewives", 7, new[] { 22, 23 }, 2)]
* [TestCase("S07E22 - 7x23 - And Lots of Security.. [HDTV-720p].mkv", "", 7, new[] { 22, 23 }, 2)]
* (Game of Thrones s03 e - "Game of Thrones Season 3 Episode 10"
* The.Man.of.Steel.1994-05.33.hybrid.DreamGirl-Novus-HD
* Superman.-.The.Man.of.Steel.1994-06.34.hybrid.DreamGirl-Novus-HD
* Superman.-.The.Man.of.Steel.1994-05.33.hybrid.DreamGirl-Novus-HD
*/
[TestCase("Sonny.With.a.Chance.S02E15", "Sonny.With.a.Chance", 2, 15)]

@ -1,2 +0,0 @@
<i class="icon-remove x-remove" title="Remove"/>
<i class="icon-repeat x-redownload" title="Re-Download"/>

@ -21,7 +21,7 @@ define(
},
_showDetails: function () {
vent.trigger(vent.Commands.ShowHistoryDetails, { history: this.model });
vent.trigger(vent.Commands.ShowHistoryDetails, { model: this.model });
}
});
});

@ -7,8 +7,9 @@ define(
'Series/Edit/EditSeriesView',
'Series/Delete/DeleteSeriesView',
'Episode/EpisodeDetailsLayout',
'History/Details/HistoryDetailsView'
], function (vent, AppLayout, Marionette, EditSeriesView, DeleteSeriesView, EpisodeDetailsLayout, HistoryDetailsView) {
'History/Details/HistoryDetailsView',
'System/Logs/Table/Details/LogDetailsView'
], function (vent, AppLayout, Marionette, EditSeriesView, DeleteSeriesView, EpisodeDetailsLayout, HistoryDetailsView, LogDetailsView) {
return Marionette.AppRouter.extend({
@ -18,6 +19,7 @@ define(
vent.on(vent.Commands.DeleteSeriesCommand, this._deleteSeries, this);
vent.on(vent.Commands.ShowEpisodeDetails, this._showEpisode, this);
vent.on(vent.Commands.ShowHistoryDetails, this._showHistory, this);
vent.on(vent.Commands.ShowLogDetails, this._showLogDetails, this);
},
_closeModal: function () {
@ -40,7 +42,12 @@ define(
},
_showHistory: function (options) {
var view = new HistoryDetailsView({ model: options.history });
var view = new HistoryDetailsView({ model: options.model });
AppLayout.modalRegion.show(view);
},
_showLogDetails: function (options) {
var view = new LogDetailsView({ model: options.model });
AppLayout.modalRegion.show(view);
}
});

@ -130,12 +130,12 @@ define(
filename: filename
});
this.listenToOnce(contentsModel, 'sync', this._showContents);
this.listenToOnce(contentsModel, 'sync', this._showDetails);
contentsModel.fetch({ dataType: 'text' });
},
_showContents: function (model) {
_showDetails: function (model) {
this.contents.show(new ContentsView({ model: model }));
},

@ -9,10 +9,10 @@ define(
className: 'log-file-row',
events: {
'click': '_showContents'
'click': '_showDetails'
},
_showContents: function () {
_showDetails: function () {
vent.trigger(vent.Commands.ShowLogFile, { model: this.model });
}
});

@ -18,4 +18,8 @@
.log-file-row {
.clickable;
}
.log-row {
.clickable;
}

@ -0,0 +1,11 @@
'use strict';
define(
[
'vent',
'marionette'
], function (vent, Marionette) {
return Marionette.ItemView.extend({
template: 'System/Logs/Table/Details/LogDetailsViewTemplate'
});
});

@ -0,0 +1,22 @@
<div class="log-details-modal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Details</h3>
</div>
<div class="modal-body">
Message
<pre>{{message}}</pre>
{{#if exception}}
<br/>
Exception
<pre>{{exception}}</pre>
{{/if}}
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">close</button>
</div>
</div>

@ -0,0 +1,19 @@
'use strict';
define(
[
'vent',
'backgrid'
], function (vent, Backgrid) {
return Backgrid.Row.extend({
className: 'log-row',
events: {
'click': '_showDetails'
},
_showDetails: function () {
vent.trigger(vent.Commands.ShowLogDetails, { model: this.model });
}
});
});

@ -6,11 +6,12 @@ define(
'backgrid',
'System/Logs/Table/LogTimeCell',
'System/Logs/Table/LogLevelCell',
'System/Logs/Table/LogRow',
'Shared/Grid/Pager',
'System/Logs/LogsCollection',
'Shared/Toolbar/ToolbarLayout',
'Shared/LoadingView'
], function (vent, Marionette, Backgrid, LogTimeCell, LogLevelCell, GridPager, LogCollection, ToolbarLayout, LoadingView) {
], function (vent, Marionette, Backgrid, LogTimeCell, LogLevelCell, LogRow, GridPager, LogCollection, ToolbarLayout, LoadingView) {
return Marionette.Layout.extend({
template: 'System/Logs/Table/LogsTableLayoutTemplate',
@ -77,7 +78,7 @@ define(
_showTable: function () {
this.grid.show(new Backgrid.Grid({
row : Backgrid.Row,
row : LogRow,
columns : this.columns,
collection: this.collection,
className : 'table table-hover'

@ -20,6 +20,7 @@ define(
CloseModalCommand : 'CloseModalCommand',
ShowEpisodeDetails : 'ShowEpisodeDetails',
ShowHistoryDetails : 'ShowHistoryDetails',
ShowLogDetails : 'ShowLogDetails',
SaveSettings : 'saveSettings',
ShowLogFile : 'showLogFile'
};

Loading…
Cancel
Save