commit
ab636f4af5
13 changed files with 96 additions and 15 deletions
|
@ -306,6 +306,18 @@ module.config([ '$routeProvider', function($routeProvider) {
|
|||
},
|
||||
controller : 'ApplicationInstallationCtrl'
|
||||
})
|
||||
.when('/realms/:realm/applications/:application/sessions', {
|
||||
templateUrl : 'partials/application-sessions.html',
|
||||
resolve : {
|
||||
realm : function(RealmLoader) {
|
||||
return RealmLoader();
|
||||
},
|
||||
application : function(ApplicationLoader) {
|
||||
return ApplicationLoader();
|
||||
}
|
||||
},
|
||||
controller : 'ApplicationSessionsCtrl'
|
||||
})
|
||||
.when('/create/application/:realm', {
|
||||
templateUrl : 'partials/application-detail.html',
|
||||
resolve : {
|
||||
|
|
|
@ -94,9 +94,10 @@ module.controller('ApplicationCredentialsCtrl', function($scope, $location, real
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
module.controller('ApplicationSessionsCtrl', function($scope, $location, realm, application) {
|
||||
$scope.realm = realm;
|
||||
$scope.application = application;
|
||||
});
|
||||
|
||||
module.controller('ApplicationRoleDetailCtrl', function($scope, realm, application, role, ApplicationRole, $location, Dialog, Notifications) {
|
||||
$scope.realm = realm;
|
||||
|
|
|
@ -843,9 +843,13 @@ module.controller('RoleDetailCtrl', function($scope, realm, role, Role, $locatio
|
|||
});
|
||||
|
||||
module.controller('RealmSMTPSettingsCtrl', function($scope, Current, Realm, realm, $http, $location, Dialog, Notifications) {
|
||||
console.log('RealmSMTPSettingsCtrl');
|
||||
|
||||
var booleanSmtpAtts = ["auth","ssl","starttls"];
|
||||
|
||||
$scope.realm = {
|
||||
id : realm.id, realm : realm.realm, social : realm.social, registrationAllowed : realm.registrationAllowed,
|
||||
smtpServer: realm.smtpServer
|
||||
smtpServer: typeObject(realm.smtpServer)
|
||||
};
|
||||
|
||||
var oldCopy = angular.copy($scope.realm);
|
||||
|
@ -859,6 +863,7 @@ module.controller('RealmSMTPSettingsCtrl', function($scope, Current, Realm, real
|
|||
|
||||
$scope.save = function() {
|
||||
var realmCopy = angular.copy($scope.realm);
|
||||
realmCopy['smtpServer'] = detypeObject(realmCopy.smtpServer);
|
||||
$scope.changed = false;
|
||||
Realm.update(realmCopy, function () {
|
||||
$location.url("/realms/" + realm.id + "/smtp-settings");
|
||||
|
@ -870,4 +875,38 @@ module.controller('RealmSMTPSettingsCtrl', function($scope, Current, Realm, real
|
|||
$scope.realm = angular.copy(oldCopy);
|
||||
$scope.changed = false;
|
||||
};
|
||||
|
||||
/* Convert string attributes containing a boolean to actual boolean type + convert an integer string (port) to integer. */
|
||||
function typeObject(obj){
|
||||
for (var att in obj){
|
||||
if (booleanSmtpAtts.indexOf(att) < 0)
|
||||
continue;
|
||||
if (obj[att] === "true"){
|
||||
obj[att] = true;
|
||||
} else if (obj[att] === "false"){
|
||||
obj[att] = false;
|
||||
}
|
||||
}
|
||||
|
||||
obj['port'] = parseInt(obj['port']);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
/* Convert all non-string values to strings to invert changes caused by the typeObject function. */
|
||||
function detypeObject(obj){
|
||||
for (var att in obj){
|
||||
if (booleanSmtpAtts.indexOf(att) < 0)
|
||||
continue;
|
||||
if (obj[att] === true){
|
||||
obj[att] = "true";
|
||||
} else if (obj[att] === false){
|
||||
obj[att] = "false"
|
||||
}
|
||||
}
|
||||
|
||||
obj['port'] = obj['port'].toString();
|
||||
|
||||
return obj;
|
||||
}
|
||||
});
|
|
@ -9,7 +9,7 @@
|
|||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/installation">Installation</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/roles">Roles</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/scope-mappings">Scope</a></li>
|
||||
<li><a href="#">Sessions</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/sessions">Sessions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/installation">Installation</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/roles">Roles</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/scope-mappings">Scope</a></li>
|
||||
<li><a href="#">Sessions</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/sessions">Sessions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="top-nav" data-ng-show="create">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<li class="active"><a href="#/realms/{{realm.id}}/applications/{{application.id}}/installation">Installation</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/roles">Roles</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/scope-mappings">Scope</a></li>
|
||||
<li><a href="#">Sessions</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/sessions">Sessions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="top-nav" data-ng-show="create">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/installation">Installation</a></li>
|
||||
<li class="active"><a href="#/realms/{{realm.id}}/applications/{{application.id}}/roles">Roles</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/scope-mappings">Scope</a></li>
|
||||
<li><a href="#">Sessions</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/sessions">Sessions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/installation">Installation</a></li>
|
||||
<li class="active"><a href="#/realms/{{realm.id}}/applications/{{application.id}}/roles">Roles</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/scope-mappings">Scope</a></li>
|
||||
<li><a href="#">Sessions</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/sessions">Sessions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<li><a href="#">Installation</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/roles">Roles</a></li>
|
||||
<li class="active"><a href="#/realms/{{realm.id}}/applications/{{application.id}}/scope-mappings">Scope</a></li>
|
||||
<li><a href="#">Sessions</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/sessions">Sessions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<div id="wrapper" class="container">
|
||||
<div class="row">
|
||||
<div class="bs-sidebar col-md-3 clearfix" data-ng-include data-src="'partials/realm-menu.html'"></div>
|
||||
<div id="content-area" class="col-md-9" role="main">
|
||||
<div class="top-nav">
|
||||
<ul class="rcue-tabs">
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}">Settings</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/credentials">Credentials</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/installation">Installation</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/roles">Roles</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}/scope-mappings">Scope</a></li>
|
||||
<li class="active"><a href="#/realms/{{realm.id}}/applications/{{application.id}}/sessions">Sessions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<ol class="breadcrumb" data-ng-hide="create">
|
||||
<li><a href="#/realms/{{realm.id}}">{{realm.realm}}</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications">Applications</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/applications/{{application.id}}">{{application.name}}</a></li>
|
||||
<li class="active">Sessions</li>
|
||||
</ol>
|
||||
<h2 data-ng-hide="create"><span>{{application.name}}</span> Sessions (Placeholder Page)</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div id="container-right-bg"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,10 +1,10 @@
|
|||
<ul data-ng-hide="createRealm">
|
||||
<li data-ng-class="(!path[2] || path[1] == 'role' || path[2] == 'roles' || path[2] == 'token-settings' ||
|
||||
<li data-ng-class="((!path[2] || path[1] == 'role' || path[2] == 'roles' || path[2] == 'token-settings' ||
|
||||
path[2] == 'social-settings' || path[2] == 'required-credentials' || path[2] == 'registration-settings' ||
|
||||
path[2] == 'keys-settings' || path[2] == 'smtp-settings') && 'active'"><a href="#/realms/{{realm.id}}">Settings</a></li>
|
||||
path[2] == 'keys-settings' || path[2] == 'smtp-settings') && path[3] != 'applications') && 'active'"><a href="#/realms/{{realm.id}}">Settings</a></li>
|
||||
<li data-ng-class="(path[2] == 'users' || path[1] == 'user') && 'active'"><a href="#/realms/{{realm.id}}/users">Users</a>
|
||||
</li>
|
||||
<li data-ng-class="(path[2] == 'applications' || path[1] == 'application') && 'active'"><a href="#/realms/{{realm.id}}/applications">Applications</a></li>
|
||||
<li data-ng-class="(path[2] == 'applications' || path[1] == 'application' || path[3] == 'applications') && 'active'"><a href="#/realms/{{realm.id}}/applications">Applications</a></li>
|
||||
<li data-ng-class="(path[2] == 'oauth-clients' || path[1] == 'oauth-client') && 'active'"><a href="#/realms/{{realm.id}}/oauth-clients">OAuth Clients</a></li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -34,13 +34,13 @@
|
|||
<div class="form-group clearfix">
|
||||
<label for="smtpPort" class="control-label">Port <span class="required">*</span></label>
|
||||
<div class="controls">
|
||||
<input id="smtpPort" type="text" ng-model="realm.smtpServer.port" placeholder="SMTP Port (defaults to 25)" required>
|
||||
<input id="smtpPort" type="number" ng-model="realm.smtpServer.port" placeholder="SMTP Port (defaults to 25)" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group clearfix">
|
||||
<label for="smtpFrom" class="control-label">From <span class="required">*</span></label>
|
||||
<div class="controls">
|
||||
<input id="smtpFrom" type="text" ng-model="realm.smtpServer.from" placeholder="SMTP From" required>
|
||||
<input id="smtpFrom" type="email" ng-model="realm.smtpServer.from" placeholder="SMTP From" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group clearfix">
|
||||
|
|
|
@ -6,9 +6,11 @@
|
|||
<ul class="rcue-tabs">
|
||||
<li><a href="#/realms/{{realm.id}}">General</a></li>
|
||||
<li data-ng-show="realm.social"><a href="#/realms/{{realm.id}}/social-settings">Social</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/registration-settings">Registration</a></li>
|
||||
<li class="active"><a href="#/realms/{{realm.id}}/roles">Roles</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/required-credentials">Credentials</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/token-settings">Token</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/keys-settings">Keys</a></li>
|
||||
<li><a href="#/realms/{{realm.id}}/smtp-settings">SMTP</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue