Shorten app ids in eventlog

This commit is contained in:
Johannes Zellner
2018-02-19 01:56:09 -08:00
parent c9d3907124
commit 64b8e4ad6c
2 changed files with 11 additions and 7 deletions

View File

@@ -311,14 +311,18 @@ app.filter('eventLogDetails', function() {
var data = eventLog.data;
var errorMessage = data.errorMessage;
function shortenId(id) {
return id.slice(0, 8) + '...';
}
switch (eventLog.action) {
case ACTION_ACTIVATE: return 'Cloudron activated';
case ACTION_APP_CONFIGURE: return 'App ' + data.appId + ' was configured';
case ACTION_APP_INSTALL: return 'App ' + data.manifest.id + '@' + data.manifest.version + ' installed at ' + data.location + ' with id ' + data.appId;
case ACTION_APP_RESTORE: return 'App ' + data.appId + ' restored';
case ACTION_APP_UNINSTALL: return 'App ' + data.appId + ' uninstalled';
case ACTION_APP_UPDATE: return 'App ' + data.appId + ' updated to version ' + data.toManifest.id + '@' + data.toManifest.version;
case ACTION_APP_LOGIN: return 'App ' + data.appId + ' logged in';
case ACTION_APP_CONFIGURE: return 'App ' + shortenId(data.appId) + ' was configured';
case ACTION_APP_INSTALL: return 'App ' + data.manifest.id + '@' + data.manifest.version + ' installed at ' + data.location + '.' + data.domain + ' with id ' + shortenId(data.appId);
case ACTION_APP_RESTORE: return 'App ' + shortenId(data.appId) + ' restored';
case ACTION_APP_UNINSTALL: return 'App ' + shortenId(data.appId) + ' uninstalled';
case ACTION_APP_UPDATE: return 'App ' + shortenId(data.appId) + ' updated to version ' + data.toManifest.id + '@' + data.toManifest.version;
case ACTION_APP_LOGIN: return 'App ' + shortenId(data.appId) + ' logged in';
case ACTION_BACKUP_START: return 'Backup started';
case ACTION_BACKUP_FINISH: return 'Backup finished. ' + (errorMessage ? ('error: ' + errorMessage) : ('id: ' + data.filename));
case ACTION_BACKUP_CLEANUP: return 'Backup ' + data.backup.id + ' removed';