diff --git a/admin-ui-styles/src/main/resources/META-INF/resources/admin-ui/css/admin-console.css b/admin-ui-styles/src/main/resources/META-INF/resources/admin-ui/css/admin-console.css index 8f42e66463..6d30cdf331 100644 --- a/admin-ui-styles/src/main/resources/META-INF/resources/admin-ui/css/admin-console.css +++ b/admin-ui-styles/src/main/resources/META-INF/resources/admin-ui/css/admin-console.css @@ -94,6 +94,24 @@ body { margin-left: -2.27272727272727em; padding-top: 2.90909090909091em; } +.error-container { + width: 54em; + margin-top: 6em; + margin-left: 8em; +} +.error-container h2 { + text-transform: uppercase; + font-size: 2.3em; + font-family: Overpass, sans-serif; + margin-bottom: 1.52173913043478em; +} +.error-container p.instruction { + font-size: 1.3em; +} +.error-container .link-right { + float: right; + font-size: 1.3em; +} /* Header */ .header.rcue { z-index: 50; @@ -648,6 +666,7 @@ table.list tbody tr.expanded .form-actions { .header.rcue .navbar.utility .navbar-inner, .header.rcue .navbar.primary .navbar-inner { max-width: 970px; + min-width: 560px; } #container-right-bg { margin-left: 242.5px; @@ -661,13 +680,17 @@ table.list tbody tr.expanded .form-actions { } .bs-sidebar, .user .bs-sidebar { - padding-top: 1em; width: 100%; + padding-top: 0; } .bs-sidebar ul li, .user .bs-sidebar ul li { margin-left: 0; } + .bs-sidebar ul li:first-child, + .user .bs-sidebar ul li:first-child { + margin-top: 1em; + } .bs-sidebar ul li a, .user .bs-sidebar ul li a { border-width: 1px; @@ -704,8 +727,16 @@ table.list tbody tr.expanded .form-actions { #content-area { border: none; } + .bs-sidebar + #content-area { + margin-top: 0; + } #container-right-bg { border: none; width: 100%; } + .error-container { + width: inherit; + margin-right: 6em; + margin-left: 6em; + } } diff --git a/admin-ui-styles/src/main/resources/META-INF/resources/admin-ui/css/admin-console.less b/admin-ui-styles/src/main/resources/META-INF/resources/admin-ui/css/admin-console.less index 527e707bf3..1f49e268a3 100644 --- a/admin-ui-styles/src/main/resources/META-INF/resources/admin-ui/css/admin-console.less +++ b/admin-ui-styles/src/main/resources/META-INF/resources/admin-ui/css/admin-console.less @@ -117,6 +117,28 @@ body { } } +.error-container { + width: 54em; + margin-top: 6em; + margin-left: 8em; + + h2 { + text-transform: uppercase; + font-size: 2.3em; + font-family: Overpass, sans-serif; + margin-bottom: 1.52173913043478em; + } + + p.instruction { + font-size: 1.3em; + } + + .link-right { + float: right; + font-size: 1.3em; + } +} + /* Header */ @@ -808,6 +830,7 @@ table.list { .navbar.utility .navbar-inner, .navbar.primary .navbar-inner { max-width: 970px; + min-width: 560px; } } @@ -829,13 +852,17 @@ table.list { .bs-sidebar, .user .bs-sidebar { - padding-top: 1em; width: 100%; + padding-top: 0; ul li { margin-left: 0; + &:first-child { + margin-top: 1em; + } + a { border-width: 1px; padding-left: 1.53846153846154em; @@ -889,8 +916,18 @@ table.list { border: none; } + .bs-sidebar + #content-area { + margin-top: 0; + } + #container-right-bg { border: none; width: 100%; } + + .error-container { + width: inherit; + margin-right: 6em; + margin-left: 6em; + } } diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js b/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js index c261b4836c..f0e6ddde66 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js +++ b/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js @@ -253,7 +253,18 @@ module.config([ '$routeProvider', function($routeProvider) { }, controller : 'ApplicationScopeMappingCtrl' }) - + .when('/realms/:realm/applications/:application/installation', { + templateUrl : 'partials/application-installation.html', + resolve : { + realm : function(RealmLoader) { + return RealmLoader(); + }, + installation : function(ApplicationInstallationLoader) { + return ApplicationInstallationLoader(); + } + }, + controller : 'ApplicationInstallationCtrl' + }) .when('/create/application/:realm', { templateUrl : 'partials/application-detail.html', resolve : { @@ -502,8 +513,8 @@ module.directive('onoffswitch', function() { offText: '@offText' }, compile: function(element, attrs) { - if (!attrs.onText) { attrs.onText = "YES"; } - if (!attrs.offText) { attrs.offText = "NO"; } + if (!attrs.onText) { attrs.onText = "ON"; } + if (!attrs.offText) { attrs.offText = "OFF"; } var html = "
" + "" + diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/applications.js b/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/applications.js index c04d81fb96..ed435eeff1 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/applications.js +++ b/admin-ui/src/main/resources/META-INF/resources/admin/js/controllers/applications.js @@ -179,6 +179,12 @@ module.controller('ApplicationListCtrl', function($scope, realm, applications, A }); }); +module.controller('ApplicationInstallationCtrl', function($scope, realm, installation, ApplicationInstallation, $routeParams) { + $scope.realm = realm; + $scope.installation = installation; + $scope.download = ApplicationInstallation.url({ realm: $routeParams.realm, application: $routeParams.application }); +}); + module.controller('ApplicationDetailCtrl', function($scope, realm, application, Application, $location, Dialog, Notifications) { console.log('ApplicationDetailCtrl'); diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/js/loaders.js b/admin-ui/src/main/resources/META-INF/resources/admin/js/loaders.js index cf1b57eabc..7b72c48504 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/js/loaders.js +++ b/admin-ui/src/main/resources/META-INF/resources/admin/js/loaders.js @@ -87,6 +87,15 @@ module.factory('ApplicationRoleLoader', function(Loader, ApplicationRole, $route }); }); +module.factory('ApplicationInstallationLoader', function(Loader, ApplicationInstallation, $route, $q) { + return Loader.get(ApplicationInstallation, function() { + return { + realm : $route.current.params.realm, + application : $route.current.params.application + } + }); +}); + module.factory('ApplicationRoleListLoader', function(Loader, ApplicationRole, $route, $q) { return Loader.query(ApplicationRole, function() { return { diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/js/services.js b/admin-ui/src/main/resources/META-INF/resources/admin/js/services.js index b692c30051..88d4ec3713 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/js/services.js +++ b/admin-ui/src/main/resources/META-INF/resources/admin/js/services.js @@ -15,9 +15,16 @@ module.service('Auth', function() { module.service('Dialog', function($dialog) { var dialog = {}; + + var escapeHtml = function(str) { + var div = document.createElement('div'); + div.appendChild(document.createTextNode(str)); + return div.innerHTML; + }; + dialog.confirmDelete = function(name, type, success) { - var title = 'Delete ' + type.charAt(0).toUpperCase() + type.slice(1); - var msg = 'Are you sure you want to permanently delete the ' + type + ' "' + name + '"?' + + var title = 'Delete ' + escapeHtml(type.charAt(0).toUpperCase() + type.slice(1)); + var msg = 'Are you sure you want to permanently delete the ' + escapeHtml(type) + ' "' + escapeHtml(name) + '"?' + 'This action can\'t be undone.'; var btns = [ { result : 'cancel', @@ -202,6 +209,22 @@ module.factory('Application', function($resource) { }); }); +module.factory('ApplicationInstallation', function($resource) { + var url = '/auth-server/rest/saas/admin/realms/:realm/applications/:application/installation'; + var resource = $resource('/auth-server/rest/saas/admin/realms/:realm/applications/:application/installation', { + realm : '@realm', + application : '@application' + }, { + update : { + method : 'PUT' + } + }); + resource.url = function(parameters) { + return url.replace(':realm', parameters.realm).replace(':application', parameters.application); + } + return resource; +}); + module.factory('ApplicationCredentials', function($resource) { return $resource('/auth-server/rest/saas/admin/realms/:realm/applications/:application/credentials', { realm : '@realm', diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/application-credentials.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/application-credentials.html index 0f46176ff8..fd7bb6d199 100755 --- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/application-credentials.html +++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/application-credentials.html @@ -6,7 +6,7 @@