* added "Forgot Password" link to login
* added "Register for an OpenStack ID" to login * Verbiage changes * js refactoring * remember me expiration setting added * verbiage for remember me setting Change-Id: I7c08fb3710b0d0ee1f290f6526be80fda7a1f9f2
This commit is contained in:
parent
38f3707b8e
commit
66c9a25245
|
@ -188,12 +188,12 @@ class AdminController extends BaseController {
|
|||
$clients = $user->getClients();
|
||||
|
||||
return View::make("oauth2.profile.clients", array(
|
||||
"username" => $user->getFullName(),
|
||||
"user_id" => $user->getId(),
|
||||
"is_oauth2_admin" => $user->isOAuth2ServerAdmin(),
|
||||
"username" => $user->getFullName(),
|
||||
"user_id" => $user->getId(),
|
||||
"is_oauth2_admin" => $user->isOAuth2ServerAdmin(),
|
||||
"is_openstackid_admin" => $user->isOpenstackIdAdmin(),
|
||||
"use_system_scopes" => $user->canUseSystemScopes(),
|
||||
'clients' => $clients,
|
||||
"use_system_scopes" => $user->canUseSystemScopes(),
|
||||
'clients' => $clients,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class BaseController extends Controller
|
||||
{
|
||||
class BaseController extends Controller {
|
||||
|
||||
/**
|
||||
* Setup the layout used by the controller.
|
||||
|
|
|
@ -39,9 +39,16 @@ App::after(function($request, $response){
|
|||
|
||||
$response->headers->set('X-content-type-options','nosniff');
|
||||
$response->headers->set('X-xss-protection','1; mode=block');
|
||||
|
||||
$cors = ServiceLocator::getInstance()->getService('CORSMiddleware');
|
||||
$cors->modifyResponse($request, $response);
|
||||
|
||||
if ( Auth::check()){
|
||||
//Get the name of the cookie, where remember me expiration time is stored
|
||||
$ckname = Auth::getRecallerName();
|
||||
//Get the value of the cookie
|
||||
$ckval = Cookie::get($ckname);
|
||||
return $response->withCookie(Cookie::make($ckname,$ckval,ServerConfigurationService::getConfigValue("Remember.ExpirationTime"))); //change the expiration time
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
|
@ -156,6 +163,12 @@ Route::filter("ssl", function () {
|
|||
}
|
||||
});
|
||||
|
||||
Route::filter("oauth2.enabled",function(){
|
||||
if(!ServerConfigurationService::getConfigValue("OAuth2.Enable")){
|
||||
return View::make('404');
|
||||
}
|
||||
});
|
||||
|
||||
Route::filter('user.owns.client.policy',function($route, $request){
|
||||
try{
|
||||
$authentication_service = ServiceLocator::getInstance()->getService(UtilsServiceCatalog::AuthenticationService);
|
||||
|
|
|
@ -42,7 +42,7 @@ Route::group(array("before" => "ssl"), function () {
|
|||
});
|
||||
|
||||
//oauth2 endpoints
|
||||
Route::group(array('prefix' => 'oauth2', 'before' => 'ssl'), function()
|
||||
Route::group(array('prefix' => 'oauth2', 'before' => 'ssl|oauth2.enabled'), function()
|
||||
{
|
||||
//authorization endpoint
|
||||
Route::any('/auth',"OAuth2ProviderController@authorize");
|
||||
|
@ -66,12 +66,12 @@ Route::group(array("before" => array("ssl", "auth")), function () {
|
|||
|
||||
Route::group(array('prefix' => 'admin','before' => 'ssl|auth'), function(){
|
||||
//client admin UI
|
||||
Route::get('clients/edit/{id}',array('before' => 'user.owns.client.policy', 'uses' => 'AdminController@editRegisteredClient'));
|
||||
Route::get('clients',array('uses' => 'AdminController@listOAuth2Clients'));
|
||||
Route::get('clients/edit/{id}',array('before' => 'oauth2.enabled|user.owns.client.policy', 'uses' => 'AdminController@editRegisteredClient'));
|
||||
Route::get('clients',array('before' => 'oauth2.enabled', 'uses' => 'AdminController@listOAuth2Clients'));
|
||||
|
||||
Route::get('/grants','AdminController@editIssuedGrants');
|
||||
Route::get('/grants',array('before' => 'oauth2.enabled', 'uses' => 'AdminController@editIssuedGrants'));
|
||||
//oauth2 server admin UI
|
||||
Route::group(array('before' => 'oauth2.server.admin'), function(){
|
||||
Route::group(array('before' => 'oauth2.enabled|oauth2.server.admin'), function(){
|
||||
Route::get('/resource-servers','AdminController@listResourceServers');
|
||||
Route::get('/resource-server/{id}','AdminController@editResourceServer');
|
||||
Route::get('/api/{id}','AdminController@editApi');
|
||||
|
@ -180,7 +180,7 @@ Route::group(array('prefix' => 'admin/api/v1', 'before' => 'ssl|auth'), function
|
|||
});
|
||||
|
||||
//OAuth2 Protected API
|
||||
Route::group(array('prefix' => 'api/v1', 'before' => 'ssl|oauth2.cors.before|oauth2.protected.endpoint'), function()
|
||||
Route::group(array('prefix' => 'api/v1', 'before' => 'ssl|oauth2.enabled|oauth2.cors.before|oauth2.protected.endpoint'), function()
|
||||
{
|
||||
Route::group(array('prefix' => 'users'), function(){
|
||||
Route::get('/me','OAuth2UserApiController@me');
|
||||
|
|
|
@ -3,9 +3,12 @@
|
|||
namespace services\facades;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
/**
|
||||
* Class ServerConfigurationService
|
||||
* @package services\facades
|
||||
*/
|
||||
class ServerConfigurationService extends Facade {
|
||||
|
||||
class ServerConfigurationService extends Facade
|
||||
{
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'serverconfigurationservice';
|
||||
|
|
|
@ -40,17 +40,18 @@ class ServerConfigurationService implements IOpenIdServerConfigurationService, I
|
|||
//default config values
|
||||
|
||||
//general
|
||||
$this->default_config_params["MaxFailed.Login.Attempts"] = Config::get('server.MaxFailed_Login_Attempts', 10);
|
||||
$this->default_config_params["MaxFailed.Login.Attempts"] = Config::get('server.MaxFailed_Login_Attempts', 10);
|
||||
$this->default_config_params["MaxFailed.LoginAttempts.2ShowCaptcha"] = Config::get('server.MaxFailed_LoginAttempts_2ShowCaptcha', 3);
|
||||
$this->default_config_params["Assets.Url"] = Config::get('server.Assets_Url', 'http://www.openstack.org/');
|
||||
$this->default_config_params["Assets.Url"] = Config::get('server.Assets_Url', 'http://www.openstack.org/');
|
||||
// remember me cookie lifetime (minutes)
|
||||
$this->default_config_params["Remember.ExpirationTime"] = Config::get('Remember.ExpirationTime',120);
|
||||
|
||||
//openid
|
||||
$this->default_config_params["OpenId.Private.Association.Lifetime"] = Config::get('server.OpenId_Private_Association_Lifetime', 240);
|
||||
$this->default_config_params["OpenId.Session.Association.Lifetime"] = Config::get('server.OpenId_Session_Association_Lifetime', 21600);
|
||||
$this->default_config_params["OpenId.Nonce.Lifetime"] = Config::get('server.OpenId_Nonce_Lifetime', 360);
|
||||
$this->default_config_params["OpenId.Nonce.Lifetime"] = Config::get('server.OpenId_Nonce_Lifetime', 360);
|
||||
|
||||
//policies
|
||||
|
||||
$this->default_config_params["BlacklistSecurityPolicy.BannedIpLifeTimeSeconds"] = Config::get('server.BlacklistSecurityPolicy_BannedIpLifeTimeSeconds', 21600);
|
||||
$this->default_config_params["BlacklistSecurityPolicy.MinutesWithoutExceptions"] = Config::get('server.BlacklistSecurityPolicy_MinutesWithoutExceptions', 5);;
|
||||
$this->default_config_params["BlacklistSecurityPolicy.ReplayAttackExceptionInitialDelay"] = Config::get('server.BlacklistSecurityPolicy_ReplayAttackExceptionInitialDelay', 10);
|
||||
|
@ -70,8 +71,8 @@ class ServerConfigurationService implements IOpenIdServerConfigurationService, I
|
|||
$this->default_config_params["BlacklistSecurityPolicy.InvalidAssociationInitialDelay"] = Config::get('server.BlacklistSecurityPolicy_InvalidAssociationInitialDelay', 20);
|
||||
|
||||
//oauth2
|
||||
|
||||
$this->default_config_params["BlacklistSecurityPolicy.OAuth2.MaxAuthCodeReplayAttackAttempts"] = Config::get('server.BlacklistSecurityPolicy_OAuth2_MaxAuthCodeReplayAttackAttempts', 3);
|
||||
$this->default_config_params["OAuth2.Enable"] = Config::get('OAuth2.Enable', false);
|
||||
$this->default_config_params["BlacklistSecurityPolicy.OAuth2.MaxAuthCodeReplayAttackAttempts"] = Config::get('server.BlacklistSecurityPolicy_OAuth2_MaxAuthCodeReplayAttackAttempts', 3);
|
||||
$this->default_config_params["BlacklistSecurityPolicy.OAuth2.AuthCodeReplayAttackInitialDelay"] = Config::get('server.BlacklistSecurityPolicy_OAuth2_AuthCodeReplayAttackInitialDelay', 10);
|
||||
|
||||
$this->default_config_params["BlacklistSecurityPolicy.OAuth2.MaxInvalidAuthorizationCodeAttempts"] = Config::get('server.BlacklistSecurityPolicy_OAuth2_MaxInvalidAuthorizationCodeAttempts', 3);
|
||||
|
|
|
@ -17,6 +17,7 @@ class UtilsProvider extends ServiceProvider {
|
|||
public function register()
|
||||
{
|
||||
App::singleton(UtilsServiceCatalog::CacheService, 'services\\utils\\RedisCacheService');
|
||||
App::singleton(UtilsServiceCatalog::TransactionService, 'services\\utils\\EloquentTransactionService');
|
||||
|
||||
App::resolving('redis',function($redis){
|
||||
$cache_service = App::make(UtilsServiceCatalog::CacheService);
|
||||
|
@ -24,7 +25,7 @@ class UtilsProvider extends ServiceProvider {
|
|||
});
|
||||
|
||||
$this->app['serverconfigurationservice'] = App::share(function ($app) {
|
||||
return new ServerConfigurationService(App::make(UtilsServiceCatalog::CacheService));
|
||||
return new ServerConfigurationService(App::make(UtilsServiceCatalog::CacheService),App::make(UtilsServiceCatalog::TransactionService));
|
||||
});
|
||||
|
||||
// Shortcut so developers don't need to add an Alias in app/config/app.php
|
||||
|
@ -37,7 +38,7 @@ class UtilsProvider extends ServiceProvider {
|
|||
App::singleton(UtilsServiceCatalog::LockManagerService, 'services\\utils\\LockManagerService');
|
||||
App::singleton(UtilsServiceCatalog::ServerConfigurationService, 'services\\utils\\ServerConfigurationService');
|
||||
App::singleton(UtilsServiceCatalog::BannedIpService, 'services\\utils\\BannedIPService');
|
||||
App::singleton(UtilsServiceCatalog::TransactionService, 'services\\utils\\EloquentTransactionService');
|
||||
|
||||
}
|
||||
|
||||
public function provides()
|
||||
|
|
|
@ -48,49 +48,5 @@
|
|||
@stop
|
||||
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
if($('#ips-table tr').length===1){
|
||||
$('#ips-info').show();
|
||||
$('#ips-table').hide();
|
||||
}
|
||||
else{
|
||||
$('#ips-info').hide();
|
||||
$('#ips-table').show();
|
||||
}
|
||||
|
||||
$("body").on('click',".revoke-ip",function(event){
|
||||
if(confirm("Are you sure that you want to revoke this banned ip?")){
|
||||
var url = $(this).attr('href');
|
||||
var ip_id = $(this).attr('data-ip-id');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
$('#'+ip_id,'#body-ips').remove();
|
||||
|
||||
if($('#ips-table tr').length===1){
|
||||
$('#ips-info').show();
|
||||
$('#ips-table').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{{ HTML::script('js/admin/banned-ips.js') }}
|
||||
@stop
|
||||
|
|
|
@ -45,35 +45,5 @@
|
|||
@stop
|
||||
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
var form_server_config = $("#form-server-configuration");
|
||||
|
||||
var server_config_validation = form_server_config.validate({
|
||||
rules: {
|
||||
"general-max-failed-login-attempts" : {required: true, number: true },
|
||||
"general-max-failed-login-attempts-captcha" : {required: true, number: true },
|
||||
"openid-private-association-lifetime" : {required: true, number: true },
|
||||
"openid-session-association-lifetime" : {required: true, number: true },
|
||||
"openid-nonce-lifetime" : {required: true, number: true },
|
||||
"oauth2-auth-code-lifetime" : {required: true, number: true },
|
||||
"oauth2-refresh-token-lifetime" : {required: true, number: true },
|
||||
"oauth2-access-token-lifetime" : {required: true, number: true }
|
||||
}
|
||||
});
|
||||
|
||||
form_server_config.submit(function( event ) {
|
||||
var is_valid = form_server_config.valid();
|
||||
if (is_valid){
|
||||
server_config_validation.resetForm();
|
||||
return true;
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@stop
|
||||
{{ HTML::script('js/admin/server-config.js') }}
|
||||
@stop
|
|
@ -41,49 +41,6 @@
|
|||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
if($('#users-table tr').length===1){
|
||||
$('#users-info').show();
|
||||
$('#users-table').hide();
|
||||
}
|
||||
else{
|
||||
$('#users-info').hide();
|
||||
$('#users-table').show();
|
||||
}
|
||||
|
||||
$("body").on('click',".unlock-user",function(event){
|
||||
if(confirm("Are you sure that you want to unlock this User?")){
|
||||
var url = $(this).attr('href');
|
||||
var user_id = $(this).attr('data-user-id');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
$('#'+user_id,'#body-locked-users').remove();
|
||||
|
||||
if($('#users-table tr').length===1){
|
||||
$('#users-info').show();
|
||||
$('#users-table').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ HTML::script('js/admin/users.js') }}
|
||||
@stop
|
|
@ -4,7 +4,7 @@
|
|||
@stop
|
||||
@section('content')
|
||||
|
||||
<h4>Welcome to OpenstackId!!!</h4>
|
||||
<h4>Please use your OpenStack ID to log in</h4>
|
||||
@if(isset($identity_select))
|
||||
@if(!$identity_select)
|
||||
<legend>
|
||||
|
@ -31,16 +31,29 @@
|
|||
{{ Form::hidden('login_attempts', '0') }}
|
||||
@endif
|
||||
<label class="checkbox">
|
||||
{{ Form::checkbox('remember', '1', false) }}Remember me
|
||||
{{ Form::checkbox('remember', '1', false) }}Remember me for @if(ServerConfigurationService::getConfigValue("Remember.ExpirationTime")<60) }}
|
||||
{{ ServerConfigurationService::getConfigValue("Remember.ExpirationTime") }} Minutes
|
||||
@elseif(ServerConfigurationService::getConfigValue("Remember.ExpirationTime")>60 && ServerConfigurationService::getConfigValue("Remember.ExpirationTime")< (24*60))
|
||||
{{ intval(ServerConfigurationService::getConfigValue("Remember.ExpirationTime")/60) }} Hours
|
||||
@elseif(ServerConfigurationService::getConfigValue("Remember.ExpirationTime")> (24*60) )
|
||||
{{ intval(ServerConfigurationService::getConfigValue("Remember.ExpirationTime")/(24*60)) }} Days
|
||||
@endif
|
||||
</label>
|
||||
<div class="pull-right">
|
||||
{{ Form::submit('Sign In',array('id'=>'login','class'=>'btn btn-primary')) }}
|
||||
<a class="btn btn-primary" href="{{ URL::action('UserController@cancelLogin') }}">Cancel</a>
|
||||
</div>
|
||||
<div style="clear:both;padding-top:15px;" class="row-fluid">
|
||||
<div class="span5">
|
||||
<a title="forgot password" href="{{ ServerConfigurationService::getConfigValue("Assets.Url") }}Security/lostpassword">Forgot password?</a>
|
||||
</div>
|
||||
<div class="span7">
|
||||
<a title="register new account" href="{{ ServerConfigurationService::getConfigValue("Assets.Url") }}join/register">Register for an OpenStack ID</a>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
|
||||
@if(Session::has('flash_notice'))
|
||||
<div class="alert alert-error">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
|
@ -54,10 +67,7 @@
|
|||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</div>
|
||||
<div class="span8">
|
||||
|
||||
</div>
|
||||
|
||||
@stop
|
|
@ -1,7 +1,8 @@
|
|||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<ul id='main-menu' class="nav">
|
||||
<li id="profile"><a href='{{ URL::action("UserController@getProfile") }}'>Profile</a></li>
|
||||
<li id="profile"><a href='{{ URL::action("UserController@getProfile") }}'>Settings</a></li>
|
||||
@if( ServerConfigurationService::getConfigValue("OAuth2.Enable") == true)
|
||||
<li id="oauth2-console" class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
OAUTH2 Console
|
||||
|
@ -12,6 +13,7 @@
|
|||
<li><a href='{{URL::action("AdminController@editIssuedGrants")}}'>Issued OAUTH2 Grants</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
@if($is_oauth2_admin || $is_openstackid_admin)
|
||||
<li id='server-admin' class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
|
@ -36,4 +38,4 @@
|
|||
<li><a href='{{ URL::action("UserController@logout") }}'>Logout</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -46,39 +46,6 @@
|
|||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$('.icon-info-sign').popover({html:true,placement:'bottom'});
|
||||
|
||||
$(':not(#anything)').on('click', function (e) {
|
||||
$('.icon-info-sign').each(function () {
|
||||
//the 'is' for buttons that trigger popups
|
||||
//the 'has' for icons and other elements within a button that triggers a popup
|
||||
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
|
||||
$(this).popover('hide');
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click',"#cancel-authorization",function(event){
|
||||
$form = $('#authorization_form');
|
||||
$('#trust').attr('value','DenyOnce');
|
||||
$form.submit();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',"#approve-authorization",function(event){
|
||||
$form = $('#authorization_form');
|
||||
$('#trust').attr('value','AllowOnce');
|
||||
$form.submit();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ HTML::script('js/oauth2/consent.js') }}
|
||||
@stop
|
|
@ -38,49 +38,6 @@
|
|||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
if($('#clients-table tr').length===1){
|
||||
$('#clients-info').show();
|
||||
$('#clients-table').hide();
|
||||
}
|
||||
else{
|
||||
$('#clients-info').hide();
|
||||
$('#clients-table').show();
|
||||
}
|
||||
|
||||
$("body").on('click',".unlock-client",function(event){
|
||||
if(confirm("Are you sure that you want to unlock this OAUTH2 Client?")){
|
||||
var url = $(this).attr('href');
|
||||
var client_id = $(this).attr('data-client-id');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
$('#'+client_id,'#body-locked-clients').remove();
|
||||
|
||||
if($('#clients-table tr').length===1){
|
||||
$('#clients-info').show();
|
||||
$('#clients-table').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ HTML::script('js/oauth2/profile/admin/clients.js') }}
|
||||
@stop
|
|
@ -257,471 +257,29 @@
|
|||
|
||||
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
|
||||
var api_id = {{ $api->id}};
|
||||
|
||||
function loadScopes(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '{{ URL::action("ApiScopeController@getByPage",array("offset"=>1,"limit"=>1000,"api_id"=>$api->id)) }}',
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
var scopes = data.page;
|
||||
if(scopes.length>0){
|
||||
$('#info-scopes').hide();
|
||||
$('#table-scopes').show();
|
||||
var template = $('<tbody><tr>' +
|
||||
'<td class="name"></td>' +
|
||||
'<td class="active"><input type="checkbox" class="scope-active-checkbox"></td>' +
|
||||
'<td class="default"><input type="checkbox" class="scope-default-checkbox"></td>' +
|
||||
'<td class="system"><input type="checkbox" class="scope-system-checkbox"></td>' +
|
||||
'<td> ' +
|
||||
'<a class="btn edit-scope" title="Edits a Registered API Scope">Edit</a> ' +
|
||||
'<a class="btn delete-scope" title="Deletes a Registered API Scope">Delete</a>' +
|
||||
'</td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'scope<-context':{
|
||||
'td.name':'scope.name',
|
||||
//active
|
||||
'.scope-active-checkbox@value':'scope.id',
|
||||
'.scope-active-checkbox@checked':function(arg){
|
||||
return arg.item.active?'true':'';
|
||||
},
|
||||
'.scope-active-checkbox@id':function(arg){
|
||||
var id = arg.item.id;
|
||||
return 'scope-active_'+id;
|
||||
},
|
||||
'.scope-active-checkbox@data-scope-id':'scope.id',
|
||||
//default
|
||||
'.scope-default-checkbox@value':'scope.id',
|
||||
'.scope-default-checkbox@checked':function(arg){
|
||||
return arg.item.default?'true':'';
|
||||
},
|
||||
'.scope-default-checkbox@id':function(arg){
|
||||
var id = arg.item.id;
|
||||
return 'scope-default_'+id;
|
||||
},
|
||||
'.scope-default-checkbox@data-scope-id':'scope.id',
|
||||
//system
|
||||
'.scope-system-checkbox@value':'scope.id',
|
||||
'.scope-system-checkbox@checked':function(arg){
|
||||
return arg.item.system?'true':'';
|
||||
},
|
||||
'.scope-system-checkbox@id':function(arg){
|
||||
var id = arg.item.id;
|
||||
return 'scope-system_'+id;
|
||||
},
|
||||
'.scope-system-checkbox@data-scope-id':'scope.id',
|
||||
//buttons
|
||||
'a.edit-scope@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = '{{ URL::action("AdminController@editScope",array("id"=>"@id")) }}';
|
||||
return href.replace('@id',id);
|
||||
},
|
||||
'a.delete-scope@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = '{{ URL::action("ApiScopeController@delete",array("id"=>"@id")) }}';
|
||||
return href.replace('@id',id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(scopes, directives);
|
||||
$('#body-scopes').html(html.html());
|
||||
}
|
||||
else{
|
||||
$('#info-scopes').show();
|
||||
$('#table-scopes').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
var scopesUrls = {
|
||||
get : '{{ URL::action("ApiScopeController@getByPage",array("offset"=>1,"limit"=>1000,"api_id"=>$api->id)) }}',
|
||||
edit : '{{ URL::action("AdminController@editScope",array("id"=>"@id")) }}',
|
||||
delete : '{{ URL::action("ApiScopeController@delete",array("id"=>"@id")) }}',
|
||||
activate:'{{ URL::action("ApiScopeController@activate",array("id"=>"@id")) }}',
|
||||
deactivate: '{{ URL::action("ApiScopeController@deactivate",array("id"=>"@id")) }}',
|
||||
update : '{{URL::action("ApiScopeController@update")}}',
|
||||
add : '{{ URL::action("ApiScopeController@create") }}'
|
||||
};
|
||||
|
||||
function loadEndpoints(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '{{ URL::action("ApiEndpointController@getByPage",array("offset"=>1,"limit"=>1000,"api_id"=>$api->id)) }}',
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
var endpoints = data.page;
|
||||
if(endpoints.length>0){
|
||||
$('#info-endpoints').hide();
|
||||
$('#table-endpoints').show();
|
||||
var template = $('<tbody><tr>' +
|
||||
'<td class="name"></td>' +
|
||||
'<td class="active"><input type="checkbox" class="endpoint-active-checkbox"></td>' +
|
||||
'<td class="route"></td>' +
|
||||
'<td class="method"></td>' +
|
||||
'<td> ' +
|
||||
'<a class="btn edit-endpoint" title="Edits a Registered API Endpoint">Edit</a> ' +
|
||||
'<a class="btn delete-endpoint" title="Deletes a Registered API Endpoint">Delete</a>' +
|
||||
'</td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'endpoint<-context':{
|
||||
'td.name':'endpoint.name',
|
||||
'td.route':'endpoint.route',
|
||||
'td.method':'endpoint.http_method',
|
||||
//active
|
||||
'.endpoint-active-checkbox@value':'scope.id',
|
||||
'.endpoint-active-checkbox@checked':function(arg){
|
||||
return arg.item.active?'true':'';
|
||||
},
|
||||
'.endpoint-active-checkbox@id':function(arg){
|
||||
var id = arg.item.id;
|
||||
return 'endpoint-active_'+id;
|
||||
},
|
||||
'.endpoint-active-checkbox@data-endpoint-id':'endpoint.id',
|
||||
//buttons
|
||||
'a.edit-endpoint@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = '{{ URL::action("AdminController@editEndpoint",array("id"=>"@id")) }}';
|
||||
return href.replace('@id',id);
|
||||
},
|
||||
'a.delete-endpoint@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = '{{ URL::action("ApiEndpointController@delete",array("id"=>"@id")) }}';
|
||||
return href.replace('@id',id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(endpoints, directives);
|
||||
$('#body-endpoints').html(html.html());
|
||||
}
|
||||
else{
|
||||
$('#info-endpoints').show();
|
||||
$('#table-endpoints').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
var api_form = $('#api-form');
|
||||
var api_validator = api_form.validate({
|
||||
rules: {
|
||||
"name" : {required: true, nowhitespace:true,rangelength: [1, 255]},
|
||||
"description": {required: true, free_text:true,rangelength: [1, 512]}
|
||||
}
|
||||
});
|
||||
|
||||
api_form.submit(function( event ) {
|
||||
var is_valid = api_form.valid();
|
||||
if (is_valid){
|
||||
api_validator.resetForm();
|
||||
var api = api_form.serializeForm();
|
||||
var href = $(this).attr('action');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: href,
|
||||
data: JSON.stringify(api),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
displaySuccessMessage('{{ Lang::get("messages.global_successfull_save_entity", array("entity" => "API")) }}',api_form);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
//scopes
|
||||
|
||||
if($('#table-scopes tr').length===1){
|
||||
$('#info-scopes').show();
|
||||
$('#table-scopes').hide();
|
||||
}
|
||||
|
||||
|
||||
$("body").on('click','.scope-active-checkbox',function(event){
|
||||
var id = $(this).attr('data-scope-id');
|
||||
var active = $(this).is(':checked');
|
||||
|
||||
var url = active?'{{ URL::action("ApiScopeController@activate",array("id"=>"@id")) }}':'{{ URL::action("ApiScopeController@deactivate",array("id"=>"@id")) }}';
|
||||
url = url.replace('@id',id);
|
||||
var verb = active?'PUT':'DELETE'
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("body").on('click','.scope-default-checkbox',function(event){
|
||||
var id = $(this).attr('data-scope-id');
|
||||
var is_default = $(this).is(':checked');
|
||||
|
||||
var scope = { id : id, default:is_default};
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: '{{URL::action("ApiScopeController@update") }}',
|
||||
data: JSON.stringify(scope),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("body").on('click','.scope-system-checkbox',function(event){
|
||||
var id = $(this).attr('data-scope-id');
|
||||
var is_system = $(this).is(':checked');
|
||||
|
||||
var scope = { id : id, system:is_system};
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: '{{URL::action("ApiScopeController@update") }}',
|
||||
data: JSON.stringify(scope),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
$("body").on('click','.refresh-scopes',function(event){
|
||||
loadScopes();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
var scope_dialog = $('#dialog-form-scope');
|
||||
var scope_form = $('#form-scope');
|
||||
|
||||
var scope_validator = scope_form.validate({
|
||||
rules: {
|
||||
"name" : {required: true, scopename:true,rangelength: [1, 512]},
|
||||
"short_description": {required: true, free_text:true,rangelength: [1, 512]},
|
||||
"description": {required: true, free_text:true,rangelength: [1, 1024]}
|
||||
}
|
||||
});
|
||||
|
||||
scope_dialog.modal({
|
||||
show:false,
|
||||
backdrop:"static"
|
||||
});
|
||||
|
||||
scope_dialog.on('hidden', function () {
|
||||
scope_form.cleanForm();
|
||||
scope_validator.resetForm();
|
||||
})
|
||||
|
||||
$("body").on('click',".add-scope",function(event){
|
||||
scope_dialog.modal('show');
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',"#save-scope",function(event){
|
||||
var is_valid = scope_form.valid();
|
||||
if (is_valid){
|
||||
var scope = scope_form.serializeForm();
|
||||
scope.api_id = api_id;
|
||||
$.ajax(
|
||||
{
|
||||
type: "POST",
|
||||
url: '{{ URL::action("ApiScopeController@create") }}',
|
||||
data: JSON.stringify(scope),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadScopes();
|
||||
scope_dialog.modal('hide');
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".delete-scope",function(event){
|
||||
if(confirm("Are you sure? this will delete all application assigned scopes and all endpoints assigned scopes too.")){
|
||||
var url = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadScopes();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
//endpoints
|
||||
|
||||
var endpoint_dialog = $('#dialog-form-endpoint');
|
||||
var endpoint_form = $('#form-endpoint');
|
||||
|
||||
if($('#table-endpoints tr').length===1){
|
||||
$('#info-endpoints').show();
|
||||
$('#table-endpoints').hide();
|
||||
}
|
||||
|
||||
$("body").on('click','.endpoint-active-checkbox',function(event){
|
||||
var id = $(this).attr('data-endpoint-id');
|
||||
var active = $(this).is(':checked');
|
||||
var url = active?'{{ URL::action("ApiEndpointController@activate",array("id"=>"@id")) }}':'{{ URL::action("ApiEndpointController@deactivate",array("id"=>"@id")) }}';
|
||||
url = url.replace('@id',id);
|
||||
var verb = active?'PUT':'DELETE';
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("body").on('click','.refresh-endpoints',function(event){
|
||||
loadEndpoints();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
var endpoint_validator = endpoint_form.validate({
|
||||
rules: {
|
||||
"name" : {required: true, nowhitespace:true,rangelength: [1, 255]},
|
||||
"description":{required: true, free_text:true,rangelength: [1, 1024]},
|
||||
"route": {required: true,endpointroute:true,rangelength: [1, 1024]}
|
||||
}
|
||||
});
|
||||
|
||||
endpoint_dialog.modal({
|
||||
show:false,
|
||||
backdrop:"static"
|
||||
});
|
||||
|
||||
endpoint_dialog.on('hidden', function () {
|
||||
endpoint_form.cleanForm();
|
||||
endpoint_validator.resetForm();
|
||||
})
|
||||
|
||||
$("body").on('click',".add-endpoint",function(event){
|
||||
endpoint_dialog.modal('show');
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',"#save-endpoint",function(event){
|
||||
var is_valid = endpoint_form.valid();
|
||||
if (is_valid){
|
||||
var endpoint = endpoint_form.serializeForm();
|
||||
endpoint.api_id = api_id;
|
||||
$.ajax(
|
||||
{
|
||||
type: "POST",
|
||||
url: '{{ URL::action("ApiEndpointController@create") }}',
|
||||
data: JSON.stringify(endpoint),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadEndpoints();
|
||||
endpoint_dialog.modal('hide');
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".delete-endpoint",function(event){
|
||||
if(confirm("Are you sure? this will delete the selected endpoint.")){
|
||||
var url = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadEndpoints();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
var endpointUrls = {
|
||||
get : '{{ URL::action("ApiEndpointController@getByPage",array("offset"=>1,"limit"=>1000,"api_id"=>$api->id)) }}',
|
||||
edit : '{{ URL::action("AdminController@editEndpoint",array("id"=>"@id")) }}',
|
||||
delete : '{{ URL::action("ApiEndpointController@delete",array("id"=>"@id")) }}',
|
||||
activate:'{{ URL::action("ApiEndpointController@activate",array("id"=>"@id")) }}',
|
||||
deactivate: '{{ URL::action("ApiEndpointController@deactivate",array("id"=>"@id")) }}',
|
||||
add : '{{ URL::action("ApiEndpointController@create") }}'
|
||||
};
|
||||
</script>
|
||||
{{ HTML::script('js/oauth2/profile/admin/edit-api.js') }}
|
||||
@stop
|
|
@ -97,69 +97,9 @@
|
|||
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
var endpoint_form = $('#endpoint-form');
|
||||
|
||||
var endpoint_validator = endpoint_form.validate({
|
||||
rules: {
|
||||
"name" : {required: true, nowhitespace:true,rangelength: [1, 255]},
|
||||
"description":{required: true, free_text:true,rangelength: [1, 1024]},
|
||||
"route": {required: true, endpointroute:true,rangelength: [1, 1024]}
|
||||
}
|
||||
});
|
||||
|
||||
endpoint_form.submit(function( event ) {
|
||||
var is_valid = endpoint_form.valid();
|
||||
if (is_valid){
|
||||
endpoint_validator.resetForm();
|
||||
var endpoint = endpoint_form.serializeForm();
|
||||
var href = $(this).attr('action');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: href,
|
||||
data: JSON.stringify(endpoint),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
displaySuccessMessage('{{ Lang::get("messages.global_successfull_save_entity", array("entity" => "Endpoint")) }}',endpoint_form);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
//scopes associations
|
||||
$("body").on('click',".scope-checkbox",function(event){
|
||||
var add_link = $(this).attr('data-add-link');
|
||||
var del_link = $(this).attr('data-remove-link');
|
||||
var checked = $(this).is(':checked');
|
||||
var url = checked?add_link:del_link;
|
||||
var verb = checked?'PUT':'DELETE';
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
var editEndpointMessages = {
|
||||
success: '{{ Lang::get("messages.global_successfull_save_entity", array("entity" => "Endpoint")) }}'
|
||||
};
|
||||
</script>
|
||||
{{ HTML::script('js/oauth2/profile/admin/edit-endpoint.js') }}
|
||||
@stop
|
|
@ -149,239 +149,18 @@
|
|||
|
||||
var resource_server_id = {{ $resource_server->id}};
|
||||
|
||||
function loadApis(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '{{ URL::action("ApiController@getByPage",array("offset"=>1,"limit"=>1000,"resource_server_id"=>$resource_server->id)) }}',
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
var apis = data.page;
|
||||
if(apis.length>0){
|
||||
$('#info-apis').hide();
|
||||
$('#table-apis').show();
|
||||
var template = $('<tbody><tr><td class="image"><img height="24" width="24"/></td><td class="name"></td><td class="active"><input type="checkbox" class="api-active-checkbox"></td><td> <a class="btn edit-api" title="Edits a Registered Resource Server API">Edit</a> <a class="btn delete-api" title="Deletes a Registered Resource Server API">Delete</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'api<-context':{
|
||||
'img@src':function(arg){
|
||||
var logo = arg.item.logo;
|
||||
if(logo == null || logo=='') logo = "{{asset('img/apis/server.png');}}";
|
||||
return logo;
|
||||
},
|
||||
'img@alt':'api.name',
|
||||
'td.name':'api.name',
|
||||
'.api-active-checkbox@value':'api.id',
|
||||
'.api-active-checkbox@checked':function(arg){
|
||||
return arg.item.active?'true':'';
|
||||
},
|
||||
'.api-active-checkbox@id':function(arg){
|
||||
var id = arg.item.id;
|
||||
return 'resource-server-api-active_'+id;
|
||||
},
|
||||
'.api-active-checkbox@data-api-id':'api.id',
|
||||
'a.edit-api@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = '{{ URL::action("AdminController@editApi",array("id"=>-1)) }}';
|
||||
return href.replace('-1',id);
|
||||
},
|
||||
'a.delete-api@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = '{{ URL::action("ApiController@delete",array("id"=>-1)) }}';
|
||||
return href.replace('-1',id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(apis, directives);
|
||||
$('#body-apis').html(html.html());
|
||||
}
|
||||
else{
|
||||
$('#info-apis').show();
|
||||
$('#table-apis').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
var ApiUrls = {
|
||||
get : '{{ URL::action("ApiController@getByPage",array("offset"=>1,"limit"=>1000,"resource_server_id"=>$resource_server->id)) }}',
|
||||
edit : '{{ URL::action("AdminController@editApi",array("id"=>-1)) }}',
|
||||
delete : '{{ URL::action("ApiController@delete",array("id"=>-1)) }}',
|
||||
add : '{{URL::action("ApiController@create",null)}}',
|
||||
activate: '{{ URL::action("ApiController@activate",array("id"=>"@id")) }}',
|
||||
deactivate: '{{ URL::action("ApiController@deactivate",array("id"=>"@id")) }}'
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
if($('#table-apis tr').length===1){
|
||||
$('#info-apis').show();
|
||||
$('#table-apis').hide();
|
||||
}
|
||||
|
||||
$("body").on('click','.refresh-apis',function(event){
|
||||
loadApis();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
var resource_server_form = $('#resource-server-form');
|
||||
|
||||
var api_form = $('#form-api');
|
||||
var api_dialog = $('#dialog-form-api');
|
||||
|
||||
api_dialog.modal({
|
||||
show:false,
|
||||
backdrop:"static"
|
||||
});
|
||||
|
||||
var resource_server_validator = resource_server_form.validate({
|
||||
rules: {
|
||||
"host" : {required: true, nowhitespace:true,rangelength: [1, 512]},
|
||||
"friendly_name": {required: true, free_text:true,rangelength: [1, 255]},
|
||||
"ip": {required: true, ipV4:true}
|
||||
}
|
||||
});
|
||||
|
||||
var api_validator = api_form.validate({
|
||||
rules: {
|
||||
"name" : {required: true, nowhitespace:true,rangelength: [1, 255]},
|
||||
"description": {required: true, free_text:true,rangelength: [1, 512]}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
api_dialog.on('hidden', function () {
|
||||
api_form.cleanForm();
|
||||
api_validator.resetForm();
|
||||
})
|
||||
|
||||
$("body").on('click','#save-api',function(event){
|
||||
var is_valid = api_form.valid();
|
||||
if (is_valid){
|
||||
var api = api_form.serializeForm();
|
||||
api.resource_server_id = resource_server_id;
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '{{URL::action("ApiController@create",null)}}',
|
||||
data: JSON.stringify(api),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadApis();
|
||||
api_dialog.modal('hide');
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
resource_server_form.submit(function( event ) {
|
||||
|
||||
var is_valid = resource_server_form.valid();
|
||||
|
||||
if (is_valid){
|
||||
resource_server_validator.resetForm();
|
||||
var resource_server = resource_server_form.serializeForm();
|
||||
var href = $(this).attr('action');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: href,
|
||||
data: JSON.stringify(resource_server),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
displaySuccessMessage('{{ Lang::get("messages.global_successfull_save_entity", array("entity" => "Resource Server")) }}',resource_server_form);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".add-api",function(event){
|
||||
api_dialog.modal('show');
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".api-active-checkbox",function(event){
|
||||
var active = $(this).is(':checked');
|
||||
var api_id = $(this).attr('data-api-id');
|
||||
var url = active?'{{ URL::action("ApiController@activate",array("id"=>"@id")) }}':'{{ URL::action("ApiController@deactivate",array("id"=>"@id")) }}';
|
||||
url = url.replace('@id',api_id);
|
||||
var verb = active?'PUT':'DELETE';
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("body").on('click',".delete-api",function(event){
|
||||
if(confirm("Are you sure? this would delete all related registered endpoints and associated scopes.")){
|
||||
var href = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: href,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadApis();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".regenerate-client-secret",function(event){
|
||||
if(confirm("Are you sure? Regenerating client secret would invalidate all current tokens")){
|
||||
var link = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
$('#client_secret').text(data.new_secret);
|
||||
//clean token UI
|
||||
$('#table-access-tokens').remove();
|
||||
$('#table-refresh-tokens').remove();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
var resourceServerMessages = {
|
||||
success : '{{ Lang::get("messages.global_successfull_save_entity", array("entity" => "Resource Server")) }}'
|
||||
};
|
||||
</script>
|
||||
{{ HTML::script('js/oauth2/profile/admin/edit-resource-server.js') }}
|
||||
@stop
|
|
@ -76,46 +76,9 @@
|
|||
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
var scope_form = $('#scope-form');
|
||||
|
||||
var scope_validator = scope_form.validate({
|
||||
rules: {
|
||||
"name" : {required: true, scopename:true,rangelength: [1, 512]},
|
||||
"short_description": {required: true, free_text:true,rangelength: [1, 512]},
|
||||
"description": {required: true, free_text:true,rangelength: [1, 1024]}
|
||||
}
|
||||
});
|
||||
|
||||
scope_form.submit(function( event ) {
|
||||
var is_valid = scope_form.valid();
|
||||
if (is_valid){
|
||||
scope_validator.resetForm();
|
||||
var scope = scope_form.serializeForm();
|
||||
var href = $(this).attr('action');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: href,
|
||||
data: JSON.stringify(scope),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
displaySuccessMessage('{{ Lang::get("messages.global_successfull_save_entity", array("entity" => "Scope")) }}',scope_form);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
var editScopeMessages = {
|
||||
success : '{{ Lang::get("messages.global_successfull_save_entity", array("entity" => "Scope")) }}'
|
||||
};
|
||||
</script>
|
||||
{{ HTML::script('js/oauth2/profile/admin/edit-scope.js') }}
|
||||
@stop
|
|
@ -89,163 +89,14 @@
|
|||
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
|
||||
function loadResourceServers(){
|
||||
var link = '{{URL::action("ApiResourceServerController@getByPage",array("offset"=>1,"limit"=>1000))}}';
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
var uris = data.page;
|
||||
var template = $('<tbody><tr><td class="fname"></td><td class="hname"></td><td class="ip"></td><td class="active"><input type="checkbox" class="resource-server-active-checkbox"></td><td> <a class="btn edit-resource-server" title="Edits a Registered Resource Server">Edit</a> <a class="btn delete-resource-server" title="Deletes a Registered Resource Server">Delete</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'resource_server<-context':{
|
||||
'td.fname':'resource_server.friendly_name',
|
||||
'td.hname':'resource_server.host',
|
||||
'td.ip':'resource_server.ip',
|
||||
'.resource-server-active-checkbox@value':'resource_server.id',
|
||||
'.resource-server-active-checkbox@checked':function(arg){
|
||||
return arg.item.active?'true':'';
|
||||
},
|
||||
'.resource-server-active-checkbox@data-resource-server-id':'resource_server.id',
|
||||
'.resource-server-active-checkbox@id':function(arg){
|
||||
var id = arg.item.id;
|
||||
return 'resource-server-active_'+id;
|
||||
},
|
||||
'a.edit-resource-server@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = '{{ URL::action("AdminController@editResourceServer",array("id"=>-1)) }}';
|
||||
return href.replace('-1',id);
|
||||
},
|
||||
'a.delete-resource-server@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = '{{ URL::action("ApiResourceServerController@delete",array("id"=>-1)) }}';
|
||||
return href.replace('-1',id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(uris, directives);
|
||||
$('#body-resource-servers').html(html.html());
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
//validation rules on new server form
|
||||
var resource_server_form = $('#form-resource-server');
|
||||
var dialog_resource_server = $('#dialog-form-resource-server');
|
||||
|
||||
var resource_server_validator = resource_server_form.validate({
|
||||
rules: {
|
||||
"host" : {required: true, nowhitespace:true,rangelength: [1, 512]},
|
||||
"friendly_name": {required: true, free_text:true,rangelength: [1, 255]},
|
||||
"ip": {required: true, ipV4:true}
|
||||
}
|
||||
});
|
||||
|
||||
dialog_resource_server.modal({
|
||||
show:false,
|
||||
backdrop:"static"
|
||||
});
|
||||
|
||||
dialog_resource_server.on('hidden', function () {
|
||||
resource_server_form.cleanForm();
|
||||
resource_server_validator.resetForm();
|
||||
})
|
||||
|
||||
$("body").on('click',".add-resource-server",function(event){
|
||||
dialog_resource_server.modal('show');
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".refresh-servers",function(event){
|
||||
loadResourceServers()
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$("body").on('click',".resource-server-active-checkbox",function(event){
|
||||
var active = $(this).is(':checked');
|
||||
var resource_server_id = $(this).attr('data-resource-server-id');
|
||||
var url = active? '{{ URL::action("ApiResourceServerController@activate",array("id"=>"@id")) }}':'{{ URL::action("ApiResourceServerController@deactivate",array("id"=>"@id")) }}';
|
||||
url = url.replace('@id',resource_server_id);
|
||||
var verb = active?'PUT':'DELETE';
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("body").on('click',"#save-resource-server",function(event){
|
||||
var is_valid = resource_server_form.valid();
|
||||
if (is_valid){
|
||||
var resource_server = resource_server_form.serializeForm();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '{{URL::action("ApiResourceServerController@create",null)}}',
|
||||
data: JSON.stringify(resource_server),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadResourceServers();
|
||||
dialog_resource_server.modal('hide');
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".delete-resource-server",function(event){
|
||||
if(confirm("Are you sure? this would delete all related registered apis, endpoints and associated scopes.")){
|
||||
var href = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: href,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadResourceServers();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
var resourceServerUrls = {
|
||||
get : '{{URL::action("ApiResourceServerController@getByPage",array("offset"=>1,"limit"=>1000))}}',
|
||||
edit : '{{ URL::action("AdminController@editResourceServer",array("id"=>-1)) }}',
|
||||
delete : '{{ URL::action("ApiResourceServerController@delete",array("id"=>-1)) }}',
|
||||
activate : '{{ URL::action("ApiResourceServerController@activate",array("id"=>"@id")) }}',
|
||||
deactivate : '{{ URL::action("ApiResourceServerController@deactivate",array("id"=>"@id")) }}',
|
||||
add : '{{URL::action("ApiResourceServerController@create",null)}}'
|
||||
};
|
||||
</script>
|
||||
{{ HTML::script('js/oauth2/profile/admin/resource-servers.js') }}
|
||||
@stop
|
|
@ -118,168 +118,15 @@ Service Account : The OpenstackId OAuth 2.0 Authorization Server supports server
|
|||
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
|
||||
function loadClients(){
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url: '{{ URL::action("ClientApiController@getByPage",array("offset"=>1,"limit"=>1000,"user_id"=>$user_id ))}}',
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
var clients = data.page;
|
||||
var template = $('<tbody><tr><td class="app-name"></td><td class="client-type"></td><td class="client-active"><input type="checkbox" class="app-active-checkbox"></td><td class="client-locked"><input type="checkbox" disabled="disabled" class="app-locked-checkbox"></td><td class="client-modified"></td><td class="client-actions"> <a class="btn edit-client" title="Edits a Registered Application">Edit</a> <a class="btn del-client" title="Deletes a Registered Application">Delete</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'client<-context':{
|
||||
'td.app-name':'client.app_name',
|
||||
'td.client-type':'client.application_type',
|
||||
'td.client-modified':'client.updated_at',
|
||||
'.app-active-checkbox@value':'client.id',
|
||||
'.app-active-checkbox@checked':function(arg){
|
||||
return arg.item.active?'true':'';
|
||||
},
|
||||
'.app-active-checkbox@id':function(arg){
|
||||
var client_id = arg.item.id;
|
||||
return 'app-active_'+client_id;
|
||||
},
|
||||
'.app-locked-checkbox@value':'client.id',
|
||||
'.app-locked-checkbox@id':function(arg){
|
||||
var client_id = arg.item.id;
|
||||
return 'app-locked_'+client_id;
|
||||
},
|
||||
'.app-locked-checkbox@checked':function(arg){
|
||||
return arg.item.locked?'true':'';
|
||||
},
|
||||
'a.edit-client@href':function(arg){
|
||||
var client_id = arg.item.id;
|
||||
var href = '{{ URL::action("AdminController@editRegisteredClient",array("id"=>"@id")) }}';
|
||||
return href.replace('@id',client_id);
|
||||
},
|
||||
'a.del-client@href':function(arg){
|
||||
var client_id = arg.item.id;
|
||||
var href = '{{ URL::action("ClientApiController@delete",array("id"=>"@id")) }}';
|
||||
return href.replace('@id',client_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var body = template.render(clients, directives);
|
||||
var table = $('<table id="tclients" class="table table-hover table-condensed"><thead><tr><th>Application Name</th><th>Type</th><th>Is Active</th><th>Is Locked</th><th>Modified</th><th> </th></tr></thead>'+body.html()+'</table>');
|
||||
$('#tclients','#clients').remove();
|
||||
$('#clients').append(table);
|
||||
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#oauth2-console','#main-menu').addClass('active');
|
||||
|
||||
var application_form = $('#form-application');
|
||||
var application_dialog = $("#dialog-form-application");
|
||||
var application_validator = application_form.validate({
|
||||
rules: {
|
||||
"app_name" : {required: true, nowhitespace:true,rangelength: [1, 255]},
|
||||
"app_description" : {required: true, free_text:true,rangelength: [1, 512]},
|
||||
"website" : {required:true,url:true}
|
||||
}
|
||||
});
|
||||
|
||||
application_dialog.modal({
|
||||
show:false,
|
||||
backdrop:"static"
|
||||
});
|
||||
|
||||
application_dialog.on('hidden', function () {
|
||||
application_form.cleanForm();
|
||||
application_validator.resetForm();
|
||||
})
|
||||
|
||||
$("body").on('click',".add-client",function(event){
|
||||
application_dialog.modal('show');
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',"#save-application",function(event){
|
||||
var is_valid = application_form.valid();
|
||||
if (is_valid){
|
||||
var application = application_form.serializeForm();
|
||||
application.user_id = {{$user_id}};
|
||||
var link = $(this).attr('href');
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '{{URL::action("ClientApiController@create",null)}}',
|
||||
data: JSON.stringify(application),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadClients();
|
||||
application_dialog.modal('hide');
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".del-client",function(event){
|
||||
if(confirm("Are you sure to delete this registered application?")){
|
||||
var url = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadClients();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".app-active-checkbox",function(event){
|
||||
var active = $(this).is(':checked');
|
||||
var client_id = $(this).attr('value');
|
||||
var url = active? '{{ URL::action("ClientApiController@activate",array("id"=>"@id")) }}':'{{ URL::action("ClientApiController@deactivate",array("id"=>"@id")) }}';
|
||||
url = url.replace('@id',client_id);
|
||||
var verb = active?'PUT':'DELETE';
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
var userId = {{$user_id}};
|
||||
var clientsUrls = {
|
||||
load:'{{ URL::action("ClientApiController@getByPage",array("offset"=>1,"limit"=>1000,"user_id"=>$user_id ))}}',
|
||||
edit:'{{ URL::action("AdminController@editRegisteredClient",array("id"=>"@id")) }}',
|
||||
delete:'{{ URL::action("ClientApiController@delete",array("id"=>"@id")) }}',
|
||||
add: '{{URL::action("ClientApiController@create",null)}}',
|
||||
activate : '{{ URL::action("ClientApiController@activate",array("id"=>"@id")) }}',
|
||||
deactivate:'{{ URL::action("ClientApiController@deactivate",array("id"=>"@id")) }}'
|
||||
};
|
||||
</script>
|
||||
@stop
|
||||
|
||||
{{ HTML::script('js/oauth2/profile/clients.js') }}
|
||||
@stop
|
|
@ -36,123 +36,14 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section('scripts')
|
||||
@parent
|
||||
<script type="application/javascript">
|
||||
|
||||
function loadAllowedClientOrigin(){
|
||||
var link = '{{URL::action("ClientApiController@geAllowedOrigins",array("id"=>$client->id))}}';
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
|
||||
var origins = data.allowed_origins;
|
||||
if(origins.length>0){
|
||||
var template = $('<tbody><tr><td class="origin-text"></td><td><a title="Deletes a Allowed Origin" class="btn del-allowed-origin">Delete</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'origin<-context':{
|
||||
'td.origin-text':'origin.allowed_origin',
|
||||
'a.del-allowed-origin@href':function(arg){
|
||||
var origin_id = arg.item.id;
|
||||
var href = '{{ URL::action("ClientApiController@deleteClientAllowedOrigin", array("id"=>$client->id,"uri_id"=>"@id")) }}';
|
||||
return href.replace('@id',origin_id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(origins, directives);
|
||||
$('#body-allowed-origins').html(html.html());
|
||||
$('#info-origins').hide();
|
||||
$('#table-origins').show();
|
||||
}
|
||||
else{
|
||||
$('#info-origins').show();
|
||||
$('#table-origins').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
if($('#table-origins tr').length===1){
|
||||
$('#info-origins').show();
|
||||
$('#table-origins').hide();
|
||||
}
|
||||
else{
|
||||
$('#info-origins').hide();
|
||||
$('#table-origins').show();
|
||||
}
|
||||
|
||||
var form_add_origin = $('#form-add-origin');
|
||||
|
||||
var add_origin_validator = form_add_origin.validate({
|
||||
rules: {
|
||||
"origin" :{required: true, ssl_uri: true}
|
||||
}
|
||||
});
|
||||
|
||||
$("body").on('click',".add-origin-client",function(event){
|
||||
var is_valid = form_add_origin.valid();
|
||||
if (is_valid){
|
||||
var link = $(this).attr('href');
|
||||
var origin = form_add_origin.serializeForm();
|
||||
form_add_origin.cleanForm();
|
||||
add_origin_validator.resetForm();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
data: JSON.stringify(origin),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
$('#origin').val('');
|
||||
loadAllowedClientOrigin();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".del-allowed-origin",function(event){
|
||||
|
||||
if(confirm("Are you sure?")){
|
||||
var link = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadAllowedClientOrigin();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
var clientOriginsUrls = {
|
||||
get : '{{URL::action("ClientApiController@geAllowedOrigins",array("id"=>$client->id))}}',
|
||||
delete: '{{ URL::action("ClientApiController@deleteClientAllowedOrigin", array("id"=>$client->id,"uri_id"=>"@id")) }}'
|
||||
};
|
||||
</script>
|
||||
{{ HTML::script('js/oauth2/profile/edit-client-allowed-origins.js') }}
|
||||
@stop
|
|
@ -51,78 +51,14 @@
|
|||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section('scripts')
|
||||
@parent
|
||||
<script type="application/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$("body").on('click',".regenerate-client-secret",function(event){
|
||||
if(confirm("Are you sure? Regenerating client secret would invalidate all current tokens")){
|
||||
var link = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
$('#client_secret').text(data.new_secret);
|
||||
//clean token UI
|
||||
$('#table-access-tokens').remove();
|
||||
$('#table-refresh-tokens').remove();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',"#use-refresh-token",function(event){
|
||||
var param = {};
|
||||
param.use_refresh_token = $(this).is(':checked');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: '{{URL::action("ClientApiController@setRefreshTokenClient",array("id"=>$client->id))}}',
|
||||
data: JSON.stringify(param),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("body").on('click',"#use-rotate-refresh-token-policy",function(event){
|
||||
var param = {};
|
||||
param.rotate_refresh_token = $(this).is(':checked');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: '{{URL::action("ClientApiController@setRotateRefreshTokenPolicy",array("id"=>$client->id))}}',
|
||||
data: JSON.stringify(param),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
var dataClientUrls = {
|
||||
refresh: '{{URL::action("ClientApiController@setRefreshTokenClient",array("id"=>$client->id))}}',
|
||||
rotate: '{{URL::action("ClientApiController@setRotateRefreshTokenPolicy",array("id"=>$client->id))}}'
|
||||
};
|
||||
</script>
|
||||
@stop
|
||||
{{ HTML::script('js/oauth2/profile/edit-client-data.js') }}
|
||||
@stop
|
|
@ -38,118 +38,10 @@
|
|||
@section('scripts')
|
||||
@parent
|
||||
<script type="application/javascript">
|
||||
|
||||
function loadAllowedClientUris(){
|
||||
var link = '{{URL::action("ClientApiController@getRegisteredUris",array("id"=>$client->id))}}';
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
var uris = data.allowed_uris;
|
||||
if(uris.length>0){
|
||||
var template = $('<tbody><tr><td class="uri-text"></td><td><a title="Deletes a Allowed Uri" class="btn del-allowed-uri">Delete</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'uri<-context':{
|
||||
'td.uri-text':'uri.uri',
|
||||
'a.del-allowed-uri@href':function(arg){
|
||||
var uri_id = arg.item.id;
|
||||
var href = '{{ URL::action("ClientApiController@deleteClientAllowedUri", array("id"=>$client->id,"uri_id"=>"-1")) }}';
|
||||
return href.replace('-1',uri_id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(uris, directives);
|
||||
$('#body-allowed-uris').html(html.html());
|
||||
$('#info-uris').hide();
|
||||
$('#table-uris').show();
|
||||
}
|
||||
else{
|
||||
$('#info-uris').show();
|
||||
$('#table-uris').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
if($('#table-uris tr').length===1){
|
||||
$('#info-uris').show();
|
||||
$('#table-uris').hide();
|
||||
}
|
||||
else{
|
||||
$('#info-uris').hide();
|
||||
$('#table-uris').show();
|
||||
}
|
||||
|
||||
var form_add_redirect_uri = $('#form-add-uri');
|
||||
|
||||
var add_redirect_uri_validator = form_add_redirect_uri.validate({
|
||||
rules: {
|
||||
"redirect_uri" :{required: true, ssl_uri: true}
|
||||
}
|
||||
});
|
||||
|
||||
$("body").on('click',".add-uri-client",function(event){
|
||||
var is_valid = form_add_redirect_uri.valid();
|
||||
if (is_valid){
|
||||
var link = $(this).attr('href');
|
||||
var uri = form_add_redirect_uri.serializeForm();
|
||||
form_add_redirect_uri.cleanForm();
|
||||
add_redirect_uri_validator.resetForm();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
data: JSON.stringify(uri),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
$('#redirect_uri').val('');
|
||||
loadAllowedClientUris();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".del-allowed-uri",function(event){
|
||||
|
||||
if(confirm("Are you sure?")){
|
||||
var link = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadAllowedClientUris();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
var clientUrisUrls = {
|
||||
get : '{{URL::action("ClientApiController@getRegisteredUris",array("id"=>$client->id))}}',
|
||||
delete :'{{ URL::action("ClientApiController@deleteClientAllowedUri", array("id"=>$client->id,"uri_id"=>"-1")) }}'
|
||||
};
|
||||
</script>
|
||||
{{ HTML::script('js/oauth2/profile/edit-client-redirect-uris.js') }}
|
||||
@stop
|
|
@ -43,35 +43,10 @@
|
|||
@section('scripts')
|
||||
@parent
|
||||
<script type="application/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("body").on('click',".scope-checkbox",function(event){
|
||||
var add_url = '{{URL::action("ClientApiController@addAllowedScope",array("id"=>$client->id,"scope_id"=>"@scope_id"))}}';
|
||||
var remove_url = '{{URL::action("ClientApiController@removeAllowedScope",array("id"=>$client->id,"scope_id"=>"@scope_id"))}}';
|
||||
var scope_id = $(this).attr('value');
|
||||
var checked = $(this).is(':checked');
|
||||
var url = checked?add_url:remove_url;
|
||||
url = url.replace('@scope_id',scope_id);
|
||||
var verb = checked?'PUT':'DELETE';
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var clientScopesUrls = {
|
||||
add:'{{URL::action("ClientApiController@addAllowedScope",array("id"=>$client->id,"scope_id"=>"@scope_id"))}}',
|
||||
delete:'{{URL::action("ClientApiController@removeAllowedScope",array("id"=>$client->id,"scope_id"=>"@scope_id"))}}'
|
||||
};
|
||||
</script>
|
||||
{{ HTML::script('js/oauth2/profile/edit-client-scopes.js') }}
|
||||
@stop
|
|
@ -61,178 +61,16 @@
|
|||
@section('scripts')
|
||||
@parent
|
||||
<script type="application/javascript">
|
||||
|
||||
function updateAccessTokenList(){
|
||||
//reload access tokens
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url:'{{ URL::action("ClientApiController@getAccessTokens",array("id"=>$client->id))}}' ,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
|
||||
if(data.access_tokens.length===0){
|
||||
$('#table-access-tokens').hide();
|
||||
$('#info-access-tokens').show();
|
||||
}
|
||||
else{
|
||||
$('#info-access-tokens').hide();
|
||||
$('#table-access-tokens').show();
|
||||
var template = $('<tbody><tr><td class="issued"></td><td class="scope"></td><td class="lifetime"></td><td><a title="Revoke Access Token" class="btn revoke-token revoke-access-token" data-hint="access-token">Revoke</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'token<-context':{
|
||||
'@id' :'token.value',
|
||||
'td.issued' :'token.issued',
|
||||
'td.scope' :'token.scope',
|
||||
'td.lifetime':'token.lifetime',
|
||||
'a@href':function(arg){
|
||||
var token_value = arg.item.value;
|
||||
var href = '{{ URL::action("ClientApiController@revokeToken",array("id"=>$client->id,"value"=>-1,"hint"=>"access-token")) }}';
|
||||
return href.replace('-1',token_value);
|
||||
},
|
||||
'a@data-value' :'token.value'
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(data.access_tokens, directives);
|
||||
$('#body-access-tokens').html(html.html());
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateRefreshTokenList(){
|
||||
//reload access tokens
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url:'{{ URL::action("ClientApiController@getRefreshTokens",array("id"=>$client->id))}}' ,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
|
||||
if(data.refresh_tokens.length===0){
|
||||
$('#table-refresh-tokens').hide();
|
||||
$('#info-refresh-tokens').show();
|
||||
}
|
||||
else{
|
||||
$('#info-refresh-tokens').hide();
|
||||
$('#table-refresh-tokens').show();
|
||||
var template = $('<tbody><tr><td class="issued"></td><td class="scope"></td><td class="lifetime"></td><td><a title="Revoke Refresh Token" class="btn revoke-token revoke-refresh-token" data-hint="refresh-token">Revoke</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'token<-context':{
|
||||
'@id' :'token.value',
|
||||
'td.issued' :'token.issued',
|
||||
'td.scope' :'token.scope',
|
||||
'td.lifetime':function(arg){
|
||||
var token_lifetime = arg.item.lifetime;
|
||||
return token_lifetime===0?'Not Expire':token_lifetime;
|
||||
},
|
||||
'a@href':function(arg){
|
||||
var token_value = arg.item.value;
|
||||
var href = '{{ URL::action("ClientApiController@revokeToken",array("id"=>$client->id,"value"=>-1,"hint"=>"refresh-token")) }}';
|
||||
return href.replace('-1',token_value);
|
||||
},
|
||||
'a@data-value' :'token.value'
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(data.refresh_tokens, directives);
|
||||
$('#body-refresh-tokens').html(html.html());
|
||||
updateAccessTokenList();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
if($('#table-access-tokens tr').length===1){
|
||||
$('#info-access-tokens').show();
|
||||
$('#table-access-tokens').hide();
|
||||
}
|
||||
else{
|
||||
$('#info-access-tokens').hide();
|
||||
$('#table-access-tokens').show();
|
||||
}
|
||||
|
||||
if($('#table-refresh-tokens tr').length===1){
|
||||
$('#info-refresh-tokens').show();
|
||||
$('#table-refresh-tokens').hide();
|
||||
}
|
||||
else{
|
||||
$('#info-refresh-tokens').hide();
|
||||
$('#table-refresh-tokens').show();
|
||||
}
|
||||
|
||||
$("body").on('click','.refresh-refresh-tokens',function(event){
|
||||
updateRefreshTokenList();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click','.refresh-access-tokens',function(event){
|
||||
updateAccessTokenList();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".revoke-token",function(event){
|
||||
|
||||
var link = $(this);
|
||||
var value = link.attr('data-value');
|
||||
var hint = link.attr('data-hint');
|
||||
var url = link.attr('href');
|
||||
var table_id = hint ==='refresh-token'? 'table-refresh-tokens':'table-access-tokens';
|
||||
var info_id = hint ==='refresh-token'? 'info-refresh-tokens':'info-access-tokens';
|
||||
var confirm_msg = hint ==='refresh-token'? 'Are you sure?, revoking this refresh token also will become void all related Access Tokens':'Are you sure?';
|
||||
if(confirm(confirm_msg)){
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
var row = $('#'+value);
|
||||
row.remove();
|
||||
var row_qty = $('#'+table_id+' tr').length;
|
||||
if(row_qty===1){ //only we have the header ...
|
||||
$('#'+table_id).hide();
|
||||
$('#'+info_id).show();
|
||||
}
|
||||
if(hint=='refresh-token'){
|
||||
updateAccessTokenList();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
var TokensUrls = {
|
||||
AccessTokenUrls : {
|
||||
get : '{{ URL::action("ClientApiController@getAccessTokens",array("id"=>$client->id))}}',
|
||||
delete :'{{ URL::action("ClientApiController@revokeToken",array("id"=>$client->id,"value"=>-1,"hint"=>"access-token")) }}'
|
||||
},
|
||||
RefreshTokenUrl : {
|
||||
get: '{{ URL::action("ClientApiController@getRefreshTokens",array("id"=>$client->id))}}',
|
||||
delete : '{{ URL::action("ClientApiController@revokeToken",array("id"=>$client->id,"value"=>-1,"hint"=>"refresh-token")) }}'
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@stop
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{{ HTML::script('js/oauth2/profile/edit-client-tokens.js') }}
|
||||
@stop
|
|
@ -56,61 +56,5 @@
|
|||
<span id="info-refresh-tokens" class="label label-info">** There are not currently refresh tokens issued for this user.</span>
|
||||
@stop
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#oauth2-console','#main-menu').addClass('active');
|
||||
|
||||
if($('#table-access-tokens tr').length===1){
|
||||
$('#info-access-tokens').show();
|
||||
$('#table-access-tokens').hide();
|
||||
}
|
||||
else{
|
||||
$('#info-access-tokens').hide();
|
||||
$('#table-access-tokens').show();
|
||||
}
|
||||
|
||||
if($('#table-refresh-tokens tr').length===1){
|
||||
$('#info-refresh-tokens').show();
|
||||
$('#table-refresh-tokens').hide();
|
||||
}
|
||||
else{
|
||||
$('#info-refresh-tokens').hide();
|
||||
$('#table-refresh-tokens').show();
|
||||
}
|
||||
|
||||
$("body").on('click',".revoke-access",function(event){
|
||||
if(confirm("Are you sure to revoke this grant?")){
|
||||
var url = $(this).attr('href');
|
||||
var value = $(this).attr('data-value');
|
||||
var hint = $(this).attr('data-hint');
|
||||
var body = hint=='access_token'?'body-access-tokens':'body-refresh-tokens'
|
||||
var table = hint=='access_token'?'table-access-tokens':'table-refresh-tokens'
|
||||
var info = hint=='access_token'?'info-access-tokens':'info-refresh-tokens'
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
$('#'+value,'#'+body).remove();
|
||||
|
||||
if($('#'+table+' tr').length===1){
|
||||
$('#'+info).show();
|
||||
$('#'+table).hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ HTML::script('js/oauth2/profile/edit-user-grants.js') }}
|
||||
@stop
|
|
@ -47,19 +47,6 @@ Welcome, <a href="{{ URL::action("UserController@getProfile") }}">{{Auth::user()
|
|||
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
$(document).ready(function() {
|
||||
$("body").on('click',"#cancel_authorization",function(event){
|
||||
$form = $('#authorization_form');
|
||||
$("#deny_once").prop("checked", true)
|
||||
$form.submit();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@stop
|
||||
|
||||
|
||||
{{ HTML::script('js/openid/consent.js') }}
|
||||
@stop
|
|
@ -1,7 +1,7 @@
|
|||
@extends('layout')
|
||||
|
||||
@section('title')
|
||||
<title>Welcome to openstackId - Edit Profile</title>
|
||||
<title>Welcome to openstackId - OpenStack ID Account Settings</title>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
|
@ -21,7 +21,7 @@
|
|||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
{{ Form::open(array('url' => URL::action('UserController@postUserProfileOptions'), 'method' => 'post')) }}
|
||||
<legend><i class="icon-info-sign accordion-toggle" title="this information will be public on your profile page"></i> Edit your profile options:</legend>
|
||||
<legend><i class="icon-info-sign accordion-toggle" title="this information will be public on your profile page"></i> OpenStack ID Account Settings:</legend>
|
||||
<fieldset>
|
||||
<label class="checkbox">
|
||||
{{ Form::checkbox('show_full_name', '1', $show_full_name) }}Show Full Name
|
||||
|
@ -110,12 +110,10 @@
|
|||
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
<script type="application/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#profile','#main-menu').addClass('active');
|
||||
});
|
||||
</script>
|
||||
@stop
|
||||
|
||||
@stop
|
|
@ -0,0 +1,42 @@
|
|||
jQuery(document).ready(function($){
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
if($('#ips-table tr').length===1){
|
||||
$('#ips-info').show();
|
||||
$('#ips-table').hide();
|
||||
}
|
||||
else{
|
||||
$('#ips-info').hide();
|
||||
$('#ips-table').show();
|
||||
}
|
||||
|
||||
$("body").on('click',".revoke-ip",function(event){
|
||||
if(confirm("Are you sure that you want to revoke this banned ip?")){
|
||||
var url = $(this).attr('href');
|
||||
var ip_id = $(this).attr('data-ip-id');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
$('#'+ip_id,'#body-ips').remove();
|
||||
|
||||
if($('#ips-table tr').length===1){
|
||||
$('#ips-info').show();
|
||||
$('#ips-table').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -0,0 +1,29 @@
|
|||
jQuery(document).ready(function($){
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
var form_server_config = $("#form-server-configuration");
|
||||
|
||||
var server_config_validation = form_server_config.validate({
|
||||
rules: {
|
||||
"general-max-failed-login-attempts" : {required: true, number: true },
|
||||
"general-max-failed-login-attempts-captcha" : {required: true, number: true },
|
||||
"openid-private-association-lifetime" : {required: true, number: true },
|
||||
"openid-session-association-lifetime" : {required: true, number: true },
|
||||
"openid-nonce-lifetime" : {required: true, number: true },
|
||||
"oauth2-auth-code-lifetime" : {required: true, number: true },
|
||||
"oauth2-refresh-token-lifetime" : {required: true, number: true },
|
||||
"oauth2-access-token-lifetime" : {required: true, number: true }
|
||||
}
|
||||
});
|
||||
|
||||
form_server_config.submit(function( event ) {
|
||||
var is_valid = form_server_config.valid();
|
||||
if (is_valid){
|
||||
server_config_validation.resetForm();
|
||||
return true;
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -0,0 +1,41 @@
|
|||
$(document).ready(function() {
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
if($('#users-table tr').length===1){
|
||||
$('#users-info').show();
|
||||
$('#users-table').hide();
|
||||
}
|
||||
else{
|
||||
$('#users-info').hide();
|
||||
$('#users-table').show();
|
||||
}
|
||||
|
||||
$("body").on('click',".unlock-user",function(event){
|
||||
if(confirm("Are you sure that you want to unlock this User?")){
|
||||
var url = $(this).attr('href');
|
||||
var user_id = $(this).attr('data-user-id');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
$('#'+user_id,'#body-locked-users').remove();
|
||||
|
||||
if($('#users-table tr').length===1){
|
||||
$('#users-info').show();
|
||||
$('#users-table').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -0,0 +1,31 @@
|
|||
jQuery(document).ready(function($){
|
||||
|
||||
$('.icon-info-sign').popover({html:true,placement:'bottom'});
|
||||
|
||||
$(':not(#anything)').on('click', function (e) {
|
||||
$('.icon-info-sign').each(function () {
|
||||
//the 'is' for buttons that trigger popups
|
||||
//the 'has' for icons and other elements within a button that triggers a popup
|
||||
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
|
||||
$(this).popover('hide');
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click',"#cancel-authorization",function(event){
|
||||
$form = $('#authorization_form');
|
||||
$('#trust').attr('value','DenyOnce');
|
||||
$form.submit();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',"#approve-authorization",function(event){
|
||||
$form = $('#authorization_form');
|
||||
$('#trust').attr('value','AllowOnce');
|
||||
$form.submit();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -0,0 +1,42 @@
|
|||
jQuery(document).ready(function($){
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
if($('#clients-table tr').length===1){
|
||||
$('#clients-info').show();
|
||||
$('#clients-table').hide();
|
||||
}
|
||||
else{
|
||||
$('#clients-info').hide();
|
||||
$('#clients-table').show();
|
||||
}
|
||||
|
||||
$("body").on('click',".unlock-client",function(event){
|
||||
if(confirm("Are you sure that you want to unlock this OAUTH2 Client?")){
|
||||
var url = $(this).attr('href');
|
||||
var client_id = $(this).attr('data-client-id');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
$('#'+client_id,'#body-locked-clients').remove();
|
||||
|
||||
if($('#clients-table tr').length===1){
|
||||
$('#clients-info').show();
|
||||
$('#clients-table').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -0,0 +1,459 @@
|
|||
function loadScopes(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: scopesUrls.get,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
var scopes = data.page;
|
||||
if(scopes.length>0){
|
||||
$('#info-scopes').hide();
|
||||
$('#table-scopes').show();
|
||||
var template = $('<tbody><tr>' +
|
||||
'<td class="name"></td>' +
|
||||
'<td class="active"><input type="checkbox" class="scope-active-checkbox"></td>' +
|
||||
'<td class="default"><input type="checkbox" class="scope-default-checkbox"></td>' +
|
||||
'<td class="system"><input type="checkbox" class="scope-system-checkbox"></td>' +
|
||||
'<td> ' +
|
||||
'<a class="btn edit-scope" title="Edits a Registered API Scope">Edit</a> ' +
|
||||
'<a class="btn delete-scope" title="Deletes a Registered API Scope">Delete</a>' +
|
||||
'</td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'scope<-context':{
|
||||
'td.name':'scope.name',
|
||||
//active
|
||||
'.scope-active-checkbox@value':'scope.id',
|
||||
'.scope-active-checkbox@checked':function(arg){
|
||||
return arg.item.active?'true':'';
|
||||
},
|
||||
'.scope-active-checkbox@id':function(arg){
|
||||
var id = arg.item.id;
|
||||
return 'scope-active_'+id;
|
||||
},
|
||||
'.scope-active-checkbox@data-scope-id':'scope.id',
|
||||
//default
|
||||
'.scope-default-checkbox@value':'scope.id',
|
||||
'.scope-default-checkbox@checked':function(arg){
|
||||
return arg.item.default?'true':'';
|
||||
},
|
||||
'.scope-default-checkbox@id':function(arg){
|
||||
var id = arg.item.id;
|
||||
return 'scope-default_'+id;
|
||||
},
|
||||
'.scope-default-checkbox@data-scope-id':'scope.id',
|
||||
//system
|
||||
'.scope-system-checkbox@value':'scope.id',
|
||||
'.scope-system-checkbox@checked':function(arg){
|
||||
return arg.item.system?'true':'';
|
||||
},
|
||||
'.scope-system-checkbox@id':function(arg){
|
||||
var id = arg.item.id;
|
||||
return 'scope-system_'+id;
|
||||
},
|
||||
'.scope-system-checkbox@data-scope-id':'scope.id',
|
||||
//buttons
|
||||
'a.edit-scope@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = scopesUrls.edit;
|
||||
return href.replace('@id',id);
|
||||
},
|
||||
'a.delete-scope@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = scopesUrls.delete;
|
||||
return href.replace('@id',id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(scopes, directives);
|
||||
$('#body-scopes').html(html.html());
|
||||
}
|
||||
else{
|
||||
$('#info-scopes').show();
|
||||
$('#table-scopes').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadEndpoints(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: endpointUrls.get,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
var endpoints = data.page;
|
||||
if(endpoints.length>0){
|
||||
$('#info-endpoints').hide();
|
||||
$('#table-endpoints').show();
|
||||
var template = $('<tbody><tr>' +
|
||||
'<td class="name"></td>' +
|
||||
'<td class="active"><input type="checkbox" class="endpoint-active-checkbox"></td>' +
|
||||
'<td class="route"></td>' +
|
||||
'<td class="method"></td>' +
|
||||
'<td> ' +
|
||||
'<a class="btn edit-endpoint" title="Edits a Registered API Endpoint">Edit</a> ' +
|
||||
'<a class="btn delete-endpoint" title="Deletes a Registered API Endpoint">Delete</a>' +
|
||||
'</td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'endpoint<-context':{
|
||||
'td.name':'endpoint.name',
|
||||
'td.route':'endpoint.route',
|
||||
'td.method':'endpoint.http_method',
|
||||
//active
|
||||
'.endpoint-active-checkbox@value':'scope.id',
|
||||
'.endpoint-active-checkbox@checked':function(arg){
|
||||
return arg.item.active?'true':'';
|
||||
},
|
||||
'.endpoint-active-checkbox@id':function(arg){
|
||||
var id = arg.item.id;
|
||||
return 'endpoint-active_'+id;
|
||||
},
|
||||
'.endpoint-active-checkbox@data-endpoint-id':'endpoint.id',
|
||||
//buttons
|
||||
'a.edit-endpoint@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = endpointUrls.edit;
|
||||
return href.replace('@id',id);
|
||||
},
|
||||
'a.delete-endpoint@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = endpointUrls.delete;
|
||||
return href.replace('@id',id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(endpoints, directives);
|
||||
$('#body-endpoints').html(html.html());
|
||||
}
|
||||
else{
|
||||
$('#info-endpoints').show();
|
||||
$('#table-endpoints').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
var api_form = $('#api-form');
|
||||
var api_validator = api_form.validate({
|
||||
rules: {
|
||||
"name" : {required: true, nowhitespace:true,rangelength: [1, 255]},
|
||||
"description": {required: true, free_text:true,rangelength: [1, 512]}
|
||||
}
|
||||
});
|
||||
|
||||
api_form.submit(function( event ) {
|
||||
var is_valid = api_form.valid();
|
||||
if (is_valid){
|
||||
api_validator.resetForm();
|
||||
var api = api_form.serializeForm();
|
||||
var href = $(this).attr('action');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: href,
|
||||
data: JSON.stringify(api),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
displaySuccessMessage('{{ Lang::get("messages.global_successfull_save_entity", array("entity" => "API")) }}',api_form);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
//scopes
|
||||
|
||||
if($('#table-scopes tr').length===1){
|
||||
$('#info-scopes').show();
|
||||
$('#table-scopes').hide();
|
||||
}
|
||||
|
||||
|
||||
$("body").on('click','.scope-active-checkbox',function(event){
|
||||
var id = $(this).attr('data-scope-id');
|
||||
var active = $(this).is(':checked');
|
||||
|
||||
var url = active? scopesUrls.activate : scopesUrls.deactivate;
|
||||
url = url.replace('@id',id);
|
||||
var verb = active?'PUT':'DELETE'
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("body").on('click','.scope-default-checkbox',function(event){
|
||||
var id = $(this).attr('data-scope-id');
|
||||
var is_default = $(this).is(':checked');
|
||||
|
||||
var scope = { id : id, default:is_default};
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: scopesUrls.update,
|
||||
data: JSON.stringify(scope),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("body").on('click','.scope-system-checkbox',function(event){
|
||||
var id = $(this).attr('data-scope-id');
|
||||
var is_system = $(this).is(':checked');
|
||||
|
||||
var scope = { id : id, system:is_system};
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: scopesUrls.update,
|
||||
data: JSON.stringify(scope),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
$("body").on('click','.refresh-scopes',function(event){
|
||||
loadScopes();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
var scope_dialog = $('#dialog-form-scope');
|
||||
var scope_form = $('#form-scope');
|
||||
|
||||
var scope_validator = scope_form.validate({
|
||||
rules: {
|
||||
"name" : {required: true, scopename:true,rangelength: [1, 512]},
|
||||
"short_description": {required: true, free_text:true,rangelength: [1, 512]},
|
||||
"description": {required: true, free_text:true,rangelength: [1, 1024]}
|
||||
}
|
||||
});
|
||||
|
||||
scope_dialog.modal({
|
||||
show:false,
|
||||
backdrop:"static"
|
||||
});
|
||||
|
||||
scope_dialog.on('hidden', function () {
|
||||
scope_form.cleanForm();
|
||||
scope_validator.resetForm();
|
||||
})
|
||||
|
||||
$("body").on('click',".add-scope",function(event){
|
||||
scope_dialog.modal('show');
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',"#save-scope",function(event){
|
||||
var is_valid = scope_form.valid();
|
||||
if (is_valid){
|
||||
var scope = scope_form.serializeForm();
|
||||
scope.api_id = api_id;
|
||||
$.ajax(
|
||||
{
|
||||
type: "POST",
|
||||
url: scopesUrls.add,
|
||||
data: JSON.stringify(scope),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadScopes();
|
||||
scope_dialog.modal('hide');
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".delete-scope",function(event){
|
||||
if(confirm("Are you sure? this will delete all application assigned scopes and all endpoints assigned scopes too.")){
|
||||
var url = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadScopes();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
//endpoints
|
||||
|
||||
var endpoint_dialog = $('#dialog-form-endpoint');
|
||||
var endpoint_form = $('#form-endpoint');
|
||||
|
||||
if($('#table-endpoints tr').length===1){
|
||||
$('#info-endpoints').show();
|
||||
$('#table-endpoints').hide();
|
||||
}
|
||||
|
||||
$("body").on('click','.endpoint-active-checkbox',function(event){
|
||||
var id = $(this).attr('data-endpoint-id');
|
||||
var active = $(this).is(':checked');
|
||||
var url = active? endpointUrls.activate : endpointUrls.deactivate;
|
||||
url = url.replace('@id',id);
|
||||
var verb = active?'PUT':'DELETE';
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("body").on('click','.refresh-endpoints',function(event){
|
||||
loadEndpoints();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
var endpoint_validator = endpoint_form.validate({
|
||||
rules: {
|
||||
"name" : {required: true, nowhitespace:true,rangelength: [1, 255]},
|
||||
"description":{required: true, free_text:true,rangelength: [1, 1024]},
|
||||
"route": {required: true,endpointroute:true,rangelength: [1, 1024]}
|
||||
}
|
||||
});
|
||||
|
||||
endpoint_dialog.modal({
|
||||
show:false,
|
||||
backdrop:"static"
|
||||
});
|
||||
|
||||
endpoint_dialog.on('hidden', function () {
|
||||
endpoint_form.cleanForm();
|
||||
endpoint_validator.resetForm();
|
||||
})
|
||||
|
||||
$("body").on('click',".add-endpoint",function(event){
|
||||
endpoint_dialog.modal('show');
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',"#save-endpoint",function(event){
|
||||
var is_valid = endpoint_form.valid();
|
||||
if (is_valid){
|
||||
var endpoint = endpoint_form.serializeForm();
|
||||
endpoint.api_id = api_id;
|
||||
$.ajax(
|
||||
{
|
||||
type: "POST",
|
||||
url: endpointUrls.add,
|
||||
data: JSON.stringify(endpoint),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadEndpoints();
|
||||
endpoint_dialog.modal('hide');
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".delete-endpoint",function(event){
|
||||
if(confirm("Are you sure? this will delete the selected endpoint.")){
|
||||
var url = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadEndpoints();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -0,0 +1,63 @@
|
|||
jQuery(document).ready(function($){
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
var endpoint_form = $('#endpoint-form');
|
||||
|
||||
var endpoint_validator = endpoint_form.validate({
|
||||
rules: {
|
||||
"name" : {required: true, nowhitespace:true,rangelength: [1, 255]},
|
||||
"description":{required: true, free_text:true,rangelength: [1, 1024]},
|
||||
"route": {required: true, endpointroute:true,rangelength: [1, 1024]}
|
||||
}
|
||||
});
|
||||
|
||||
endpoint_form.submit(function( event ) {
|
||||
var is_valid = endpoint_form.valid();
|
||||
if (is_valid){
|
||||
endpoint_validator.resetForm();
|
||||
var endpoint = endpoint_form.serializeForm();
|
||||
var href = $(this).attr('action');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: href,
|
||||
data: JSON.stringify(endpoint),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
displaySuccessMessage(editEndpointMessages.success , endpoint_form);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
//scopes associations
|
||||
$("body").on('click',".scope-checkbox",function(event){
|
||||
var add_link = $(this).attr('data-add-link');
|
||||
var del_link = $(this).attr('data-remove-link');
|
||||
var checked = $(this).is(':checked');
|
||||
var url = checked?add_link:del_link;
|
||||
var verb = checked?'PUT':'DELETE';
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,235 @@
|
|||
|
||||
function loadApis(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ApiUrls.get,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
var apis = data.page;
|
||||
if(apis.length>0){
|
||||
$('#info-apis').hide();
|
||||
$('#table-apis').show();
|
||||
var template = $('<tbody><tr><td class="image"><img height="24" width="24"/></td><td class="name"></td><td class="active"><input type="checkbox" class="api-active-checkbox"></td><td> <a class="btn edit-api" title="Edits a Registered Resource Server API">Edit</a> <a class="btn delete-api" title="Deletes a Registered Resource Server API">Delete</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'api<-context':{
|
||||
'img@src':function(arg){
|
||||
var logo = arg.item.logo;
|
||||
if(logo == null || logo=='') logo = "{{asset('img/apis/server.png');}}";
|
||||
return logo;
|
||||
},
|
||||
'img@alt':'api.name',
|
||||
'td.name':'api.name',
|
||||
'.api-active-checkbox@value':'api.id',
|
||||
'.api-active-checkbox@checked':function(arg){
|
||||
return arg.item.active?'true':'';
|
||||
},
|
||||
'.api-active-checkbox@id':function(arg){
|
||||
var id = arg.item.id;
|
||||
return 'resource-server-api-active_'+id;
|
||||
},
|
||||
'.api-active-checkbox@data-api-id':'api.id',
|
||||
'a.edit-api@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = ApiUrls.edit;
|
||||
return href.replace('-1',id);
|
||||
},
|
||||
'a.delete-api@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = ApiUrls.delete;
|
||||
return href.replace('-1',id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(apis, directives);
|
||||
$('#body-apis').html(html.html());
|
||||
}
|
||||
else{
|
||||
$('#info-apis').show();
|
||||
$('#table-apis').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
if($('#table-apis tr').length===1){
|
||||
$('#info-apis').show();
|
||||
$('#table-apis').hide();
|
||||
}
|
||||
|
||||
$("body").on('click','.refresh-apis',function(event){
|
||||
loadApis();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
var resource_server_form = $('#resource-server-form');
|
||||
|
||||
var api_form = $('#form-api');
|
||||
var api_dialog = $('#dialog-form-api');
|
||||
|
||||
api_dialog.modal({
|
||||
show:false,
|
||||
backdrop:"static"
|
||||
});
|
||||
|
||||
var resource_server_validator = resource_server_form.validate({
|
||||
rules: {
|
||||
"host" : {required: true, nowhitespace:true,rangelength: [1, 512]},
|
||||
"friendly_name": {required: true, free_text:true,rangelength: [1, 255]},
|
||||
"ip": {required: true, ipV4:true}
|
||||
}
|
||||
});
|
||||
|
||||
var api_validator = api_form.validate({
|
||||
rules: {
|
||||
"name" : {required: true, nowhitespace:true,rangelength: [1, 255]},
|
||||
"description": {required: true, free_text:true,rangelength: [1, 512]}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
api_dialog.on('hidden', function () {
|
||||
api_form.cleanForm();
|
||||
api_validator.resetForm();
|
||||
})
|
||||
|
||||
$("body").on('click','#save-api',function(event){
|
||||
var is_valid = api_form.valid();
|
||||
if (is_valid){
|
||||
var api = api_form.serializeForm();
|
||||
api.resource_server_id = resource_server_id;
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ApiUrls.add,
|
||||
data: JSON.stringify(api),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadApis();
|
||||
api_dialog.modal('hide');
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
resource_server_form.submit(function( event ) {
|
||||
|
||||
var is_valid = resource_server_form.valid();
|
||||
|
||||
if (is_valid){
|
||||
resource_server_validator.resetForm();
|
||||
var resource_server = resource_server_form.serializeForm();
|
||||
var href = $(this).attr('action');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: href,
|
||||
data: JSON.stringify(resource_server),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
displaySuccessMessage(resourceServerMessages.success , resource_server_form);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".add-api",function(event){
|
||||
api_dialog.modal('show');
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".api-active-checkbox",function(event){
|
||||
var active = $(this).is(':checked');
|
||||
var api_id = $(this).attr('data-api-id');
|
||||
var url = active? ApiUrls.activate : ApiUrls.deactivate;
|
||||
url = url.replace('@id',api_id);
|
||||
var verb = active?'PUT':'DELETE';
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("body").on('click',".delete-api",function(event){
|
||||
if(confirm("Are you sure? this would delete all related registered endpoints and associated scopes.")){
|
||||
var href = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: href,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadApis();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".regenerate-client-secret",function(event){
|
||||
if(confirm("Are you sure? Regenerating client secret would invalidate all current tokens")){
|
||||
var link = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
$('#client_secret').text(data.new_secret);
|
||||
//clean token UI
|
||||
$('#table-access-tokens').remove();
|
||||
$('#table-refresh-tokens').remove();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -0,0 +1,41 @@
|
|||
$(document).ready(function() {
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
var scope_form = $('#scope-form');
|
||||
|
||||
var scope_validator = scope_form.validate({
|
||||
rules: {
|
||||
"name" : {required: true, scopename:true,rangelength: [1, 512]},
|
||||
"short_description": {required: true, free_text:true,rangelength: [1, 512]},
|
||||
"description": {required: true, free_text:true,rangelength: [1, 1024]}
|
||||
}
|
||||
});
|
||||
|
||||
scope_form.submit(function( event ) {
|
||||
var is_valid = scope_form.valid();
|
||||
if (is_valid){
|
||||
scope_validator.resetForm();
|
||||
var scope = scope_form.serializeForm();
|
||||
var href = $(this).attr('action');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: href,
|
||||
data: JSON.stringify(scope),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
displaySuccessMessage(editScopeMessages.success,scope_form);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -0,0 +1,158 @@
|
|||
|
||||
function loadResourceServers(){
|
||||
var link = resourceServerUrls.get;
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
var uris = data.page;
|
||||
var template = $('<tbody><tr><td class="fname"></td><td class="hname"></td><td class="ip"></td><td class="active"><input type="checkbox" class="resource-server-active-checkbox"></td><td> <a class="btn edit-resource-server" title="Edits a Registered Resource Server">Edit</a> <a class="btn delete-resource-server" title="Deletes a Registered Resource Server">Delete</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'resource_server<-context':{
|
||||
'td.fname':'resource_server.friendly_name',
|
||||
'td.hname':'resource_server.host',
|
||||
'td.ip':'resource_server.ip',
|
||||
'.resource-server-active-checkbox@value':'resource_server.id',
|
||||
'.resource-server-active-checkbox@checked':function(arg){
|
||||
return arg.item.active?'true':'';
|
||||
},
|
||||
'.resource-server-active-checkbox@data-resource-server-id':'resource_server.id',
|
||||
'.resource-server-active-checkbox@id':function(arg){
|
||||
var id = arg.item.id;
|
||||
return 'resource-server-active_'+id;
|
||||
},
|
||||
'a.edit-resource-server@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = resourceServerUrls.edit;
|
||||
return href.replace('-1',id);
|
||||
},
|
||||
'a.delete-resource-server@href':function(arg){
|
||||
var id = arg.item.id;
|
||||
var href = resourceServerUrls.delete;
|
||||
return href.replace('-1',id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(uris, directives);
|
||||
$('#body-resource-servers').html(html.html());
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#server-admin','#main-menu').addClass('active');
|
||||
|
||||
//validation rules on new server form
|
||||
var resource_server_form = $('#form-resource-server');
|
||||
var dialog_resource_server = $('#dialog-form-resource-server');
|
||||
|
||||
var resource_server_validator = resource_server_form.validate({
|
||||
rules: {
|
||||
"host" : {required: true, nowhitespace:true,rangelength: [1, 512]},
|
||||
"friendly_name": {required: true, free_text:true,rangelength: [1, 255]},
|
||||
"ip": {required: true, ipV4:true}
|
||||
}
|
||||
});
|
||||
|
||||
dialog_resource_server.modal({
|
||||
show:false,
|
||||
backdrop:"static"
|
||||
});
|
||||
|
||||
dialog_resource_server.on('hidden', function () {
|
||||
resource_server_form.cleanForm();
|
||||
resource_server_validator.resetForm();
|
||||
})
|
||||
|
||||
$("body").on('click',".add-resource-server",function(event){
|
||||
dialog_resource_server.modal('show');
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".refresh-servers",function(event){
|
||||
loadResourceServers()
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$("body").on('click',".resource-server-active-checkbox",function(event){
|
||||
var active = $(this).is(':checked');
|
||||
var resource_server_id = $(this).attr('data-resource-server-id');
|
||||
var url = active? resourceServerUrls.activate : resourceServerUrls.deactivate;
|
||||
url = url.replace('@id',resource_server_id);
|
||||
var verb = active?'PUT':'DELETE';
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("body").on('click',"#save-resource-server",function(event){
|
||||
var is_valid = resource_server_form.valid();
|
||||
if (is_valid){
|
||||
var resource_server = resource_server_form.serializeForm();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: resourceServerUrls.add,
|
||||
data: JSON.stringify(resource_server),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadResourceServers();
|
||||
dialog_resource_server.modal('hide');
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".delete-resource-server",function(event){
|
||||
if(confirm("Are you sure? this would delete all related registered apis, endpoints and associated scopes.")){
|
||||
var href = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: href,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadResourceServers();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
|
@ -0,0 +1,160 @@
|
|||
|
||||
function loadClients(){
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: clientsUrls.load,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
var clients = data.page;
|
||||
var template = $('<tbody><tr><td class="app-name"></td><td class="client-type"></td><td class="client-active"><input type="checkbox" class="app-active-checkbox"></td><td class="client-locked"><input type="checkbox" disabled="disabled" class="app-locked-checkbox"></td><td class="client-modified"></td><td class="client-actions"> <a class="btn edit-client" title="Edits a Registered Application">Edit</a> <a class="btn del-client" title="Deletes a Registered Application">Delete</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'client<-context':{
|
||||
'td.app-name':'client.app_name',
|
||||
'td.client-type':'client.application_type',
|
||||
'td.client-modified':'client.updated_at',
|
||||
'.app-active-checkbox@value':'client.id',
|
||||
'.app-active-checkbox@checked':function(arg){
|
||||
return arg.item.active?'true':'';
|
||||
},
|
||||
'.app-active-checkbox@id':function(arg){
|
||||
var client_id = arg.item.id;
|
||||
return 'app-active_'+client_id;
|
||||
},
|
||||
'.app-locked-checkbox@value':'client.id',
|
||||
'.app-locked-checkbox@id':function(arg){
|
||||
var client_id = arg.item.id;
|
||||
return 'app-locked_'+client_id;
|
||||
},
|
||||
'.app-locked-checkbox@checked':function(arg){
|
||||
return arg.item.locked?'true':'';
|
||||
},
|
||||
'a.edit-client@href':function(arg){
|
||||
var client_id = arg.item.id;
|
||||
var href = clientsUrls.edit;
|
||||
return href.replace('@id',client_id);
|
||||
},
|
||||
'a.del-client@href':function(arg){
|
||||
var client_id = arg.item.id;
|
||||
var href = clientsUrls.delete;
|
||||
return href.replace('@id',client_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var body = template.render(clients, directives);
|
||||
var table = $('<table id="tclients" class="table table-hover table-condensed"><thead><tr><th>Application Name</th><th>Type</th><th>Is Active</th><th>Is Locked</th><th>Modified</th><th> </th></tr></thead>'+body.html()+'</table>');
|
||||
$('#tclients','#clients').remove();
|
||||
$('#clients').append(table);
|
||||
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
$('#oauth2-console','#main-menu').addClass('active');
|
||||
|
||||
var application_form = $('#form-application');
|
||||
var application_dialog = $("#dialog-form-application");
|
||||
var application_validator = application_form.validate({
|
||||
rules: {
|
||||
"app_name" : {required: true, nowhitespace:true,rangelength: [1, 255]},
|
||||
"app_description" : {required: true, free_text:true,rangelength: [1, 512]},
|
||||
"website" : {required:true,url:true}
|
||||
}
|
||||
});
|
||||
|
||||
application_dialog.modal({
|
||||
show:false,
|
||||
backdrop:"static"
|
||||
});
|
||||
|
||||
application_dialog.on('hidden', function () {
|
||||
application_form.cleanForm();
|
||||
application_validator.resetForm();
|
||||
})
|
||||
|
||||
$("body").on('click',".add-client",function(event){
|
||||
application_dialog.modal('show');
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',"#save-application",function(event){
|
||||
var is_valid = application_form.valid();
|
||||
if (is_valid){
|
||||
var application = application_form.serializeForm();
|
||||
application.user_id = userId;
|
||||
var link = $(this).attr('href');
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: clientsUrls.add,
|
||||
data: JSON.stringify(application),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadClients();
|
||||
application_dialog.modal('hide');
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".del-client",function(event){
|
||||
if(confirm("Are you sure to delete this registered application?")){
|
||||
var url = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadClients();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".app-active-checkbox",function(event){
|
||||
var active = $(this).is(':checked');
|
||||
var client_id = $(this).attr('value');
|
||||
var url = active? clientsUrls.activate : clientsUrls.deactivate;
|
||||
url = url.replace('@id',client_id);
|
||||
var verb = active?'PUT':'DELETE';
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,114 @@
|
|||
|
||||
function loadAllowedClientOrigin() {
|
||||
var link = clientOriginsUrls.get;
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
|
||||
var origins = data.allowed_origins;
|
||||
if(origins.length>0){
|
||||
var template = $('<tbody><tr><td class="origin-text"></td><td><a title="Deletes a Allowed Origin" class="btn del-allowed-origin">Delete</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'origin<-context':{
|
||||
'td.origin-text':'origin.allowed_origin',
|
||||
'a.del-allowed-origin@href':function(arg){
|
||||
var origin_id = arg.item.id;
|
||||
var href = clientOriginsUrls.delete;
|
||||
return href.replace('@id',origin_id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(origins, directives);
|
||||
$('#body-allowed-origins').html(html.html());
|
||||
$('#info-origins').hide();
|
||||
$('#table-origins').show();
|
||||
}
|
||||
else{
|
||||
$('#info-origins').show();
|
||||
$('#table-origins').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
if($('#table-origins tr').length === 1){
|
||||
$('#info-origins').show();
|
||||
$('#table-origins').hide();
|
||||
}
|
||||
else{
|
||||
$('#info-origins').hide();
|
||||
$('#table-origins').show();
|
||||
}
|
||||
|
||||
var form_add_origin = $('#form-add-origin');
|
||||
|
||||
var add_origin_validator = form_add_origin.validate({
|
||||
rules: {
|
||||
"origin" :{required: true, ssl_uri: true}
|
||||
}
|
||||
});
|
||||
|
||||
$("body").on('click',".add-origin-client",function(event){
|
||||
var is_valid = form_add_origin.valid();
|
||||
if (is_valid){
|
||||
var link = $(this).attr('href');
|
||||
var origin = form_add_origin.serializeForm();
|
||||
form_add_origin.cleanForm();
|
||||
add_origin_validator.resetForm();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
data: JSON.stringify(origin),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
$('#origin').val('');
|
||||
loadAllowedClientOrigin();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".del-allowed-origin",function(event){
|
||||
|
||||
if(confirm("Are you sure?")){
|
||||
var link = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadAllowedClientOrigin();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -0,0 +1,70 @@
|
|||
jQuery(document).ready(function($){
|
||||
|
||||
$("body").on('click',".regenerate-client-secret",function(event){
|
||||
if(confirm("Are you sure? Regenerating client secret would invalidate all current tokens")){
|
||||
var link = $(this).attr('href');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
$('#client_secret').text(data.new_secret);
|
||||
//clean token UI
|
||||
$('#table-access-tokens').remove();
|
||||
$('#table-refresh-tokens').remove();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',"#use-refresh-token",function(event){
|
||||
var param = {};
|
||||
param.use_refresh_token = $(this).is(':checked');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: dataClientUrls.refresh,
|
||||
data: JSON.stringify(param),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("body").on('click',"#use-rotate-refresh-token-policy",function(event){
|
||||
var param = {};
|
||||
param.rotate_refresh_token = $(this).is(':checked');
|
||||
$.ajax(
|
||||
{
|
||||
type: "PUT",
|
||||
url: dataClientUrls.rotate,
|
||||
data: JSON.stringify(param),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,107 @@
|
|||
function loadAllowedClientUris(){
|
||||
var link = clientUrisUrls.get;
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
var uris = data.allowed_uris;
|
||||
if(uris.length>0){
|
||||
var template = $('<tbody><tr><td class="uri-text"></td><td><a title="Deletes a Allowed Uri" class="btn del-allowed-uri">Delete</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'uri<-context':{
|
||||
'td.uri-text':'uri.uri',
|
||||
'a.del-allowed-uri@href':function(arg){
|
||||
var uri_id = arg.item.id;
|
||||
var href = clientUrisUrls.delete;
|
||||
return href.replace('-1',uri_id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(uris, directives);
|
||||
$('#body-allowed-uris').html(html.html());
|
||||
$('#info-uris').hide();
|
||||
$('#table-uris').show();
|
||||
}
|
||||
else{
|
||||
$('#info-uris').show();
|
||||
$('#table-uris').hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
if($('#table-uris tr').length===1){
|
||||
$('#info-uris').show();
|
||||
$('#table-uris').hide();
|
||||
}
|
||||
else{
|
||||
$('#info-uris').hide();
|
||||
$('#table-uris').show();
|
||||
}
|
||||
|
||||
var form_add_redirect_uri = $('#form-add-uri');
|
||||
|
||||
var add_redirect_uri_validator = form_add_redirect_uri.validate({
|
||||
rules: {"redirect_uri" :{required: true, ssl_uri: true}}
|
||||
});
|
||||
|
||||
$("body").on('click',".add-uri-client",function(event){
|
||||
var is_valid = form_add_redirect_uri.valid();
|
||||
if (is_valid){
|
||||
var link = $(this).attr('href');
|
||||
var uri = form_add_redirect_uri.serializeForm();
|
||||
form_add_redirect_uri.cleanForm();
|
||||
add_redirect_uri_validator.resetForm();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
data: JSON.stringify(uri),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
$('#redirect_uri').val('');
|
||||
loadAllowedClientUris();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".del-allowed-uri",function(event){
|
||||
if(confirm("Are you sure?")){
|
||||
var link = $(this).attr('href');
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: link,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
loadAllowedClientUris();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -0,0 +1,26 @@
|
|||
jQuery(document).ready(function($){
|
||||
$("body").on('click',".scope-checkbox",function(event){
|
||||
var add_url = clientScopesUrls.add;
|
||||
var remove_url = clientScopesUrls.delete;
|
||||
var scope_id = $(this).attr('value');
|
||||
var checked = $(this).is(':checked');
|
||||
var url = checked?add_url:remove_url;
|
||||
url = url.replace('@scope_id',scope_id);
|
||||
var verb = checked?'PUT':'DELETE';
|
||||
$.ajax(
|
||||
{
|
||||
type: verb,
|
||||
url: url,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,165 @@
|
|||
|
||||
function updateAccessTokenList(){
|
||||
//reload access tokens
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: TokensUrls.AccessTokenUrls.get ,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
|
||||
if(data.access_tokens.length===0){
|
||||
$('#table-access-tokens').hide();
|
||||
$('#info-access-tokens').show();
|
||||
}
|
||||
else{
|
||||
$('#info-access-tokens').hide();
|
||||
$('#table-access-tokens').show();
|
||||
var template = $('<tbody><tr><td class="issued"></td><td class="scope"></td><td class="lifetime"></td><td><a title="Revoke Access Token" class="btn revoke-token revoke-access-token" data-hint="access-token">Revoke</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'token<-context':{
|
||||
'@id' :'token.value',
|
||||
'td.issued' :'token.issued',
|
||||
'td.scope' :'token.scope',
|
||||
'td.lifetime':'token.lifetime',
|
||||
'a@href':function(arg){
|
||||
var token_value = arg.item.value;
|
||||
var href = TokensUrls.AccessTokenUrls.de.ete;
|
||||
return href.replace('-1',token_value);
|
||||
},
|
||||
'a@data-value' :'token.value'
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(data.access_tokens, directives);
|
||||
$('#body-access-tokens').html(html.html());
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateRefreshTokenList(){
|
||||
//reload access tokens
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: TokensUrls.RefreshTokenUrl.get,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
|
||||
if(data.refresh_tokens.length===0){
|
||||
$('#table-refresh-tokens').hide();
|
||||
$('#info-refresh-tokens').show();
|
||||
}
|
||||
else{
|
||||
$('#info-refresh-tokens').hide();
|
||||
$('#table-refresh-tokens').show();
|
||||
var template = $('<tbody><tr><td class="issued"></td><td class="scope"></td><td class="lifetime"></td><td><a title="Revoke Refresh Token" class="btn revoke-token revoke-refresh-token" data-hint="refresh-token">Revoke</a></td></tr></tbody>');
|
||||
var directives = {
|
||||
'tr':{
|
||||
'token<-context':{
|
||||
'@id' :'token.value',
|
||||
'td.issued' :'token.issued',
|
||||
'td.scope' :'token.scope',
|
||||
'td.lifetime':function(arg){
|
||||
var token_lifetime = arg.item.lifetime;
|
||||
return token_lifetime===0?'Not Expire':token_lifetime;
|
||||
},
|
||||
'a@href':function(arg){
|
||||
var token_value = arg.item.value;
|
||||
var href = TokensUrls.RefreshTokenUrl.delete;
|
||||
return href.replace('-1',token_value);
|
||||
},
|
||||
'a@data-value' :'token.value'
|
||||
}
|
||||
}
|
||||
};
|
||||
var html = template.render(data.refresh_tokens, directives);
|
||||
$('#body-refresh-tokens').html(html.html());
|
||||
updateAccessTokenList();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
if($('#table-access-tokens tr').length===1){
|
||||
$('#info-access-tokens').show();
|
||||
$('#table-access-tokens').hide();
|
||||
}
|
||||
else{
|
||||
$('#info-access-tokens').hide();
|
||||
$('#table-access-tokens').show();
|
||||
}
|
||||
|
||||
if($('#table-refresh-tokens tr').length===1){
|
||||
$('#info-refresh-tokens').show();
|
||||
$('#table-refresh-tokens').hide();
|
||||
}
|
||||
else{
|
||||
$('#info-refresh-tokens').hide();
|
||||
$('#table-refresh-tokens').show();
|
||||
}
|
||||
|
||||
$("body").on('click','.refresh-refresh-tokens',function(event){
|
||||
updateRefreshTokenList();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click','.refresh-access-tokens',function(event){
|
||||
updateAccessTokenList();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("body").on('click',".revoke-token",function(event){
|
||||
|
||||
var link = $(this);
|
||||
var value = link.attr('data-value');
|
||||
var hint = link.attr('data-hint');
|
||||
var url = link.attr('href');
|
||||
var table_id = hint ==='refresh-token'? 'table-refresh-tokens':'table-access-tokens';
|
||||
var info_id = hint ==='refresh-token'? 'info-refresh-tokens':'info-access-tokens';
|
||||
var confirm_msg = hint ==='refresh-token'? 'Are you sure?, revoking this refresh token also will become void all related Access Tokens':'Are you sure?';
|
||||
if(confirm(confirm_msg)){
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
var row = $('#'+value);
|
||||
row.remove();
|
||||
var row_qty = $('#'+table_id+' tr').length;
|
||||
if(row_qty===1){ //only we have the header ...
|
||||
$('#'+table_id).hide();
|
||||
$('#'+info_id).show();
|
||||
}
|
||||
if(hint=='refresh-token'){
|
||||
updateAccessTokenList();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -0,0 +1,55 @@
|
|||
jQuery(document).ready(function($){
|
||||
|
||||
$('#oauth2-console','#main-menu').addClass('active');
|
||||
|
||||
if($('#table-access-tokens tr').length===1){
|
||||
$('#info-access-tokens').show();
|
||||
$('#table-access-tokens').hide();
|
||||
}
|
||||
else{
|
||||
$('#info-access-tokens').hide();
|
||||
$('#table-access-tokens').show();
|
||||
}
|
||||
|
||||
if($('#table-refresh-tokens tr').length===1){
|
||||
$('#info-refresh-tokens').show();
|
||||
$('#table-refresh-tokens').hide();
|
||||
}
|
||||
else{
|
||||
$('#info-refresh-tokens').hide();
|
||||
$('#table-refresh-tokens').show();
|
||||
}
|
||||
|
||||
$("body").on('click',".revoke-access",function(event){
|
||||
if(confirm("Are you sure to revoke this grant?")){
|
||||
var url = $(this).attr('href');
|
||||
var value = $(this).attr('data-value');
|
||||
var hint = $(this).attr('data-hint');
|
||||
var body = hint=='access_token'?'body-access-tokens':'body-refresh-tokens'
|
||||
var table = hint=='access_token'?'table-access-tokens':'table-refresh-tokens'
|
||||
var info = hint=='access_token'?'info-access-tokens':'info-refresh-tokens'
|
||||
$.ajax(
|
||||
{
|
||||
type: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
timeout:60000,
|
||||
success: function (data,textStatus,jqXHR) {
|
||||
//load data...
|
||||
$('#'+value,'#'+body).remove();
|
||||
|
||||
if($('#'+table+' tr').length===1){
|
||||
$('#'+info).show();
|
||||
$('#'+table).hide();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
ajaxError(jqXHR, textStatus, errorThrown);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -0,0 +1,10 @@
|
|||
jQuery(document).ready(function($){
|
||||
|
||||
$("body").on('click',"#cancel_authorization",function(event){
|
||||
$form = $('#authorization_form');
|
||||
$("#deny_once").prop("checked", true)
|
||||
$form.submit();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue