2014-07-03 19:22:57 -07:00
|
|
|
|
(function () {
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
$(document).on('pagebeforeshow', "#logPage", function () {
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2013-11-30 11:32:39 -07:00
|
|
|
|
var page = this;
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
ApiClient.getJSON(ApiClient.getUrl('System/Logs')).done(function (logs) {
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
var html = '';
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
html += '<ul data-role="listview" data-inset="true">';
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
html += logs.map(function (log) {
|
2013-11-30 11:32:39 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
var logUrl = ApiClient.getUrl('System/Logs/Log', {
|
|
|
|
|
name: log.Name
|
|
|
|
|
});
|
|
|
|
|
var logHtml = '<li><a href="' + logUrl + '" target="_blank">';
|
2013-11-30 11:32:39 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
logHtml += '<h3>';
|
|
|
|
|
logHtml += log.Name;
|
|
|
|
|
logHtml += '</h3>';
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
var date = parseISO8601Date(log.DateModified, { toLocal: true });
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
var text = date.toLocaleDateString();
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
text += ' ' + LiveTvHelpers.getDisplayTime(date);
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
logHtml += '<p>' + text + '</p>';
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
logHtml += '</li>';
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
return logHtml;
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
})
|
|
|
|
|
.join('');
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
html += '</ul>';
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
$('.serverLogs', page).html(html).trigger('create');
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
});
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
});
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
})();
|