From a8863d0bd1b024df6e4f5c2fbb578d1b56470d94 Mon Sep 17 00:00:00 2001 From: Edoardo Spadoni Date: Tue, 21 Nov 2023 13:08:32 +0100 Subject: [PATCH] step 1. removed POST settings/language --- .../scripts/controllers/admin/languages.js | 52 +++---------------- wizard/app/views/admin/languages.html | 15 ------ 2 files changed, 6 insertions(+), 61 deletions(-) diff --git a/wizard/app/scripts/controllers/admin/languages.js b/wizard/app/scripts/controllers/admin/languages.js index 8d8070b7..26bdf7bc 100644 --- a/wizard/app/scripts/controllers/admin/languages.js +++ b/wizard/app/scripts/controllers/admin/languages.js @@ -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; }); }; diff --git a/wizard/app/views/admin/languages.html b/wizard/app/views/admin/languages.html index ebc8cca1..45e50083 100644 --- a/wizard/app/views/admin/languages.html +++ b/wizard/app/views/admin/languages.html @@ -41,21 +41,6 @@

{{'Set system language' | translate}} -
-
- - - {{'Installing' | translate}}: {{'system languages' | translate}} - {{'Error' | translate}}: {{'installation failed' | translate}} -
-
-
- {{currentProgress == -1 ? '100' : currentProgress}}% -
-
-