Minor fixes and tweaks to admin console

This commit is contained in:
Stian Thorgersen 2014-02-13 13:18:49 +00:00
parent ad98bdc59c
commit 2ce0a06b51
29 changed files with 276 additions and 265 deletions

View file

@ -105,9 +105,23 @@ html, body, body > .container, #view, #content-area{
display: block;
}
p.subtitle {
position: absolute;
right: 2.5em;
.fieldset-notice {
color: #B7B7B7;
font-size: 1.1em;
float: right;
margin-top: -2em;
}
th.kc-table-actions {
line-height: 1em !important;
}
.action-div {
padding-top: 3px;
}
.required {
color: #CB2915;
}
#content-area {
@ -244,6 +258,7 @@ header .navbar {
}
.bs-sidebar ul {
list-style: none;
padding-left: 10px;
}
.bs-sidebar ul li {
@ -380,6 +395,10 @@ header .navbar {
color: #a1a1a1;
}
fieldset {
padding-bottom: 1em;
}
/* Legend stuff */
legend {
border-color: #E9E8E8;
@ -389,7 +408,7 @@ legend {
display: block;
font-size: 1em;
margin-bottom: 0;
padding-bottom: 2em;
padding-bottom: 1em;
padding-top: 2em;
}
@ -647,7 +666,7 @@ legend .kc-icon-collapse {
float: left;
font-weight: bold;
margin-right: 0.909091em;
padding-top: 0.454545em;
padding-top: 3px;
}
.kc-link-input-file {
display: inline-block;
@ -690,7 +709,7 @@ legend .kc-icon-collapse {
z-index: 100;
}
.alert {
.feedback-aligner .alert {
background-position: 1.27273em center;
background-repeat: no-repeat;
border-radius: 2px;
@ -704,24 +723,27 @@ legend .kc-icon-collapse {
position: relative;
text-align: left;
}
.alert.alert-success {
.feedback-aligner .alert.alert-success {
background-color: #E4F1E1;
--background-image: url("img/feedback-success-sign.png");
border-color: #4B9E39;
}
.alert.alert-danger {
.feedback-aligner .alert.alert-danger {
background-color: #F8E7E7;
--background-image: url("img/feedback-error-sign.png");
border-color: #B91415;
}
.alert.alert-warning {
.feedback-aligner .alert.alert-warning {
background-color: #FEF1E9;
--background-image: url("img/feedback-warning-sign.png");
border-color: #F17528;
}
.alert.alert-info {
.feedback-aligner .alert.alert-info {
background-color: #E4F3FA;
--background-image: url("img/feedback-info-sign.png");
border-color: #5994B2;
}
.modal-header h3 {
margin-top: 9.5px;
}
.modal-footer {
margin-top: 0;
}

View file

@ -62,7 +62,7 @@ table tbody tr td:first-child {
}
*/
table thead tr th:last-child {
border-right: none;
/*border-right: none;*/
}
table thead tr th button,
table thead tr th .button {
@ -74,7 +74,7 @@ table tbody tr:first-child td {
}
table tbody tr td:last-child {
border-right: none;
/* border-right: none;*/
}
/*
table tbody tr:hover {

View file

@ -191,9 +191,7 @@ module.controller('ApplicationDetailCtrl', function($scope, realm, application,
});
$scope.$watch('application', function() {
console.log('watch application');
if (!angular.equals($scope.application, application)) {
console.log('application changed');
$scope.changed = true;
}
}, true);
@ -228,7 +226,7 @@ module.controller('ApplicationDetailCtrl', function($scope, realm, application,
} else {
Application.update({
realm : realm.realm,
id : application.name
application : application.name
}, $scope.application, function() {
$scope.changed = false;
application = angular.copy($scope.application);
@ -250,7 +248,7 @@ module.controller('ApplicationDetailCtrl', function($scope, realm, application,
Dialog.confirmDelete($scope.application.name, 'application', function() {
$scope.application.$remove({
realm : realm.realm,
id : $scope.application.name
application : $scope.application.name
}, function() {
$location.url("/realms/" + realm.realm + "/applications");
Notifications.success("The application has been deleted.");
@ -354,25 +352,29 @@ module.controller('ApplicationScopeMappingCtrl', function($scope, $http, realm,
$scope.changeApplication = function() {
$scope.applicationRoles = ApplicationRole.query({realm : realm.realm, application : $scope.targetApp.name}, function() {
$scope.applicationMappings = ApplicationApplicationScopeMapping.query({realm : realm.realm, application : application.name, targetApp : $scope.targetApp.name}, function(){
for (var i = 0; i < $scope.applicationMappings.length; i++) {
var role = $scope.applicationMappings[i];
for (var j = 0; j < $scope.applicationRoles.length; j++) {
var realmRole = $scope.applicationRoles[j];
if (realmRole.id == role.id) {
var idx = $scope.applicationRoles.indexOf(realmRole);
if (idx != -1) {
$scope.applicationRoles.splice(idx, 1);
break;
if ($scope.targetApp) {
$scope.applicationRoles = ApplicationRole.query({realm : realm.realm, application : $scope.targetApp.name}, function() {
$scope.applicationMappings = ApplicationApplicationScopeMapping.query({realm : realm.realm, application : application.name, targetApp : $scope.targetApp.name}, function(){
for (var i = 0; i < $scope.applicationMappings.length; i++) {
var role = $scope.applicationMappings[i];
for (var j = 0; j < $scope.applicationRoles.length; j++) {
var realmRole = $scope.applicationRoles[j];
if (realmRole.id == role.id) {
var idx = $scope.applicationRoles.indexOf(realmRole);
if (idx != -1) {
$scope.applicationRoles.splice(idx, 1);
break;
}
}
}
}
}
});
});
}
);
}
);
} else {
$scope.applicationRoles = null;
}
};

View file

@ -270,25 +270,29 @@ module.controller('OAuthClientScopeMappingCtrl', function($scope, $http, realm,
$scope.changeApplication = function() {
$scope.applicationRoles = ApplicationRole.query({realm : realm.realm, application : $scope.targetApp.name}, function() {
$scope.applicationMappings = OAuthClientApplicationScopeMapping.query({realm : realm.realm, oauth : oauth.id, targetApp : $scope.targetApp.name}, function(){
for (var i = 0; i < $scope.applicationMappings.length; i++) {
var role = $scope.applicationMappings[i];
for (var j = 0; j < $scope.applicationRoles.length; j++) {
var realmRole = $scope.applicationRoles[j];
if (realmRole.id == role.id) {
var idx = $scope.applicationRoles.indexOf(realmRole);
if (idx != -1) {
$scope.applicationRoles.splice(idx, 1);
break;
if ($scope.targetApp) {
$scope.applicationRoles = ApplicationRole.query({realm : realm.realm, application : $scope.targetApp.name}, function() {
$scope.applicationMappings = OAuthClientApplicationScopeMapping.query({realm : realm.realm, oauth : oauth.id, targetApp : $scope.targetApp.name}, function(){
for (var i = 0; i < $scope.applicationMappings.length; i++) {
var role = $scope.applicationMappings[i];
for (var j = 0; j < $scope.applicationRoles.length; j++) {
var realmRole = $scope.applicationRoles[j];
if (realmRole.id == role.id) {
var idx = $scope.applicationRoles.indexOf(realmRole);
if (idx != -1) {
$scope.applicationRoles.splice(idx, 1);
break;
}
}
}
}
}
});
});
}
);
}
);
} else {
$scope.targetApp = null;
}
};

View file

@ -65,6 +65,8 @@ module.controller('RealmDropdownCtrl', function($scope, Realm, Current, Auth, $l
module.controller('RealmCreateCtrl', function($scope, Current, Realm, $upload, $http, $location, Dialog, Notifications) {
console.log('RealmCreateCtrl');
Current.realm = null;
$scope.realm = {
enabled: true
};
@ -78,9 +80,8 @@ module.controller('RealmCreateCtrl', function($scope, Current, Realm, $upload, $
$scope.files = $files;
};
$scope.changeFileSelect = function() {
$scope.clearFileSelect = function() {
$scope.files = null;
document.getElementById('import-file').click();
}
$scope.uploadFile = function() {
@ -402,21 +403,25 @@ module.controller('RealmDefaultRolesCtrl', function ($scope, Realm, realm, appli
$scope.selectedAppDefRoles = [];
// Populate available roles for selected application
var appDefaultRoles = ApplicationRole.query({realm: $scope.realm.realm, application: $scope.application.name}, function () {
if ($scope.application) {
var appDefaultRoles = ApplicationRole.query({realm: $scope.realm.realm, application: $scope.application.name}, function () {
if (!$scope.application.hasOwnProperty('defaultRoles') || $scope.application.defaultRoles === null) {
$scope.application.defaultRoles = [];
}
$scope.availableAppRoles = [];
for (var i = 0; i < appDefaultRoles.length; i++) {
var roleName = appDefaultRoles[i].name;
if ($scope.application.defaultRoles.indexOf(roleName) < 0) {
$scope.availableAppRoles.push(roleName);
if (!$scope.application.hasOwnProperty('defaultRoles') || $scope.application.defaultRoles === null) {
$scope.application.defaultRoles = [];
}
}
});
$scope.availableAppRoles = [];
for (var i = 0; i < appDefaultRoles.length; i++) {
var roleName = appDefaultRoles[i].name;
if ($scope.application.defaultRoles.indexOf(roleName) < 0) {
$scope.availableAppRoles.push(roleName);
}
}
});
} else {
$scope.availableAppRoles = null;
}
};
$scope.addAppDefaultRole = function () {
@ -536,7 +541,7 @@ module.controller('RealmSocialCtrl', function($scope, realm, Realm, serverInfo,
module.controller('RealmTokenDetailCtrl', function($scope, Realm, realm, $http, $location, Dialog, Notifications, TimeUnit) {
console.log('RealmTokenDetailCtrl');
$scope.realm = { id : realm.id, realm : realm.realm, social : realm.social, registrationAllowed : realm.registrationAllowed };
$scope.realm = realm;
$scope.realm.tokenLifespanUnit = TimeUnit.autoUnit(realm.tokenLifespan);
$scope.realm.tokenLifespan = TimeUnit.toUnit(realm.tokenLifespan, $scope.realm.tokenLifespanUnit);
@ -673,9 +678,10 @@ module.controller('RealmSMTPSettingsCtrl', function($scope, Current, Realm, real
var booleanSmtpAtts = ["auth","ssl","starttls"];
$scope.realm = {
id : realm.id, realm : realm.realm, social : realm.social, registrationAllowed : realm.registrationAllowed,
smtpServer: typeObject(realm.smtpServer)
$scope.realm = realm;
if ($scope.realm.smtpServer) {
$scope.realm.smtpServer = typeObject($scope.realm.smtpServer);
};
var oldCopy = angular.copy($scope.realm);

View file

@ -89,25 +89,29 @@ module.controller('UserRoleMappingCtrl', function($scope, $http, realm, user, ro
$scope.changeApplication = function() {
$scope.applicationRoles = ApplicationRole.query({realm : realm.realm, userId : user.username, application : $scope.application.name}, function() {
$scope.applicationMappings = ApplicationRoleMapping.query({realm : realm.realm, userId : user.username, application : $scope.application.name}, function(){
for (var i = 0; i < $scope.applicationMappings.length; i++) {
var role = $scope.applicationMappings[i];
for (var j = 0; j < $scope.applicationRoles.length; j++) {
var realmRole = $scope.applicationRoles[j];
if (realmRole.id == role.id) {
var idx = $scope.applicationRoles.indexOf(realmRole);
if (idx != -1) {
$scope.applicationRoles.splice(idx, 1);
break;
if ($scope.application) {
$scope.applicationRoles = ApplicationRole.query({realm : realm.realm, userId : user.username, application : $scope.application.name}, function() {
$scope.applicationMappings = ApplicationRoleMapping.query({realm : realm.realm, userId : user.username, application : $scope.application.name}, function(){
for (var i = 0; i < $scope.applicationMappings.length; i++) {
var role = $scope.applicationMappings[i];
for (var j = 0; j < $scope.applicationRoles.length; j++) {
var realmRole = $scope.applicationRoles[j];
if (realmRole.id == role.id) {
var idx = $scope.applicationRoles.indexOf(realmRole);
if (idx != -1) {
$scope.applicationRoles.splice(idx, 1);
break;
}
}
}
}
}
});
});
}
);
}
);
} else {
$scope.applicationRoles = null;
}
};

View file

@ -13,8 +13,7 @@ module.service('Dialog', function($dialog) {
dialog.confirmDelete = function(name, type, success) {
var title = 'Delete ' + escapeHtml(type.charAt(0).toUpperCase() + type.slice(1));
var msg = '<span class="primary">Are you sure you want to permanently delete the ' + escapeHtml(type) + ' "' + escapeHtml(name) + '"?</span>' +
'<span>This action can\'t be undone.</span>';
var msg = '<span class="primary">Are you sure you want to permanently delete the ' + escapeHtml(type) + ' <strong>' + escapeHtml(name) + '</strong>?</span>';
var btns = [ {
result : 'cancel',
label : 'Cancel',
@ -34,8 +33,7 @@ module.service('Dialog', function($dialog) {
dialog.confirmGenerateKeys = function(name, type, success) {
var title = 'Generate new keys for realm';
var msg = '<span class="primary">Are you sure you want to permanently generate new keys for ' + name + '"?</span>' +
'<span>This action can\'t be undone.</span>';
var msg = '<span class="primary">Are you sure you want to permanently generate new keys for <strong>' + name + '</strong>?</span>';
var btns = [ {
result : 'cancel',
label : 'Cancel',
@ -55,8 +53,7 @@ module.service('Dialog', function($dialog) {
dialog.confirm = function(title, message, success, cancel) {
var title = title;
var msg = '<span class="primary">' + message + '"</span>' +
'<span>This action can\'t be undone.</span>';
var msg = '<span class="primary">' + message + '"</span>';
var btns = [ {
result : 'cancel',
label : 'Cancel',
@ -458,7 +455,7 @@ module.factory('ApplicationRole', function($resource) {
module.factory('Application', function($resource) {
return $resource('/auth/rest/admin/realms/:realm/applications/:application', {
realm : '@realm',
application : '@name'
application : '@application'
}, {
update : {
method : 'PUT'
@ -611,7 +608,7 @@ module.factory('TimeUnit', function() {
switch (unit) {
case 'Seconds': return time;
case 'Minutes': return time * 60;
case 'Hours': return time * 360;
case 'Hours': return time * 3600;
case 'Days': return time * 86400;
default: throw 'invalid unit ' + unit;
}
@ -621,7 +618,7 @@ module.factory('TimeUnit', function() {
switch (unit) {
case 'Seconds': return time;
case 'Minutes': return Math.ceil(time / 60);
case 'Hours': return Math.ceil(time / 360);
case 'Hours': return Math.ceil(time / 3600);
case 'Days': return Math.ceil(time / 86400);
default: throw 'invalid unit ' + unit;
}

View file

@ -18,7 +18,7 @@
<h2 data-ng-hide="create"><span>{{application.name}}</span> Credentials</h2>
<form class="form-horizontal" name="credentialForm" novalidate>
<fieldset data-ng-show="passwordRequired">
<legend uncollapsed><span class="text">Change Password</span></legend>
<legend><span class="text">Change Password</span></legend>
<div class="form-group">
<label class="col-sm-2 control-label" for="password">New Password</label>
<div class="col-sm-4">

View file

@ -23,7 +23,7 @@
<li class="active">Settings</li>
</ol>
<h2 data-ng-hide="create"><span>{{application.name}}</span> Settings</h2>
<form class="form-horizontal" name="applicationForm" novalidate ng-class="{ has-error: applicationForm.$invalid }>
<form class="form-horizontal" name="applicationForm" novalidate>
<fieldset class="border-top">
<div class="form-group">
<label class="col-sm-2 control-label" for="name">Name <span class="required" data-ng-show="create">*</span></label>

View file

@ -9,10 +9,7 @@
<li class="active">Applications</li>
</ol>
<h2><span>{{realm.realm}}</span> Applications</h2>
<div class="feedback info inline" data-ng-show="!applications || applications.length == 0">
<p><strong>You have not configured applications.</strong> <a class="button" href="#/create/application/{{realm.realm}}">Add Application</a></p>
</div>
<table class="table" data-ng-hide="applications.length == 0">
<table class="table">
<thead>
<tr>
<th class="kc-table-actions" colspan="3">
@ -29,7 +26,7 @@
</div>
</th>
</tr>
<tr data-ng-show="applications.length > 0">
<tr data-ng-hide="applications.length == 0">
<th>Application Name</th>
<th>Enabled</th>
<th>Base URL</th>
@ -55,6 +52,9 @@
<a href="{{app.baseUrl}}" data-ng-show="app.baseUrl">{{app.baseUrl}}</a>
<span data-ng-hide="app.baseUrl">Not defined</span>
</tr>
<tr data-ng-show="applications.length == 0">
<td>No applications available</td>
</tr>
</tbody>
</table>
<div class="feedback warning inline" data-ng-show="search && applications.length == 0">

View file

@ -17,8 +17,6 @@
<li><a href="#/realms/{{realm.realm}}/applications/{{application.name}}/roles">Roles</a></li>
<li class="active">Add role</li>
</ol>
<h2 class="pull-left" data-ng-show="create"><span>{{application.name}}</span> Add Role</h2>
<p class="subtitle" data-ng-show="create"><span class="required">*</span> Required fields</p>
<ol class="breadcrumb" data-ng-hide="create">
<li><a href="#/realms/{{realm.realm}}">{{realm.realm}}</a></li>
@ -29,7 +27,11 @@
</ol>
<h2 data-ng-hide="create"><span>{{application.name}}</span> {{role.name}}</h2>
<h2 data-ng-show="create"><span>{{application.name}}</span> Add Role</h2>
<form class="form-horizontal" name="realmForm" novalidate>
<span class="fieldset-notice"><span class="required">*</span> Required fields</span>
<fieldset class="border-top">
<div class="form-group">
<label class="col-sm-2 control-label" for="name">Role name <span class="required" data-ng-show="create">*</span></label>
@ -56,16 +58,6 @@
</div>
</fieldset>
<div class="pull-right form-actions" data-ng-show="create">
<button kc-cancel data-ng-click="cancel()">Cancel</button>
<button kc-save data-ng-show="changed">Save</button>
</div>
<div class="pull-right form-actions" data-ng-show="!create">
<button kc-reset data-ng-show="changed">Clear changes</button>
<button kc-save data-ng-show="changed">Save</button>
<button kc-delete data-ng-click="remove()" data-ng-hide="changed">Delete</button>
</div>
<fieldset data-ng-show="!create && (compositeSwitch || role.composite)">
<legend collapsed><span class="text">Composite Realm Roles</span> </legend>
<div class="form-group col-sm-10">
@ -141,6 +133,17 @@
</div>
</div>
</fieldset>
<div class="pull-right form-actions" data-ng-show="create">
<button kc-cancel data-ng-click="cancel()">Cancel</button>
<button kc-save data-ng-show="changed">Save</button>
</div>
<div class="pull-right form-actions" data-ng-show="!create">
<button kc-reset data-ng-show="changed">Clear changes</button>
<button kc-save data-ng-show="changed">Save</button>
<button kc-delete data-ng-click="remove()" data-ng-hide="changed">Delete</button>
</div>
</form>
</div>
</div>

View file

@ -18,16 +18,12 @@
<li class="active">Roles</li>
</ol>
<h2><span>{{application.name}}</span> Roles</h2>
<div class="feedback info inline" data-ng-show="!roles || roles.length == 0">
<p><strong>You have not configured application roles.</strong> <a class="button" href="#/create/role/{{realm.realm}}/applications/{{application.name}}">Add Role</a></p>
</div>
<table class="table" data-ng-hide="!roles || roles.length == 0">
<caption data-ng-show="roles && roles.length > 0" class="hidden">Table of realm roles</caption>
<table class="table">
<thead>
<tr>
<th class="kc-table-actions" colspan="3">
<div class="pull-right">
<a class="kc-button" href="#/create/role/{{realm.realm}}/applications/{{application.name}}">Add Role</a>
<a class="btn btn-primary" href="#/create/role/{{realm.realm}}/applications/{{application.name}}">Add Role</a>
<!-- <button class="remove disabled">Remove</button> -->
</div>
</th>
@ -43,7 +39,7 @@
</div>
</th>
</tr>
<tr>
<tr data-ng-hide="!roles || roles.length == 0">
<th>Role Name</th>
<th>Composite</th>
<th>Description</th>
@ -67,6 +63,9 @@
<td>{{role.composite}}</td>
<td>{{role.description}}</td>
</tr>
<tr data-ng-show="!roles || roles.length == 0">
<td>No application roles available</td>
</tr>
</tbody>
</table>
</div>

View file

@ -21,7 +21,7 @@
<p class="subtitle"></p>
<form class="form-horizontal" name="realmForm" novalidate>
<fieldset>
<legend uncollapsed><span class="text">Realm Roles</span></legend>
<legend><span class="text">Realm Roles</span></legend>
<div class="form-group col-sm-10">
<div class="controls changing-selectors">
<div class="select-title">
@ -53,19 +53,17 @@
</fieldset>
<fieldset ng-show="applications.length > 0">
<legend collapsed><span class="text">Application Roles</span> </legend>
<div class="form-group input-select ">
<label class="col-sm-2 control-label" for="applications">Application</label>
<div class="input-group col-sm-4">
<legend><span class="text">Application Roles</span> </legend>
<div class="form-group input-select col-sm-10">
<label class="control-label" for="applications">Application</label>
<div class="input-group">
<div class="select-kc">
<select id="applications" name="applications" ng-change="changeApplication()" ng-model="targetApp" ng-options="a.name for a in (applications|remove:application:'id')">
<option value="" selected> Select an Application </option>
</select>
</div>
</div>
</div>
<div class="form-group col-sm-10" ng-show="targetApp">
<div class="controls changing-selectors application">
<div class="controls changing-selectors" ng-show="targetApp">
<div class="select-title">
<label class="control-label" for="app-available">Available Roles</label>
<select id="app-available" class="form-control" multiple size="5"

View file

@ -17,7 +17,7 @@
<h2 data-ng-hide="create"><span>{{oauth.name}}</span> Credentials</h2>
<form class="form-horizontal" name="credentialForm" novalidate>
<fieldset data-ng-show="passwordRequired">
<legend uncollapsed><span class="text">Change Password</span></legend>
<legend><span class="text">Change Password</span></legend>
<div class="form-group">
<label class="col-sm-2 control-label" for="password">New Password</label>
<div class="col-sm-4">

View file

@ -9,10 +9,7 @@
<li class="active">OAuth Clients</li>
</ol>
<h2><span>{{realm.realm}}</span> OAuth Clients</h2>
<div class="feedback info inline" data-ng-show="!oauthClients || oauthClients.length == 0">
<p><strong>You have not configured oauth clients.</strong> <a class="button" href="#/create/oauth-client/{{realm.realm}}">Add OAuth Client</a></p>
</div>
<table class="table" data-ng-hide="oauthClients.length == 0">
<table class="table">
<thead>
<tr>
<th class="kc-table-actions" colspan="3">
@ -29,7 +26,7 @@
</div>
</th>
</tr>
<tr data-ng-show="oauthClients.length > 0">
<tr data-ng-hide="oauthClients.length == 0">
<th>OAuth Client Name</th>
<th>Enabled</th>
</tr>
@ -51,6 +48,9 @@
<td><a href="#/realms/{{realm.realm}}/oauth-clients/{{client.id}}">{{client.name}}</a></td>
<td>{{client.enabled}}</td>
</tr>
<tr data-ng-show="oauthClients.length == 0">
<td>No clients available</td>
</tr>
</tbody>
</table>
<div class="feedback warning inline" data-ng-show="search && oauthClients.length == 0">

View file

@ -19,7 +19,7 @@
<p class="subtitle"></p>
<form class="form-horizontal" name="realmForm" novalidate>
<fieldset>
<legend uncollapsed><span class="text">Realm Roles</span></legend>
<legend><span class="text">Realm Roles</span></legend>
<div class="form-group col-sm-10">
<div class="controls changing-selectors">
<div class="select-title">
@ -51,19 +51,17 @@
</fieldset>
<fieldset ng-show="applications.length > 0">
<legend collapsed><span class="text">Application Roles</span> </legend>
<div class="form-group input-select">
<label class="control-label col-sm-2" for="applications">Application</label>
<div class="form-group col-sm-4">
<legend><span class="text">Application Roles</span> </legend>
<div class="form-group input-select col-sm-10">
<label class="control-label" for="applications">Application</label>
<div class="input-group">
<div class="select-kc">
<select id="applications" name="applications" ng-change="changeApplication()" ng-model="targetApp" ng-options="a.name for a in (applications)">
<option value="" selected> Select an Application </option>
</select>
</div>
</div>
</div>
<div class="form-group col-sm-10" ng-show="targetApp">
<div class="controls changing-selectors application">
<div class="controls changing-selectors" data-ng-show="targetApp">
<div class="select-title">
<label class="control-label" for="app-available">Available Roles</label>
<select id="app-available" class="form-control" multiple size="5"

View file

@ -1,12 +1,12 @@
<div class="bs-sidebar col-sm-3 " data-ng-include data-src="'partials/realm-menu.html'"></div>
<div class="bs-sidebar col-sm-3 "></div>
<div id="content-area" class="col-sm-9" role="main">
<div id="content">
<h2>Add Realm</h2>
<p class="subtitle"><span class="required">*</span> Required fields</p>
<form class="form-horizontal" name="realmForm" novalidate>
<span class="fieldset-notice"><span class="required">*</span> Required fields</span>
<fieldset>
<legend uncollapsed><span class="text">Import Realm</span></legend>
<legend><span class="text">Import Realm</span></legend>
<div class="form-group">
<label for="name" class="col-sm-2 control-label">Upload JSON File </label>
<div class="col-sm-4">
@ -14,24 +14,26 @@
<a href="#" class="kc-button"><span class="kc-icon-upload">Icon: Upload</span>Choose a JSON File...</a>
<input id="import-file" type="file" class="transparent" ng-file-select="onFileSelect($files)">
</div>
<span class="kc-uploaded-file" data-ng-show="files.length > 0">{{files[0].name}}</span>
<button class="kc-link" data-ng-show="files.length > 0" data-ng-click="changeFileSelect();">Change</button>
<span class="kc-uploaded-file" data-ng-show="files.length > 0">
{{files[0].name}}
</span>
</div>
</div>
<div class="form-actions inside">
<button type="submit" data-ng-click="uploadFile()" class="primary" data-ng-show="files.length > 0">Upload</button>
<div class="pull-right form-actions" data-ng-show="files.length > 0">
<button type="submit" data-ng-click="clearFileSelect()" class="btn btn-lg btn-default">Cancel</button>
<button type="submit" data-ng-click="uploadFile()" class="btn btn-lg btn-primary">Upload</button>
</div>
</fieldset>
</form>
<form class="form-horizontal" name="realmForm" novalidate>
<fieldset>
<legend uncollapsed><span class="text">Create Realm</span></legend>
<legend><span class="text">Create Realm</span></legend>
<div class="form-group">
<label for="name" class="col-sm-2 control-label">Name <span class="required">*</span></label>
<div class="col-sm-4">
<input type="text" id="name" name="name" data-ng-model="realm.realm" autofocusrequired>
<input class="form-control" type="text" id="name" name="name" data-ng-model="realm.realm" autofocusrequired>
</div>
</div>
<div class="form-group">

View file

@ -36,60 +36,46 @@
</fieldset>
<fieldset class="border-top">
<legend uncollapsed><span class="text">Realm Password Policy</span></legend>
<div class="form-group clearfix">
<table class="table">
<caption class="hidden">Table of Password Policies</caption>
<thead>
<tr ng-show="(allPolicies|remove:policy:'name').length > 0">
<th colspan="5" class="kc-table-actions">
<div class="pull-right">
<div class="select-kc">
<select ng-model="selectedPolicy"
ng-options="(p.name|capitalize) for p in (allPolicies|remove:policy:'name')"
data-ng-change="addPolicy(selectedPolicy); selectedPolicy = null">
<option value="" disabled selected>Add policy...</option>
</select>
</div>
<table class="table">
<caption class="hidden">Table of Password Policies</caption>
<thead>
<tr ng-show="(allPolicies|remove:policy:'name').length > 0">
<th colspan="5" class="kc-table-actions">
<div class="pull-right">
<div class="select-kc">
<select ng-model="selectedPolicy"
ng-options="(p.name|capitalize) for p in (allPolicies|remove:policy:'name')"
data-ng-change="addPolicy(selectedPolicy); selectedPolicy = null">
<option value="" disabled selected>Add policy...</option>
</select>
</div>
</th>
</tr>
<tr>
<th>Policy Type</th>
<th>Policy Value</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="p in policy">
<td>
<div class="form-group col-sm-12">
<input class="form-control disabled" type="text" value="{{p.name|capitalize}}" readonly>
</div>
</th>
</tr>
<tr>
<th>Policy Type</th>
<th>Policy Value</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="p in policy">
<td>
<div class="form-group col-sm-12">
<input class="form-control disabled" type="text" value="{{p.name|capitalize}}" readonly>
</div>
</td>
<td>
<div class="form-group col-sm-12">
<input class="form-control" ng-model="p.value" type="number" placeholder="No value assigned" min="1" max="50">
</div>
</td>
<td>
<div class="form-group col-sm-12">
<input class="form-control" ng-model="p.value" type="number" placeholder="No value assigned" min="1" max="50">
</div>
</td>
<td class="pull-right">
<div class="">
<button type="button" class="btn btn-default"
tooltip="{{policyMessages[name]}}"
tooltip-placement="left">
<span class="kc-icon-question">Question icon</span>
Help
</button>
<button type="button" class="btn btn-default"
ng-click="removePolicy($index)">
<span class="kc-icon-remove">Remove icon</span>
Remove
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
<td>
<div class="action-div"><i class="pficon pficon-delete" ng-click="removePolicy($index)"></i></div>
</td>
</tr>
</tbody>
</table>
</fieldset>
<div class="pull-right form-actions">
<button kc-reset data-ng-show="changed">Clear changes</button>

View file

@ -10,7 +10,7 @@
<h2><span>{{realm.realm}}</span> Registration Settings</h2>
<form class="form-horizontal" name="realmForm" novalidate>
<fieldset>
<legend uncollapsed><span class="text">Realm Default Roles</span> </legend>
<legend><span class="text">Realm Default Roles</span> </legend>
<div class="form-group">
<div class="controls changing-selectors col-sm-10">
<div class="select-title">
@ -42,7 +42,7 @@
</fieldset>
<fieldset ng-show="applications.length > 0">
<legend uncollapsed><span class="text">Application Default Roles</span> </legend>
<legend><span class="text">Application Default Roles</span> </legend>
<div class="form-group input-select">
<label class="col-sm-2 control-label" for="applications">Application</label>
<div class="col-sm-4">
@ -52,9 +52,7 @@
</select>
</div>
</div>
</div>
<div class="form-group" ng-show="application">
<div class="controls changing-selectors application col-sm-10">
<div class="controls changing-selectors" ng-show="application">
<div class="select-title">
<label class="control-label" for="available-app">Available Roles</label>
<select id="available-app" class="form-control" multiple size="5"

View file

@ -12,7 +12,7 @@
<p class="subtitle" data-ng-show="createRealm"><span class="required">*</span> Required fields</p>
<form class="form-horizontal" name="realmForm" novalidate>
<fieldset>
<legend uncollapsed class="aj-collapse open"><span class="text">Required Settings</span></legend>
<legend class="aj-collapse open"><span class="text">Required Settings</span></legend>
<div class="form-group">
<label class="col-sm-2 control-label" for="name">Name <span class="required" data-ng-show="createRealm">*</span></label>
@ -28,7 +28,7 @@
</div>
</fieldset>
<fieldset>
<legend uncollapsed><span class="text">Login Options</span></legend>
<legend><span class="text">Login Options</span></legend>
<div class="form-group">
<label class="col-sm-2 control-label" for="social">Social login</label>
<div class="col-sm-4">
@ -67,7 +67,7 @@
</div>
</fieldset>
<fieldset>
<legend uncollapsed><span class="text">Optional Settings</span></legend>
<legend><span class="text">Optional Settings</span></legend>
<div class="form-group">
<label class="col-sm-2 control-label" for="loginTheme">Login Theme</label>
<div class="col-sm-4">

View file

@ -8,8 +8,8 @@
<li class="active">SMTP Configuration</li>
</ol>
<h2><span>{{realm.realm}}</span> Email Server Settings</h2>
<p class="subtitle pull-right"><span class="required">*</span> Required fields</p>
<form class="form-horizontal" name="realmForm" novalidate>
<span class="fieldset-notice"><span class="required">*</span> Required fields</span>
<fieldset>
<legend uncollapsed><span class="text">Required Settings</span></legend>
<div class="form-group clearfix">

View file

@ -9,8 +9,12 @@
</ol>
<h2><span>{{realm.realm}}</span> Social Providers Settings</h2>
<div class="feedback info inline">
<p><strong>Social Callback URL:</strong> {{callbackUrl}}</p>
<div class="alert alert-info alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">
<span class="pficon pficon-close"></span>
</button>
<span class="pficon pficon-info"></span>
<strong>Social Callback URL:</strong> {{callbackUrl}}</p>
</div>
<form name="realmForm" novalidate>
@ -43,19 +47,19 @@
<tr ng-repeat="pId in configuredProviders">
<td>
<div class="clearfix">
<input class="input-small disabled" type="text" value="{{pId|capitalize}}" readonly>
<input class="form-control input-small disabled" type="text" value="{{pId|capitalize}}" readonly>
</div>
</td>
<td>
<input class="input-small" type="text" placeholder="Key" ng-model="realm.socialProviders[pId+'.key']"
<input class="form-control" type="text" placeholder="Key" ng-model="realm.socialProviders[pId+'.key']"
ng-class="{'dirty': postSaveProviders.indexOf(pId) > -1}" required>
</td>
<td>
<input class="input-small" type="text" placeholder="Secret" ng-model="realm.socialProviders[pId+'.secret']"
<input class="form-control" type="text" placeholder="Secret" ng-model="realm.socialProviders[pId+'.secret']"
ng-class="{'dirty': postSaveProviders.indexOf(pId) > -1}" required>
</td>
<td>
<div class="action-div"><i class="icon-remove" ng-click="removeProvider(pId)"></i></div>
<div class="action-div"><i class="pficon pficon-delete" ng-click="removeProvider(pId)"></i></div>
</td>
</tr>
</tbody>

View file

@ -57,16 +57,10 @@
<button kc-save data-ng-show="changed">Save</button>
</div>
<div class="pull-right form-actions" data-ng-show="!create">
<button kc-reset data-ng-show="changed">Clear changes</button>
<button kc-save data-ng-show="changed">Save</button>
<button kc-delete data-ng-click="remove()" data-ng-hide="changed">Delete</button>
</div>
<fieldset data-ng-show="!create && (compositeSwitch || role.composite)">
<legend collapsed><span class="text">Composite Realm Roles</span> </legend>
<legend uncollapsed><span class="text">Composite Realm Roles</span> </legend>
<div class="form-group">
<div class="controls changing-selectors">
<div class="controls changing-selectors col-sm-10">
<div class="select-title">
<label for="available">Available Roles</label>
<select id="available" class="form-control" multiple size="5"
@ -96,8 +90,8 @@
</fieldset>
<fieldset ng-show="applications.length > 0 && !create && (compositeSwitch || role.composite)">
<legend collapsed><span class="text">Composite Application Roles</span> </legend>
<div class="form-group input-select">
<legend uncollapsed><span class="text">Composite Application Roles</span> </legend>
<div class="form-group input-select col-sm-10">
<label for="applications">Application</label>
<div class="input-group">
<div class="select-kc">
@ -106,9 +100,7 @@
</select>
</div>
</div>
</div>
<div class="form-group" ng-show="compositeApp">
<div class="controls changing-selectors application">
<div class="controls changing-selectors" ng-show="compositeApp">
<div class="select-title">
<label class="control-label" for="available-app">Available Roles</label>
<select id="available-app" class="form-control" multiple size="5"
@ -137,6 +129,12 @@
</div>
</fieldset>
<div class="pull-right form-actions" data-ng-show="!create">
<button kc-reset data-ng-show="changed">Clear changes</button>
<button kc-save data-ng-show="changed">Save</button>
<button kc-delete data-ng-click="remove()" data-ng-hide="changed">Delete</button>
</div>
</form>
</div>
</div>

View file

@ -8,16 +8,14 @@
<li class="active">Roles</li>
</ol>
<h2><span>{{realm.realm}}</span> Roles</h2>
<div class="feedback info inline" data-ng-show="!roles || roles.length == 0">
<p><strong>You have not configured realm roles.</strong> <a class="kc-button" href="#/create/role/{{realm.realm}}">Add Role</a></p>
</div>
<div class="panel">
<table class="table" data-ng-hide="!roles || roles.length == 0">
<table class="table">
<thead>
<tr>
<th class="kc-table-actions" colspan="3">
<div class="pull-right">
<a class="kc-button" href="#/create/role/{{realm.realm}}">Add Role</a>
<a class="btn btn-primary" href="#/create/role/{{realm.realm}}">Add Role</a>
<!-- <button class="remove disabled">Remove</button> -->
</div>
</th>
@ -33,7 +31,7 @@
</div>
</th>
</tr>
<tr>
<tr data-ng-show="roles && roles.length > 0">
<th>Role Name</th>
<th>Composite</th>
<th>Description</th>
@ -57,6 +55,9 @@
<td>{{role.composite}}</td>
<td>{{role.description}}</td>
</tr>
<tr data-ng-show="!roles || roles.length == 0">
<td>No realm roles available</td>
</tr>
</tbody>
</table>
</div>

View file

@ -13,12 +13,12 @@
<li class="active">Role Mappings</li>
</ol>
<h2><span>{{user.username}}'s</span> Role Mappings</h2>
<p class="subtitle">All fields required</p>
<form class="form-horizontal" name="realmForm" novalidate>
<fieldset>
<legend uncollapsed><span class="text">Realm Roles</span> </legend>
<legend><span class="text">Realm Roles</span> </legend>
<div class="form-group">
<div class="controls changing-selectors">
<div class="controls changing-selectors col-sm-10">
<div class="select-title">
<label for="available">Available Roles</label>
<select id="available" class="form-control" multiple size="5"
@ -48,8 +48,8 @@
</fieldset>
<fieldset ng-show="applications.length > 0">
<legend collapsed><span class="text">Application Roles</span> </legend>
<div class="form-group input-select">
<legend><span class="text">Application Roles</span> </legend>
<div class="form-group input-select col-sm-10">
<label for="applications">Application</label>
<div class="input-group">
<div class="select-kc">
@ -58,9 +58,7 @@
</select>
</div>
</div>
</div>
<div class="form-group" ng-show="application">
<div class="controls changing-selectors application">
<div class="controls changing-selectors" ng-show="application">
<div class="select-title">
<label for="available-app">Available Roles</label>
<select id="available-app" class="form-control" multiple size="5"

View file

@ -16,7 +16,7 @@
<form class="form-horizontal" name="userForm" novalidate>
<fieldset class="border-top">
<legend uncollapsed><span class="text">Credential Management</span></legend>
<legend><span class="text">Credential Management</span></legend>
<div class="form-group">
<label class="col-sm-2 control-label" for="password">Reset password</label>
<div class="col-sm-4 kc-multiline">

View file

@ -14,7 +14,6 @@
<li class="active">Add</li>
</ol>
<h2 data-ng-show="create">Add User</h2>
<p class="subtitle" data-ng-show="create"><span class="required">*</span> Required fields</p>
<ol class="breadcrumb" data-ng-hide="create">
<li><a href="#/realms/{{realm.realm}}">{{realm.realm}}</a></li>
<li><a href="#/realms/{{realm.realm}}/users">Users</a></li>
@ -24,6 +23,7 @@
<h2 data-ng-hide="create"><span>{{user.username}}'s</span> Attributes</h2>
<form class="form-horizontal" name="userForm" novalidate>
<span class="fieldset-notice"><span class="required">*</span> Required fields</span>
<fieldset class="border-top">
<div class="form-group">
<label class="col-sm-2 control-label"for="username">Username <span class="required" data-ng-show="create">*</span></label>

View file

@ -58,15 +58,12 @@
<td>{{user.firstName}}</td>
<td>{{user.email}}</td>
</tr>
<tr data-ng-show="!users || users.length == 0">
<td data-ng-show="!users">Please enter a search, or click on view all users</td>
<td data-ng-show="searchLoaded && users.length == 0 && lastSearch != null">Your search returned no results</td>
<td data-ng-show="searchLoaded && users.length == 0 && lastSearch == null">No users available</td>
</tr>
</tbody>
</table>
<div class="feedback warning inline" data-ng-show="searchLoaded && users.length == 0">
<p data-ng-show="lastSearch != null"><strong>Your search returned no results.</strong><br>Try modifying the query and try again.</p>
<p data-ng-show="lastSearch == null"><strong>No users present.</strong><br>Create some using the "Add User" button.</p>
</div>
<div class="feedback info inline" data-ng-show="!users">
<br/>
<p><strong>Search for users.</strong><br>Please enter a search to display users.</p>
</div>
</div>
</div>

View file

@ -47,7 +47,6 @@ import org.keycloak.models.RealmModel;
import org.keycloak.models.UserModel;
import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.services.filters.KeycloakSessionServletFilter;
import org.keycloak.services.managers.ApplianceBootstrap;
import org.keycloak.services.managers.RealmManager;
import org.keycloak.services.resources.KeycloakApplication;
@ -222,21 +221,16 @@ public class KeycloakServer {
}
}
protected void setupDefaultRealm() {
protected void setupDevConfig() {
KeycloakSession session = factory.createSession();
session.getTransaction().begin();
try {
RealmManager manager = new RealmManager(session);
if (manager.getRealm(Constants.ADMIN_REALM) != null) {
return;
}
new ApplianceBootstrap().bootstrap(session);
// No need to require admin to change password as this server is for dev/test
manager.getRealm(Constants.ADMIN_REALM).getUser("admin").removeRequiredAction(UserModel.RequiredAction.UPDATE_PASSWORD);
RealmModel adminRealm = manager.getRealm(Constants.ADMIN_REALM);
UserModel admin = adminRealm.getUser("admin");
admin.removeRequiredAction(UserModel.RequiredAction.UPDATE_PASSWORD);
session.getTransaction().commit();
} finally {
@ -275,7 +269,7 @@ public class KeycloakServer {
factory = ((KeycloakApplication)deployment.getApplication()).getFactory();
setupDefaultRealm();
setupDevConfig();
if (config.getResourcesHome() != null) {
info("Loading resources from " + config.getResourcesHome());