Initial commit
This commit is contained in:
commit
880e39de2e
511 files changed
+38363
No files matched your search
@@ -0,0 +1,146 @@
|
||||
<md-dialog flex="60">
|
||||
<form name="configForm">
|
||||
|
||||
<md-toolbar>
|
||||
<div class="md-toolbar-tools md-portal">
|
||||
<span>Configuration</span>
|
||||
<span flex></span>
|
||||
<md-button class="md-icon-button" ng-click="cancel()">
|
||||
<md-icon>close</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
|
||||
<md-dialog-content flex>
|
||||
<md-tabs md-dynamic-height md-border-bottom>
|
||||
<md-tab label="General Configuration">
|
||||
<md-content class="md-padding" flex>
|
||||
<md-list>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="File Path" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>File Path Value</label>
|
||||
<input ng-model="config.filepath" ng-disabled="saving || !canEdit"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Default Log Level" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>Default Log Level</label>
|
||||
<md-select ng-model="config.logLevel" ng-disabled="!canEdit">
|
||||
<md-option ng-value="ll.id" ng-repeat="ll in logLevels">{{ll.name}}</md-option>
|
||||
</md-select>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="User Expiration Days" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>User Expiration Days Value</label>
|
||||
<input ng-model="config.userExpirationDays" ng-disabled="saving || !canEdit" type="number"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
<md-tab label="Database General Configuration">
|
||||
<md-content class="md-padding" flex>
|
||||
<md-list>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Database Host" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>Database Host Value</label>
|
||||
<input ng-model="config.dbHost" ng-disabled="saving || !canEdit"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Database Port" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>Database Port Value</label>
|
||||
<input ng-model="config.dbPort" ng-disabled="saving || !canEdit" type="number"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Database User Name" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>Database User Name Value</label>
|
||||
<input ng-model="config.dbUsername" ng-disabled="saving || !canEdit"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Database Password" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<div layout="row" flex layout-align="center center">
|
||||
<md-input-container flex>
|
||||
<label>Database Password Value</label>
|
||||
<input ng-model="config.dbPassword" ng-disabled="saving || !canEdit" type="{{dbPasswordType}}"/>
|
||||
</md-input-container>
|
||||
<md-button class="md-icon-button" style="margin-bottom: 25px;" ng-mousedown="dbPasswordType='text'" ng-mouseup="dbPasswordType='password'">
|
||||
<md-icon>remove_red_eye</md-icon>
|
||||
<md-tooltip>View password</md-tooltip>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
<md-tab label="Database Root Configuration">
|
||||
<md-content class="md-padding" flex>
|
||||
<md-list>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Database Root User" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<md-input-container flex>
|
||||
<label>Database Root User Value</label>
|
||||
<input ng-model="config.dbRootUser" ng-disabled="saving || !canEdit"/>
|
||||
</md-input-container>
|
||||
</md-list-item>
|
||||
<md-list-item>
|
||||
<md-input-container flex>
|
||||
<input value="Database Root Password" ng-disabled="true" style="color: rgba(0,0,0,1) !important; background: none !important;"/>
|
||||
</md-input-container>
|
||||
<span flex="5"></span>
|
||||
<div layout="row" flex layout-align="center center">
|
||||
<md-input-container flex>
|
||||
<label>Database Root Password Value</label>
|
||||
<input ng-model="config.dbRootPassword" ng-disabled="saving || !canEdit" type="{{dbRootPasswordType}}"/>
|
||||
</md-input-container>
|
||||
<md-button class="md-icon-button" style="margin-bottom: 25px;" ng-mousedown="dbRootPasswordType='text'" ng-mouseup="dbRootPasswordType='password'">
|
||||
<md-icon>remove_red_eye</md-icon>
|
||||
<md-tooltip>View password</md-tooltip>
|
||||
</md-button>
|
||||
</div>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
</md-tabs>
|
||||
</md-dialog-content>
|
||||
<md-dialog-actions layout="row" class="modal-footer">
|
||||
<div class="text-danger">{{error}}</div>
|
||||
<md-button id="okButton" type="submit" class="md-raised md-primary" ng-click="ok()">Save</md-button>
|
||||
<md-button id="cancelButton" class="md-raised md-warn" ng-click="cancel()">Cancel</md-button>
|
||||
</md-dialog-actions>
|
||||
</form>
|
||||
</md-dialog>
|
||||
@@ -0,0 +1,73 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* TODO: Write description here.
|
||||
*/
|
||||
angular.module('portal.common.partials.configuration', ['ui.router']).controller('ConfigurationCtrl', configurationCtrlController);
|
||||
|
||||
function configurationCtrlController($scope, account, $state, cache, $mdDialog, configStores, configProvider,
|
||||
portalUtils, Constants, permissions) {
|
||||
|
||||
$scope.logLevels= [
|
||||
{id:'OFF', name: 'Off'},
|
||||
{id:'FATAL', name: 'Fatal'},
|
||||
{id:'ERROR', name:'Error'},
|
||||
{id:'WARN', name:'Warn'},
|
||||
{id:'INFO', name:'Info'},
|
||||
{id:'DEBUG', name:'Debug'},
|
||||
{id:'TRACE', name:'Trace'},
|
||||
{id:'ALL', name: 'All'}
|
||||
];
|
||||
|
||||
$scope.saving = false;
|
||||
$scope.dbPasswordType = 'password';
|
||||
$scope.dbRootPasswordType = 'password';
|
||||
$scope.canEdit = false;
|
||||
$scope.mCache = cache.request([new configStores.Configs()]).then(function(){
|
||||
$scope.config = $scope.mCache.configs.data;
|
||||
});
|
||||
|
||||
permissions.canView({permission: Constants.Permissions.CHANGE_CONFIG}).then(function(allowed){
|
||||
$scope.canEdit = allowed;
|
||||
});
|
||||
|
||||
/**
|
||||
* OK button handler
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.ok = function () {
|
||||
portalUtils.confirmBox('saveConfig', 'Save Configuration',
|
||||
['Are you sure you want to save the configuration values?', 'New values will not take effect until server restart'],
|
||||
false, function(value) {
|
||||
if (value.confirm) {
|
||||
$scope.saveConfig();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.saveConfig = function() {
|
||||
configProvider.saveConfiguration($scope.config).then(function(value){
|
||||
portalUtils.toast('Configuration values saved successfully', ['top', 'left'], 2000);
|
||||
new configStores.Configs().refresh();
|
||||
$mdDialog.hide();
|
||||
}).catch(function(err){
|
||||
portalUtils.toast('Failed to save configuration: ' + err.message, ['top', 'left'], 4000);
|
||||
new configStores.Configs().refresh();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel button handler.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
$scope.cancel = function () {
|
||||
//Dismiss the modal
|
||||
$mdDialog.cancel();
|
||||
};
|
||||
|
||||
} //end configurationCtrlController function
|
||||
|
||||
})();
|
||||
Reference in new issue
Block a user