diff --git a/webadmin/src/js/index.js b/webadmin/src/js/index.js index 0c966a89b..f89462089 100644 --- a/webadmin/src/js/index.js +++ b/webadmin/src/js/index.js @@ -335,24 +335,58 @@ app.filter('eventLogDetails', function() { var errorMessage = data.errorMessage; switch (eventLog.action) { - case ACTION_ACTIVATE: return ''; - case ACTION_APP_CONFIGURE: - case ACTION_APP_INSTALL: - case ACTION_APP_RESTORE: - case ACTION_APP_UNINSTALL: return (data.app ? ('' + data.app.manifest.title + ' at ' + (data.app.fqdn || data.app.location) + '') : ''); - case ACTION_APP_UPDATE: return (data.app ? ('' + data.app.manifest.title + ' at ' + (data.app.fqdn || data.app.location) + '') : '') + ' to version ' + data.toManifest.id + '@' + data.toManifest.version + ''; - case ACTION_APP_LOGIN: return 'App ' + data.appId + ' logged in'; - case ACTION_BACKUP_START: return 'Backup started'; - case ACTION_BACKUP_FINISH: return 'Backup finished' + (errorMessage ? (' error: ' + errorMessage) : ''); - case ACTION_BACKUP_CLEANUP: return 'Backup ' + data.backup.id + ' removed'; - case ACTION_CERTIFICATE_RENEWAL: return 'Certificate renewal for ' + data.domain + (errorMessage ? ' failed' : ' succeeded'); - case ACTION_START: return 'Cloudron started with version ' + data.version; - case ACTION_UPDATE: return 'Updating to version ' + data.boxUpdateInfo.version; - case ACTION_USER_ADD: return data.email + (data.user.username ? ' as ' + data.user.username + '' : ''); - case ACTION_USER_UPDATE: - case ACTION_USER_REMOVE: - case ACTION_USER_LOGIN: return data.user ? (data.user.email + (data.user.username ? ' as ' + data.user.username + '' : '')) : data.userId; - default: return eventLog.action; + case ACTION_ACTIVATE: + return 'Cloudron was activated'; + + case ACTION_APP_CONFIGURE: + return (data.app ? (data.app.manifest.title + ' was re-configured at ' + (data.app.fqdn || data.app.location)) : ''); + + case ACTION_APP_INSTALL: + return (data.app ? (data.app.manifest.title + ' was installed at ' + (data.app.fqdn || data.app.location)) : ''); + + case ACTION_APP_RESTORE: + return (data.app ? (data.app.manifest.title + ' was restored at ' + (data.app.fqdn || data.app.location)) : ''); + + case ACTION_APP_UNINSTALL: + return (data.app ? (data.app.manifest.title + ' was uninstalled at ' + (data.app.fqdn || data.app.location)) : ''); + + case ACTION_APP_UPDATE: + return (data.app ? (data.app.manifest.title + ' at ' + (data.app.fqdn || data.app.location)) : '') + ' was updated to version ' + data.toManifest.id + '@' + data.toManifest.version; + + case ACTION_APP_LOGIN: + return 'App ' + data.appId + ' logged in'; + + case ACTION_BACKUP_START: + return 'Backup started'; + + case ACTION_BACKUP_FINISH: + return 'Backup finished' + (errorMessage ? (' error: ' + errorMessage) : ''); + + case ACTION_BACKUP_CLEANUP: + return 'Backup ' + data.backup.id + ' removed'; + + case ACTION_CERTIFICATE_RENEWAL: + return 'Certificate renewal for ' + data.domain + (errorMessage ? ' failed' : ' succeeded'); + + case ACTION_START: + return 'Cloudron started with version ' + data.version; + + case ACTION_UPDATE: + return 'Cloudron was updated to version ' + data.boxUpdateInfo.version; + + case ACTION_USER_ADD: + return data.email + (data.user.username ? ' (' + data.user.username + ')' : '') + ' was added'; + + case ACTION_USER_UPDATE: + return (data.user ? (data.user.email + (data.user.username ? ' (' + data.user.username + ')' : '')) : data.userId) + ' was updated'; + + case ACTION_USER_REMOVE: + return (data.user ? (data.user.email + (data.user.username ? ' (' + data.user.username + ')' : '')) : data.userId) + ' was removed'; + + case ACTION_USER_LOGIN: + return (data.user ? (data.user.email + (data.user.username ? ' (' + data.user.username + ')' : '')) : data.userId) + ' logged in'; + + default: return eventLog.action; } }; }); @@ -365,24 +399,24 @@ app.filter('eventLogAction', function() { var errorMessage = data.errorMessage; switch (eventLog.action) { - case ACTION_ACTIVATE: return 'Cloudron activated'; - case ACTION_APP_CONFIGURE: return 'App configured'; - case ACTION_APP_INSTALL: return 'App installed'; - case ACTION_APP_RESTORE: return 'App restored'; - case ACTION_APP_UNINSTALL: return 'App uninstalled'; - case ACTION_APP_UPDATE: return 'App updated'; - case ACTION_APP_LOGIN: return 'App login'; - case ACTION_BACKUP_START: return 'Backup started'; - case ACTION_BACKUP_FINISH: return 'Backup finished'; - case ACTION_BACKUP_CLEANUP: return 'Backup removed'; - case ACTION_CERTIFICATE_RENEWAL: return 'Certificate renewal'; - case ACTION_START: return 'Cloudron started'; - case ACTION_UPDATE: return 'Platform updated'; - case ACTION_USER_ADD: return 'User added'; - case ACTION_USER_LOGIN: return 'User login'; - case ACTION_USER_REMOVE: return 'User removed'; - case ACTION_USER_UPDATE: return 'User updated'; - default: return eventLog.action; + case ACTION_ACTIVATE: return 'Cloudron activated'; + case ACTION_APP_CONFIGURE: return 'App configured'; + case ACTION_APP_INSTALL: return 'App installed'; + case ACTION_APP_RESTORE: return 'App restored'; + case ACTION_APP_UNINSTALL: return 'App uninstalled'; + case ACTION_APP_UPDATE: return 'App updated'; + case ACTION_APP_LOGIN: return 'App login'; + case ACTION_BACKUP_START: return 'Backup started'; + case ACTION_BACKUP_FINISH: return 'Backup finished'; + case ACTION_BACKUP_CLEANUP: return 'Backup removed'; + case ACTION_CERTIFICATE_RENEWAL: return 'Certificate renewal'; + case ACTION_START: return 'Cloudron started'; + case ACTION_UPDATE: return 'Platform updated'; + case ACTION_USER_ADD: return 'User added'; + case ACTION_USER_LOGIN: return 'User login'; + case ACTION_USER_REMOVE: return 'User removed'; + case ACTION_USER_UPDATE: return 'User updated'; + default: return eventLog.action; } }; }); diff --git a/webadmin/src/views/activity.html b/webadmin/src/views/activity.html index 1170a9d5a..a4cfac372 100644 --- a/webadmin/src/views/activity.html +++ b/webadmin/src/views/activity.html @@ -30,15 +30,13 @@ Time - Event Source - Details + Details {{ eventLog.creationTime | prettyDate }} - {{ eventLog | eventLogAction }} {{ eventLog | eventLogSource }}