Skip to content

Commit

Permalink
step 1. removed POST settings/language
Browse files Browse the repository at this point in the history
  • Loading branch information
edospadoni committed Nov 21, 2023
1 parent c80719a commit a8863d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 61 deletions.
52 changes: 6 additions & 46 deletions wizard/app/scripts/controllers/admin/languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,58 +51,18 @@ angular.module('nethvoiceWizardUiApp')
$scope.onSaveSuccess = false;
$scope.onSaveError = false;
$scope.wizard.nextState = true;
ConfigService.setPBXLang({

// set default language
ConfigService.setDefaultPBXLang({
lang: lang
}).then(function (res) {
$scope.taskPromise = $interval(function () {
UtilService.taskStatus(res.data.result).then(function (res) {
if (res.data.progress < 100) {
$scope.errorCount = 0;
$scope.currentProgress = res.data.progress;
} else if (res.data.progress == 100) {
$scope.errorCount = 0;
$interval.cancel($scope.taskPromise);
$scope.currentProgress = 100;
// set default language
ConfigService.setDefaultPBXLang({
lang: lang
}).then(function (res) {
$scope.currentLanguage = $scope.language;
$scope.onSaveSuccess = true;
$scope.onSaveError = false;
}, function (err) {
console.error(err);
$scope.onSaveSuccess = false;
$scope.onSaveError = true;
});
} else {
console.log(res.error);
if ($scope.errorCount < appConfig.MAX_TRIES) {
$scope.errorCount++;
} else {
$interval.cancel($scope.taskPromise);
$scope.currentProgress = -1;
$scope.onSaveSuccess = false;
$scope.onSaveError = true;
}
}
}, function (err) {
console.log(err);
if ($scope.errorCount < appConfig.MAX_TRIES) {
$scope.errorCount++;
} else {
$interval.cancel($scope.taskPromise);
$scope.currentProgress = -1;
$scope.onSaveSuccess = false;
$scope.onSaveError = true;
}
});
}, 5000);
$scope.currentLanguage = $scope.language;
$scope.onSaveSuccess = true;
$scope.onSaveError = false;
}, function (err) {
console.error(err);
$scope.onSaveSuccess = false;
$scope.onSaveError = true;
$scope.currentProgress = 100;
});
};

Expand Down
15 changes: 0 additions & 15 deletions wizard/app/views/admin/languages.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,6 @@ <h3>{{'Set system language' | translate}} <span ng-if="language" class="slim-wei
</div>
</div>
</form>
<div ng-show="startInstallation">
<div class="progress-description">
<div ng-if="currentProgress < 100 && currentProgress != -1" class="spinner spinner-xs spinner-inline"></div>
<span ng-if="currentProgress == 100" class="pficon pficon-ok"></span>
<span ng-if="currentProgress == -1" class="pficon pficon-error-circle-o"></span>
<span ng-if="currentProgress != -1"><strong>{{'Installing' | translate}}:</strong> {{'system languages' | translate}}</span>
<span ng-if="currentProgress == -1"><strong>{{'Error' | translate}}:</strong> {{'installation failed' | translate}}</span>
</div>
<div class="progress progress-label-top-right">
<div class="progress-bar {{currentProgress == -1 ? 'progress-bar-danger' : 'progress-bar-success'}}" role="progressbar" aria-valuenow="0"
aria-valuemin="0" aria-valuemax="100" style="width: {{currentProgress == -1 ? '100' : currentProgress}}%;">
<span>{{currentProgress == -1 ? '100' : currentProgress}}%</span>
</div>
</div>
</div>
</div>
</div>
<wizard-step ng-if="wizard.isWizard" id="wizardStepBase"></wizard-step>
Expand Down

0 comments on commit a8863d0

Please sign in to comment.