Remove cloudron name related UI in the settings view
This commit is contained in:
@@ -32,36 +32,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal change name -->
|
||||
<div class="modal fade" id="nameChangeModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Change the Cloudron Name</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form name="nameChangeForm" class="form-signin" role="form" novalidate ng-submit="doChangeName()" autocomplete="off">
|
||||
<fieldset>
|
||||
<div class="form-group" ng-class="{ 'has-error': (nameChangeForm.name.$dirty && nameChangeForm.name.$invalid) }">
|
||||
<label class="control-label" for="inputNameChangeName">New Cloudron Name</label>
|
||||
<div class="control-label" ng-show="(!nameChangeForm.name.$dirty && nameChange.error.name) || (nameChangeForm.name.$dirty && nameChangeForm.name.$invalid)">
|
||||
<small ng-show="nameChangeForm.name.$error.required">A valid name is required</small>
|
||||
<small ng-show="(nameChangeForm.name.$dirty && nameChangeForm.name.$invalid) && !nameChangeForm.name.$error.required">The name is not valid</small>
|
||||
</div>
|
||||
<input type="text" class="form-control" ng-model="nameChange.name" id="inputNameChangeName" name="name" ng-maxlength="512" ng-minlength="1" required autofocus>
|
||||
</div>
|
||||
<input class="ng-hide" type="submit" ng-disabled="nameChangeForm.$invalid"/>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-success" ng-click="doChangeName()" ng-disabled="nameChangeForm.$invalid || nameChange.busy"><i class="fa fa-spinner fa-pulse" ng-show="nameChange.busy"></i> Change</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal change avatar -->
|
||||
<div class="modal fade" id="avatarChangeModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
@@ -160,10 +130,6 @@
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="text-muted" style="vertical-align: top;">Name</td>
|
||||
<td class="text-right" style="vertical-align: top; white-space: nowrap;">{{ config.cloudronName }} <a href="" ng-click="showChangeName()"><i class="fa fa-pencil text-small"></i></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted" style="vertical-align: top;">Model</td>
|
||||
<td class="text-right" style="vertical-align: top; white-space: nowrap;">{{ config.size }} - {{ config.region }}</td>
|
||||
|
||||
@@ -24,12 +24,6 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
|
||||
percent: 100
|
||||
};
|
||||
|
||||
$scope.nameChange = {
|
||||
busy: false,
|
||||
error: {},
|
||||
name: ''
|
||||
};
|
||||
|
||||
$scope.avatarChange = {
|
||||
busy: false,
|
||||
error: {},
|
||||
@@ -97,14 +91,6 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
|
||||
$('#avatarFileInput').click();
|
||||
};
|
||||
|
||||
function nameChangeReset() {
|
||||
$scope.nameChange.error.name = null;
|
||||
$scope.nameChange.name = '';
|
||||
|
||||
$scope.nameChangeForm.$setPristine();
|
||||
$scope.nameChangeForm.$setUntouched();
|
||||
}
|
||||
|
||||
function avatarChangeReset() {
|
||||
$scope.avatarChange.error.avatar = null;
|
||||
$scope.avatarChange.avatar = null;
|
||||
@@ -156,22 +142,6 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
|
||||
});
|
||||
};
|
||||
|
||||
$scope.doChangeName = function () {
|
||||
$scope.nameChange.error.name = null;
|
||||
$scope.nameChange.busy = true;
|
||||
|
||||
Client.changeCloudronName($scope.nameChange.name, function (error) {
|
||||
if (error) {
|
||||
console.error('Unable to change name.', error);
|
||||
} else {
|
||||
nameChangeReset();
|
||||
$('#nameChangeModal').modal('hide');
|
||||
}
|
||||
|
||||
$scope.nameChange.busy = false;
|
||||
});
|
||||
};
|
||||
|
||||
function getBlobFromImg(img, callback) {
|
||||
var size = 256;
|
||||
|
||||
@@ -263,11 +233,6 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
|
||||
$('#developerModeChangeModal').modal('show');
|
||||
};
|
||||
|
||||
$scope.showChangeName = function () {
|
||||
nameChangeReset();
|
||||
$('#nameChangeModal').modal('show');
|
||||
};
|
||||
|
||||
$scope.showCreateBackup = function () {
|
||||
$('#createBackupModal').modal('show');
|
||||
};
|
||||
@@ -301,7 +266,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
|
||||
});
|
||||
|
||||
// setup all the dialog focus handling
|
||||
['developerModeChangeModal', 'nameChangeModal'].forEach(function (id) {
|
||||
['developerModeChangeModal'].forEach(function (id) {
|
||||
$('#' + id).on('shown.bs.modal', function () {
|
||||
$(this).find("[autofocus]:first").focus();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user