Fixup form submission state for memory limit and robots
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
<div class="content">
|
||||
|
||||
<div class="task-indicator animateMe hand" ng-show="app.taskId">
|
||||
<div class="task-indicator animateMe" ng-show="app.taskId">
|
||||
<i class="fa fa-circle-notch fa-spin"></i>
|
||||
<span>{{ app | installationStateLabel:user }}</span>
|
||||
</div>
|
||||
@@ -355,18 +355,14 @@
|
||||
<textarea ng-model="security.robotsTxt" placeholder="Leave empty to allow all bots to index this app." class="form-control" rows="4"></textarea>
|
||||
</div>
|
||||
|
||||
<input class="ng-hide" type="submit" ng-disabled="securityForm.$invalid || security.busy"/>
|
||||
<input class="ng-hide" type="submit" ng-disabled="security.robotsTxt === security.currentRobotsTxt || securityForm.$invalid || security.busy"/>
|
||||
</form>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<span class="text-success text-bold" ng-show="security.success">Saved</span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-right">
|
||||
<button class="btn btn-outline btn-primary pull-right" ng-click="security.submit()" ng-disabled="security.$invalid || security.busy"><i class="fa fa-circle-notch fa-spin" ng-show="security.busy"></i> Save</button>
|
||||
<div class="col-md-12 text-right">
|
||||
<button class="btn btn-outline btn-primary pull-right" ng-click="security.submit()" ng-disabled="security.robotsTxt === security.currentRobotsTxt || security.$invalid || security.busy"><i class="fa fa-circle-notch fa-spin" ng-show="security.busy"></i> Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -292,6 +292,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
Client.configureApp($scope.app.id, 'memory_limit', { memoryLimit: memoryLimit }, function (error) {
|
||||
if (error) return Client.error(error);
|
||||
|
||||
$scope.resources.currentMemoryLimit = $scope.resources.memoryLimit;
|
||||
$scope.resources.success = true;
|
||||
$scope.resources.busy = false;
|
||||
|
||||
@@ -334,12 +335,14 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
error: {},
|
||||
success: false,
|
||||
|
||||
currentRobotsTxt: '',
|
||||
robotsTxt: '',
|
||||
|
||||
show: function () {
|
||||
var app = $scope.app;
|
||||
|
||||
$scope.security.robotsTxt = app.robotsTxt;
|
||||
$scope.security.currentRobotsTxt = app.robotsTxt;
|
||||
$scope.security.robotsTxt = $scope.security.currentRobotsTxt;
|
||||
},
|
||||
|
||||
submit: function () {
|
||||
@@ -349,6 +352,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
Client.configureApp($scope.app.id, 'robots_txt', { robotsTxt: $scope.security.robotsTxt }, function (error,) {
|
||||
if (error) return Client.error(error);
|
||||
|
||||
$scope.security.currentRobotsTxt = $scope.security.robotsTxt;
|
||||
$scope.security.success = true;
|
||||
$scope.security.busy = false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user