mirror of
https://github.com/sismics/docs.git
synced 2024-12-22 11:23:48 +01:00
Display server logs
This commit is contained in:
parent
c0e7e34373
commit
f5871e89e2
@ -1,3 +1,2 @@
|
||||
- Display logs (client)
|
||||
- Tag stats (client/server)
|
||||
- Users administration (client)
|
@ -175,6 +175,14 @@ public class FileResource extends BaseResource {
|
||||
ValidationUtil.validateRequired(documentId, "id");
|
||||
ValidationUtil.validateRequired(idList, "order");
|
||||
|
||||
// Get the document
|
||||
DocumentDao documentDao = new DocumentDao();
|
||||
try {
|
||||
documentDao.getDocument(documentId, principal.getId());
|
||||
} catch (NoResultException e) {
|
||||
throw new ClientException("DocumentNotFound", MessageFormat.format("Document not found: {0}", documentId));
|
||||
}
|
||||
|
||||
// Reorder files
|
||||
FileDao fileDao = new FileDao();
|
||||
for (File file : fileDao.getByDocumentId(documentId)) {
|
||||
|
@ -41,6 +41,7 @@
|
||||
<script src="js/controller/SettingsDefault.js" type="text/javascript"></script>
|
||||
<script src="js/controller/SettingsAccount.js" type="text/javascript"></script>
|
||||
<script src="js/controller/SettingsSession.js" type="text/javascript"></script>
|
||||
<script src="js/controller/SettingsLog.js" type="text/javascript"></script>
|
||||
<script src="js/service/User.js" type="text/javascript"></script>
|
||||
<script src="js/service/Tag.js" type="text/javascript"></script>
|
||||
<script src="js/filter/Newline.js" type="text/javascript"></script>
|
||||
|
@ -66,6 +66,15 @@ var App = angular.module('docs', ['ui.state', 'ui.bootstrap', 'ui.route', 'ui.ke
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('settings.log', {
|
||||
url: '/log',
|
||||
views: {
|
||||
'settings': {
|
||||
templateUrl: 'partial/settings.log.html',
|
||||
controller: 'SettingsLog'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('document', {
|
||||
url: '/document',
|
||||
abstract: true,
|
||||
|
12
docs-web/src/main/webapp/js/controller/SettingsLog.js
Normal file
12
docs-web/src/main/webapp/js/controller/SettingsLog.js
Normal file
@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Settings logs controller.
|
||||
*/
|
||||
App.controller('SettingsLog', function($scope, Restangular) {
|
||||
Restangular.one('app/log').get({
|
||||
limit: 100
|
||||
}).then(function(data) {
|
||||
$scope.logs = data.logs;
|
||||
});
|
||||
});
|
@ -5,6 +5,9 @@
|
||||
<li class="nav-header">Personal settings</li>
|
||||
<li ng-class="{active: $uiRoute}" ui-route="/settings/account"><a href="#/settings/account">User account</a></li>
|
||||
<li ng-class="{active: $uiRoute}" ui-route="/settings/session"><a href="#/settings/session">Opened sessions</a></li>
|
||||
|
||||
<li class="nav-header">General settings</li>
|
||||
<li ng-class="{active: $uiRoute}" ui-route="/settings/log"><a href="#/settings/log">Server logs</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
18
docs-web/src/main/webapp/partial/settings.log.html
Normal file
18
docs-web/src/main/webapp/partial/settings.log.html
Normal file
@ -0,0 +1,18 @@
|
||||
<h1>Server <small>logs</small></h1>
|
||||
<table class="table table-striped table-hover table-logs">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Tag</th>
|
||||
<th>Message</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="log in logs"
|
||||
ng-class="{ info: log.level == 'INFO' || log.level == 'DEBUG', warn: log.level == 'WARN', error: log.level == 'ERROR' || log.level == 'FATAL' }">
|
||||
<td>{{ log.date | date: 'yyyy-MM-dd HH:mm' }}</td>
|
||||
<td>{{ log.tag }}</td>
|
||||
<td>{{ log.message }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
@ -10,6 +10,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Logs list
|
||||
.table-logs {
|
||||
tbody tr td {
|
||||
&:first-child {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// File thumbnails
|
||||
.thumbnail-file {
|
||||
cursor: pointer;
|
||||
|
Loading…
Reference in New Issue
Block a user