Skip to content

Commit

Permalink
adjust code style
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Jul 9, 2016
1 parent 48b8596 commit bd80c0b
Show file tree
Hide file tree
Showing 52 changed files with 3,202 additions and 3,202 deletions.
466 changes: 233 additions & 233 deletions public/app/action/action.js

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions public/app/action/create.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@

<div class="modal-header">
<h3 class="modal-title">Create</h3>
<h3 class="modal-title">Create</h3>
</div>

<div class="modal-body">
<uib-alert type="danger" close="closeResponse()" ng-if="response.success === false">
{{response.message}}
</uib-alert>
<form name="actionCreateForm" ng-submit="create(action)">
<div class="form-group">
<label for="name">Name:</label>
<input type="text" id="name" ng-model="action.name" aria-describedby="nameHelp" class="form-control">
<span class="help-block" id="nameHelp">Name of the action must match the following regexp <code>[A-z0-9\-\_]{3,64}</code></span>
</div>
<div class="form-group">
<label for="class">Class:</label>
<select id="class" ng-model="action.class" ng-click="loadConfig()" ng-options="action.class as action.name for action in actions" aria-describedby="classHelp" class="form-control">
</select>
<span class="help-block" id="classHelp">Action class which gets executed. Each action can provide aditional configuration parameters which are loaded if an class was selected</span>
</div>
<uib-alert type="danger" close="closeResponse()" ng-if="response.success === false">
{{response.message}}
</uib-alert>
<form name="actionCreateForm" ng-submit="create(action)">
<div class="form-group">
<label for="name">Name:</label>
<input type="text" id="name" ng-model="action.name" aria-describedby="nameHelp" class="form-control">
<span class="help-block" id="nameHelp">Name of the action must match the following regexp <code>[A-z0-9\-\_]{3,64}</code></span>
</div>
<div class="form-group">
<label for="class">Class:</label>
<select id="class" ng-model="action.class" ng-click="loadConfig()" ng-options="action.class as action.name for action in actions" aria-describedby="classHelp" class="form-control">
</select>
<span class="help-block" id="classHelp">Action class which gets executed. Each action can provide aditional configuration parameters which are loaded if an class was selected</span>
</div>

<div id="config-form"></div>
<div id="config-form"></div>

<button type="submit" class="btn btn-primary">Save</button>
<button type="button" ng-click="close()" class="btn btn-default">Cancel</button>
</form>
<button type="submit" class="btn btn-primary">Save</button>
<button type="button" ng-click="close()" class="btn btn-default">Cancel</button>
</form>
</div>
26 changes: 13 additions & 13 deletions public/app/action/delete.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@

<div class="modal-header">
<h3 class="modal-title">Delete</h3>
<h3 class="modal-title">Delete</h3>
</div>

<div class="modal-body">
<uib-alert type="danger" close="closeResponse()" ng-if="response.success === false">
{{response.message}}
</uib-alert>
<form name="actionDeleteForm" ng-submit="delete(action)">
<input type="hidden" ng-model="action.id" value="{{action.id}}" />
<div class="form-group">
<label for="name">Name:</label>
<input type="text" id="name" ng-model="action.name" ng-disabled="true" class="form-control" value="{{action.name}}">
</div>
<button type="submit" class="btn btn-primary">Save</button>
<button type="button" ng-click="close()" class="btn btn-default">Cancel</button>
</form>
<uib-alert type="danger" close="closeResponse()" ng-if="response.success === false">
{{response.message}}
</uib-alert>
<form name="actionDeleteForm" ng-submit="delete(action)">
<input type="hidden" ng-model="action.id" value="{{action.id}}" />
<div class="form-group">
<label for="name">Name:</label>
<input type="text" id="name" ng-model="action.name" ng-disabled="true" class="form-control" value="{{action.name}}">
</div>
<button type="submit" class="btn btn-primary">Save</button>
<button type="button" ng-click="close()" class="btn btn-default">Cancel</button>
</form>
</div>
90 changes: 45 additions & 45 deletions public/app/action/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,63 @@
<h1>Action</h1>

<div class="fusio-search">
<table class="table">
<colgroup>
<col width="160" />
<col width="*" />
<col width="100" />
</colgroup>
<tr>
<td>
<table class="table">
<colgroup>
<col width="160" />
<col width="*" />
<col width="100" />
</colgroup>
<tr>
<td>
<select id="routes" ng-model="routeId" ng-change="changeRoute()" ng-options="route.id as route.path for route in routes" class="form-control" aria-describedby="routeHelp">
<option value="">Every route</option>
</select>
</td>
<td>
<form name="actionSearchForm" ng-submit="doSearch(search)">
<input type="text" class="form-control" ng-model="search" placeholder="Search i.e. action-name" />
</form>
</td>
<td>
<a class="btn btn-primary" ng-click="openCreateDialog()"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
<a class="btn btn-default" ng-click="help.showDialog('help/action.md')"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></a>
</td>
</tr>
</table>
</td>
<td>
<form name="actionSearchForm" ng-submit="doSearch(search)">
<input type="text" class="form-control" ng-model="search" placeholder="Search i.e. action-name" />
</form>
</td>
<td>
<a class="btn btn-primary" ng-click="openCreateDialog()"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
<a class="btn btn-default" ng-click="help.showDialog('help/action.md')"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></a>
</td>
</tr>
</table>
</div>

<uib-alert type="success" close="closeResponse()" ng-if="response.success === true">
{{response.message}}
{{response.message}}
</uib-alert>

<uib-alert type="danger" close="closeResponse()" ng-if="response.success === false">
{{response.message}}
{{response.message}}
</uib-alert>

<div class="fusio-grid">
<table class="table">
<colgroup>
<col width="*" />
<col width="100" />
</colgroup>
<thead>
<tr>
<th>Name</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="action in actions">
<td><span class="label label-default" ng-if="action.status == 2">Locked</span> {{action.name}}</td>
<td>
<div class="fusio-options">
<a ng-click="openUpdateDialog(action)" class="btn btn-default"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span></a>
<a ng-click="openDeleteDialog(action)" class="btn btn-default"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table">
<colgroup>
<col width="*" />
<col width="100" />
</colgroup>
<thead>
<tr>
<th>Name</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="action in actions">
<td><span class="label label-default" ng-if="action.status == 2">Locked</span> {{action.name}}</td>
<td>
<div class="fusio-options">
<a ng-click="openUpdateDialog(action)" class="btn btn-default"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span></a>
<a ng-click="openDeleteDialog(action)" class="btn btn-default"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a>
</div>
</td>
</tr>
</tbody>
</table>
</div>

<uib-pagination total-items="totalResults" items-per-page="16" ng-model="startIndex" ng-change="pageChanged()"></uib-pagination>
40 changes: 20 additions & 20 deletions public/app/action/update.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@

<div class="modal-header">
<h3 class="modal-title">Update</h3>
<h3 class="modal-title">Update</h3>
</div>

<div class="modal-body">
<uib-alert type="danger" close="closeResponse()" ng-if="response.success === false">
{{response.message}}
</uib-alert>
<form name="actionUpdateForm" ng-submit="update(action)">
<input type="hidden" ng-model="action.id" value="{{action.id}}" />
<div class="form-group">
<label for="name">Name:</label>
<input type="text" id="name" ng-model="action.name" aria-describedby="nameHelp" class="form-control">
<span class="help-block" id="nameHelp">Name of the action must match the following regexp <code>[A-z0-9\-\_]{3,64}</code></span>
</div>
<div class="form-group">
<label for="class">Class:</label>
<input type="text" id="class" ng-model="action.class" class="form-control" value="{{action.class}}" disabled="disabled" aria-describedby="classHelp">
<span class="help-block" id="classHelp">Action class which gets executed</span>
</div>
<uib-alert type="danger" close="closeResponse()" ng-if="response.success === false">
{{response.message}}
</uib-alert>
<form name="actionUpdateForm" ng-submit="update(action)">
<input type="hidden" ng-model="action.id" value="{{action.id}}" />
<div class="form-group">
<label for="name">Name:</label>
<input type="text" id="name" ng-model="action.name" aria-describedby="nameHelp" class="form-control">
<span class="help-block" id="nameHelp">Name of the action must match the following regexp <code>[A-z0-9\-\_]{3,64}</code></span>
</div>
<div class="form-group">
<label for="class">Class:</label>
<input type="text" id="class" ng-model="action.class" class="form-control" value="{{action.class}}" disabled="disabled" aria-describedby="classHelp">
<span class="help-block" id="classHelp">Action class which gets executed</span>
</div>

<div id="config-form"></div>
<div id="config-form"></div>

<button type="submit" class="btn btn-primary">Save</button>
<button type="button" ng-click="close()" class="btn btn-default">Cancel</button>
</form>
<button type="submit" class="btn btn-primary">Save</button>
<button type="button" ng-click="close()" class="btn btn-default">Cancel</button>
</form>
</div>
124 changes: 62 additions & 62 deletions public/app/app.js
Original file line number Diff line number Diff line change
@@ -1,97 +1,97 @@
'use strict';

var fusioApp = angular.module('fusioApp', [
'ngRoute',
'ngSanitize',
'ui.bootstrap',
'ui.ace',
'chart.js',
'ng-showdown',
'fusioApp.account',
'fusioApp.action',
'fusioApp.app',
'fusioApp.config',
'fusioApp.connection',
'fusioApp.dashboard',
'fusioApp.database',
'fusioApp.import',
'fusioApp.log',
'fusioApp.login',
'fusioApp.logout',
'fusioApp.routes',
'fusioApp.schema',
'fusioApp.scope',
'fusioApp.statistic',
'fusioApp.user'
'ngRoute',
'ngSanitize',
'ui.bootstrap',
'ui.ace',
'chart.js',
'ng-showdown',
'fusioApp.account',
'fusioApp.action',
'fusioApp.app',
'fusioApp.config',
'fusioApp.connection',
'fusioApp.dashboard',
'fusioApp.database',
'fusioApp.import',
'fusioApp.log',
'fusioApp.login',
'fusioApp.logout',
'fusioApp.routes',
'fusioApp.schema',
'fusioApp.scope',
'fusioApp.statistic',
'fusioApp.user'
]);

fusioApp.value('version', 'v0.3');

fusioApp.factory('fusioIsAuthenticated', ['$location', '$window', '$q', function($location, $window, $q) {
return {
responseError: function(response){
if (response.status == 400 && response.data.message && response.data.message.indexOf('Invalid access token') !== -1) {
$window.sessionStorage.removeItem('fusio_access_token');
return {
responseError: function(response){
if (response.status == 400 && response.data.message && response.data.message.indexOf('Invalid access token') !== -1) {
$window.sessionStorage.removeItem('fusio_access_token');

$location.path('/login');
}
$location.path('/login');
}

return $q.reject(response);
}
};
return $q.reject(response);
}
};
}]);

fusioApp.config(['$routeProvider', function($routeProvider){
$routeProvider.
otherwise({
redirectTo: '/dashboard'
});
$routeProvider.
otherwise({
redirectTo: '/dashboard'
});
}]);

fusioApp.config(['$httpProvider', function($httpProvider) {
$httpProvider.interceptors.push('fusioIsAuthenticated');
$httpProvider.interceptors.push('fusioIsAuthenticated');
}]);

fusioApp.config(['$showdownProvider', function($showdownProvider){
}]);

fusioApp.run(function ($rootScope, $window, $location, $http, helpLoader, version) {
var token = $window.sessionStorage.getItem('fusio_access_token');
if (token) {
$http.defaults.headers.common['Authorization'] = 'Bearer ' + token;
var token = $window.sessionStorage.getItem('fusio_access_token');
if (token) {
$http.defaults.headers.common['Authorization'] = 'Bearer ' + token;

angular.element(document.querySelector('body')).removeClass('fusio-hidden');
} else {
$location.path('/login');
}
angular.element(document.querySelector('body')).removeClass('fusio-hidden');
} else {
$location.path('/login');
}

// make help loader global available
$rootScope.help = helpLoader;
// make help loader global available
$rootScope.help = helpLoader;

// set version
$rootScope.version = version;
// set version
$rootScope.version = version;
});

/**
* Simple helper function to guess the API endpoint url
*/
function guessFusioEndpointUrl() {
var url = window.location.href;
var removePart = function(url, sign) {
var count = (url.match(/\//g) || []).length;
var pos = url.lastIndexOf(sign);
if (count > 2 && pos !== -1) {
return url.substring(0, pos);
}
return url;
}
var parts = ['#', '?', '/'];
for (var i = 0; i < parts.length; i++) {
url = removePart(url, parts[i]);
}
return url + '/index.php/';
var url = window.location.href;
var removePart = function(url, sign) {
var count = (url.match(/\//g) || []).length;
var pos = url.lastIndexOf(sign);
if (count > 2 && pos !== -1) {
return url.substring(0, pos);
}
return url;
};
var parts = ['#', '?', '/'];
for (var i = 0; i < parts.length; i++) {
url = removePart(url, parts[i]);
}
return url + '/index.php/';
}

if (typeof fusio_url === 'undefined') {
var fusio_url = guessFusioEndpointUrl();
var fusio_url = guessFusioEndpointUrl();
}

0 comments on commit bd80c0b

Please sign in to comment.