Initial commit

This commit is contained in:
Isaac Parenteau committed 2018-07-07 20:43:51 -05:00
commit 880e39de2e
511 files changed
+38363

No files matched your search

@@ -0,0 +1,26 @@
<md-dialog flex="40">
<md-toolbar>
<div class="md-toolbar-tools md-portal">
<span>AES Seed</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-card class="md-padding">
<md-input-container flex>
<label>Seed Value</label>
<input ng-model="model.seed" ng-disabled="saving || !canEdit"/>
</md-input-container>
</md-list-item>
</md-card>
</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>
</md-dialog>
@@ -0,0 +1,56 @@
(function () {
'use strict';
/**
* MODULE DESCRIPTION:
*
* TODO: Write description here.
*/
angular.module('portal.common.partials.seedinfo', ['ui.router']).controller('SeedInfoCtrl', seedInfoCtrlController);
function seedInfoCtrlController($scope, $state, cache, $mdDialog, systemProvider, portalUtils, permissions, Constants) {
$scope.saving = false;
permissions.canView({permission: Constants.Permissions.UPDATE_SEED_VALUE}).then(function(allowed) {
$scope.canEdit = allowed;
});
$scope.model = {};
/**
* OK button handler
* @returns {undefined}
*/
$scope.ok = function () {
portalUtils.confirmBox('updateSeed', 'Update AES Seed',
['Are you sure you want to update the AES Seed',
'This will go through and update all the saved encrypted values',
'and cannot be undone once performed'],
false, function(value) {
if (value.confirm) {
$scope.updateSeed();
}
});
};
$scope.updateSeed = function() {
systemProvider.updateSeed($scope.model.seed).then(function(){
portalUtils.toast('Seed updated successfully', ['top', 'left'], 2000);
$mdDialog.hide();
}, function(err){
$scope.error = err.message;
});
};
/**
* Cancel button handler.
* @returns {undefined}
*/
$scope.cancel = function () {
//Dismiss the modal
$mdDialog.cancel();
};
} //end SeedInfoCtrlController function
})();