-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Too much time to debug Windows issues on Mac. Deployed full js files …
…to minimize such efforts.
- Loading branch information
Showing
58 changed files
with
60,166 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 134 additions & 0 deletions
134
lib/openeis-ui/openeis/ui/static/openeis-ui/js/AccountCtrl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
// Copyright (c) 2014, Battelle Memorial Institute | ||
// All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// 1. Redistributions of source code must retain the above copyright notice, this | ||
// list of conditions and the following disclaimer. | ||
// 2. Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
// The views and conclusions contained in the software and documentation are those | ||
// of the authors and should not be interpreted as representing official policies, | ||
// either expressed or implied, of the FreeBSD Project. | ||
// | ||
// | ||
// This material was prepared as an account of work sponsored by an | ||
// agency of the United States Government. Neither the United States | ||
// Government nor the United States Department of Energy, nor Battelle, | ||
// nor any of their employees, nor any jurisdiction or organization | ||
// that has cooperated in the development of these materials, makes | ||
// any warranty, express or implied, or assumes any legal liability | ||
// or responsibility for the accuracy, completeness, or usefulness or | ||
// any information, apparatus, product, software, or process disclosed, | ||
// or represents that its use would not infringe privately owned rights. | ||
// | ||
// Reference herein to any specific commercial product, process, or | ||
// service by trade name, trademark, manufacturer, or otherwise does | ||
// not necessarily constitute or imply its endorsement, recommendation, | ||
// or favoring by the United States Government or any agency thereof, | ||
// or Battelle Memorial Institute. The views and opinions of authors | ||
// expressed herein do not necessarily state or reflect those of the | ||
// United States Government or any agency thereof. | ||
// | ||
// PACIFIC NORTHWEST NATIONAL LABORATORY | ||
// operated by BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY | ||
// under Contract DE-AC05-76RL01830 | ||
|
||
angular.module('openeis-ui') | ||
.controller('AccountCtrl', function ($scope, Auth, $timeout) { | ||
var accountOrig; | ||
|
||
Auth.account().then(function (account) { | ||
$scope.account = account; | ||
accountOrig = angular.copy(account); | ||
}); | ||
|
||
$scope.$watchCollection('account', function (newValue) { | ||
if (newValue.first_name !== accountOrig.first_name || | ||
newValue.email != accountOrig.email) { | ||
$scope.profile.changed = true; | ||
} else { | ||
$scope.profile.changed = false; | ||
} | ||
}); | ||
|
||
$scope.profile = { | ||
clearAlerts: function () { | ||
$scope.profile.success = false; | ||
$scope.profile.error = false; | ||
}, | ||
update: function () { | ||
$scope.profile.clearAlerts(); | ||
|
||
Auth.accountUpdate({ | ||
first_name: $scope.account.first_name, | ||
email: $scope.account.email, | ||
}).then(function (response) { | ||
$scope.profile.success = true; | ||
$scope.profile.changed = false; | ||
accountOrig = angular.copy($scope.account); | ||
$timeout($scope.profile.clearAlerts, 2000); | ||
}, function (rejection) { | ||
if (rejection.status === 400) { | ||
angular.forEach(rejection.data, function (v, k) { | ||
if (angular.isArray(v)) { | ||
rejection.data[k] = v.join('<br>'); | ||
} | ||
}); | ||
} | ||
|
||
$scope.profile.error = rejection; | ||
}); | ||
}, | ||
}; | ||
|
||
$scope.password = { | ||
clearAlerts: function () { | ||
$scope.password.mismatch = false; | ||
$scope.password.success = false; | ||
$scope.password.error = false; | ||
}, | ||
update: function () { | ||
$scope.password.clearAlerts(); | ||
|
||
if ($scope.password.new !== $scope.password.newConfirm) { | ||
$scope.password.mismatch = true; | ||
return; | ||
} | ||
|
||
Auth.accountPassword({ | ||
old_password: $scope.password.current, | ||
new_password: $scope.password.new, | ||
}).then(function (response) { | ||
$scope.password.success = true; | ||
$scope.password.current = ''; | ||
$scope.password.new = ''; | ||
$scope.password.newConfirm = ''; | ||
$timeout($scope.password.clearAlerts, 2000); | ||
}, function (rejection) { | ||
if (rejection.status === 400) { | ||
angular.forEach(rejection.data, function (v, k) { | ||
if (angular.isArray(v)) { | ||
rejection.data[k] = v.join('<br>'); | ||
} | ||
}); | ||
} | ||
$scope.password.error = rejection; | ||
}); | ||
}, | ||
}; | ||
}); |
89 changes: 89 additions & 0 deletions
89
lib/openeis-ui/openeis/ui/static/openeis-ui/js/Analyses.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// Copyright (c) 2014, Battelle Memorial Institute | ||
// All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// 1. Redistributions of source code must retain the above copyright notice, this | ||
// list of conditions and the following disclaimer. | ||
// 2. Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
// The views and conclusions contained in the software and documentation are those | ||
// of the authors and should not be interpreted as representing official policies, | ||
// either expressed or implied, of the FreeBSD Project. | ||
// | ||
// | ||
// This material was prepared as an account of work sponsored by an | ||
// agency of the United States Government. Neither the United States | ||
// Government nor the United States Department of Energy, nor Battelle, | ||
// nor any of their employees, nor any jurisdiction or organization | ||
// that has cooperated in the development of these materials, makes | ||
// any warranty, express or implied, or assumes any legal liability | ||
// or responsibility for the accuracy, completeness, or usefulness or | ||
// any information, apparatus, product, software, or process disclosed, | ||
// or represents that its use would not infringe privately owned rights. | ||
// | ||
// Reference herein to any specific commercial product, process, or | ||
// service by trade name, trademark, manufacturer, or otherwise does | ||
// not necessarily constitute or imply its endorsement, recommendation, | ||
// or favoring by the United States Government or any agency thereof, | ||
// or Battelle Memorial Institute. The views and opinions of authors | ||
// expressed herein do not necessarily state or reflect those of the | ||
// United States Government or any agency thereof. | ||
// | ||
// PACIFIC NORTHWEST NATIONAL LABORATORY | ||
// operated by BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY | ||
// under Contract DE-AC05-76RL01830 | ||
|
||
angular.module('openeis-ui.services.analyses', ['ngResource']) | ||
.service('Analyses', function ($resource, $q) { | ||
var Analyses = this, | ||
resource = $resource(settings.API_URL + 'analyses/:analysisId', { analysisId: '@id' }, { | ||
create: { method: 'POST' }, | ||
save: { method: 'PUT' }, | ||
}), | ||
dataResource = $resource(settings.API_URL + 'analyses/:analysisId/data'); | ||
|
||
Analyses.get = function (analysisId) { | ||
return resource.get({ analysisId: analysisId }); | ||
}; | ||
|
||
Analyses.query = function (projectId) { | ||
return resource.query({ project: projectId }); | ||
}; | ||
|
||
Analyses.create = function(report) { | ||
return resource.create(report); | ||
}; | ||
|
||
Analyses.getData = function (analysisId) { | ||
return dataResource.get({ analysisId: analysisId }).$promise.then(function (outputs) { | ||
outputData = {}; | ||
dataPromises = []; | ||
|
||
angular.forEach(outputs, function (output, name) { | ||
if (name === '$promise' || name === '$resolved') { return; } | ||
dataPromises.push(dataResource.query({ analysisId: analysisId, output: name }).$promise.then(function (data) { | ||
outputData[name] = data; | ||
})); | ||
}); | ||
|
||
return $q.all(dataPromises).then(function () { | ||
return outputData; | ||
}); | ||
}); | ||
}; | ||
}); |
60 changes: 60 additions & 0 deletions
60
lib/openeis-ui/openeis/ui/static/openeis-ui/js/Applications.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright (c) 2014, Battelle Memorial Institute | ||
// All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// 1. Redistributions of source code must retain the above copyright notice, this | ||
// list of conditions and the following disclaimer. | ||
// 2. Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
// The views and conclusions contained in the software and documentation are those | ||
// of the authors and should not be interpreted as representing official policies, | ||
// either expressed or implied, of the FreeBSD Project. | ||
// | ||
// | ||
// This material was prepared as an account of work sponsored by an | ||
// agency of the United States Government. Neither the United States | ||
// Government nor the United States Department of Energy, nor Battelle, | ||
// nor any of their employees, nor any jurisdiction or organization | ||
// that has cooperated in the development of these materials, makes | ||
// any warranty, express or implied, or assumes any legal liability | ||
// or responsibility for the accuracy, completeness, or usefulness or | ||
// any information, apparatus, product, software, or process disclosed, | ||
// or represents that its use would not infringe privately owned rights. | ||
// | ||
// Reference herein to any specific commercial product, process, or | ||
// service by trade name, trademark, manufacturer, or otherwise does | ||
// not necessarily constitute or imply its endorsement, recommendation, | ||
// or favoring by the United States Government or any agency thereof, | ||
// or Battelle Memorial Institute. The views and opinions of authors | ||
// expressed herein do not necessarily state or reflect those of the | ||
// United States Government or any agency thereof. | ||
// | ||
// PACIFIC NORTHWEST NATIONAL LABORATORY | ||
// operated by BATTELLE for the UNITED STATES DEPARTMENT OF ENERGY | ||
// under Contract DE-AC05-76RL01830 | ||
|
||
angular.module('openeis-ui.services.applications', ['ngResource']) | ||
.service('Applications', function ($resource) { | ||
var Applications = this, | ||
resource = $resource(settings.API_URL + 'applications'); | ||
|
||
Applications.query = function () { | ||
return resource.query(); | ||
}; | ||
}); | ||
|
Oops, something went wrong.