2014-07-03 19:22:57 -07:00
|
|
|
|
(function () {
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2015-09-24 10:08:10 -07:00
|
|
|
|
$(document).on('pageshow', "#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-11-14 19:31:03 -07:00
|
|
|
|
var apiClient = ApiClient;
|
|
|
|
|
|
|
|
|
|
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-11-14 19:31:03 -07:00
|
|
|
|
var logUrl = apiClient.getUrl('System/Logs/Log', {
|
2014-07-03 19:22:57 -07:00
|
|
|
|
name: log.Name
|
|
|
|
|
});
|
2014-11-14 19:31:03 -07:00
|
|
|
|
|
|
|
|
|
logUrl += "&api_key=" + apiClient.accessToken();
|
|
|
|
|
|
2014-07-03 19:22:57 -07:00
|
|
|
|
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
|
|
|
|
|
2015-05-22 12:16:14 -07:00
|
|
|
|
text += ' ' + LibraryBrowser.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
|
|
|
|
|
2015-06-29 13:38:15 -07:00
|
|
|
|
Events.trigger($('.serverLogs', page).html(html)[0], '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
|
|
|
|
})();
|