diff --git a/datamodels/2.x/itop-core-update/dictionaries/cs.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/cs.dict.itop-core-update.php index 3d0f5521d..f9816ce58 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/cs.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/cs.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('CS CZ', 'Czech', 'Čeština', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Database backup~~', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Check application upgrade~~', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgrade application~~', diff --git a/datamodels/2.x/itop-core-update/dictionaries/da.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/da.dict.itop-core-update.php index f09f5d441..321ebb88a 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/da.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/da.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('DA DA', 'Danish', 'Dansk', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Database backup~~', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Check application upgrade~~', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgrade application~~', diff --git a/datamodels/2.x/itop-core-update/dictionaries/de.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/de.dict.itop-core-update.php index 46484382a..8c4aaaaf9 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/de.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/de.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('DE DE', 'German', 'Deutsch', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup', 'iTopUpdate:UI:SetupLaunch' => 'Starte '.ITOP_APPLICATION_SHORT.' Setup', 'iTopUpdate:UI:SetupLaunchConfirm' => 'Hiermit wird der '.ITOP_APPLICATION_SHORT.' Setup, sind Sie sicher?', + 'iTopUpdate:UI:FastSetupLaunch' => 'Schnelles Setup', 'iTopUpdate:UI:SetupMessage:Backup' => 'Datenbankbackup', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Prüfung des Anwendungsupgrades', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgrade von Anwendung und Datenbank', diff --git a/datamodels/2.x/itop-core-update/dictionaries/en.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/en.dict.itop-core-update.php index 6b0f0b62d..1d41b246a 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/en.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/en.dict.itop-core-update.php @@ -83,6 +83,7 @@ Dict::Add('EN US', 'English', 'English', array( 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup', // Setup Messages 'iTopUpdate:UI:SetupMessage:Ready' => 'Ready to start', diff --git a/datamodels/2.x/itop-core-update/dictionaries/es_cr.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/es_cr.dict.itop-core-update.php index 293e47fae..603707083 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/es_cr.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/es_cr.dict.itop-core-update.php @@ -68,6 +68,7 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Respaldo de base de datos', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Revisar actualización de aplicación', 'iTopUpdate:UI:SetupMessage:Compile' => 'Actualizar aplicación y base de datos', diff --git a/datamodels/2.x/itop-core-update/dictionaries/fr.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/fr.dict.itop-core-update.php index 5ba2551b6..1ec33722f 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/fr.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/fr.dict.itop-core-update.php @@ -66,6 +66,7 @@ Dict::Add('FR FR', 'French', 'Français', [ 'iTopUpdate:UI:ServerFile' => 'Chemin d\'un package présent sur le serveur', 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup', 'iTopUpdate:UI:SetupLaunch' => 'Lancer le Setup', + 'iTopUpdate:UI:FastSetupLaunch' => 'Setup rapide', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?', 'iTopUpdate:UI:SetupMessage:Backup' => 'Sauvegarde des fichiers de l\'application', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Contrôle de la mise à jour', diff --git a/datamodels/2.x/itop-core-update/dictionaries/hu.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/hu.dict.itop-core-update.php index 23f95f6d6..946c564cd 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/hu.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/hu.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Adatbázis biztonsági mentése', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Alkalmazásfrissítés ellenőrzése', 'iTopUpdate:UI:SetupMessage:Compile' => 'Az alkalmazás és az adatbázis frissítése', diff --git a/datamodels/2.x/itop-core-update/dictionaries/it.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/it.dict.itop-core-update.php index 472599580..80d6d1b9c 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/it.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/it.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('IT IT', 'Italian', 'Italiano', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup', 'iTopUpdate:UI:SetupLaunch' => 'Avvia '.ITOP_APPLICATION_SHORT.' Setup', 'iTopUpdate:UI:SetupLaunchConfirm' => 'Questo avvierà '.ITOP_APPLICATION_SHORT.' setup, sei sicuro?', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Backup del Database', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Verifica aggiornamento dell\'applicazione', 'iTopUpdate:UI:SetupMessage:Compile' => 'Aggiornamento dell\'applicazione e del database', diff --git a/datamodels/2.x/itop-core-update/dictionaries/ja.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/ja.dict.itop-core-update.php index 880b4a562..95931272f 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/ja.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/ja.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('JA JP', 'Japanese', '日本語', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Database backup~~', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Check application upgrade~~', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgrade application~~', diff --git a/datamodels/2.x/itop-core-update/dictionaries/nl.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/nl.dict.itop-core-update.php index b3b8e24c8..36634d7af 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/nl.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/nl.dict.itop-core-update.php @@ -69,6 +69,7 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' setup', 'iTopUpdate:UI:SetupLaunch' => 'Start de '.ITOP_APPLICATION_SHORT.' setup', 'iTopUpdate:UI:SetupLaunchConfirm' => 'Dit zal de '.ITOP_APPLICATION_SHORT.' setup uitvoeren, ben je zeker?', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Maken van backup database', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Controleren van de upgrade van de toepassing', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgraden van toepassing en database', diff --git a/datamodels/2.x/itop-core-update/dictionaries/pl.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/pl.dict.itop-core-update.php index 19734ed72..bf9b6cbf6 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/pl.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/pl.dict.itop-core-update.php @@ -68,6 +68,7 @@ Dict::Add('PL PL', 'Polish', 'Polski', [ 'iTopUpdate:UI:Setup' => 'Konfiguracja '.ITOP_APPLICATION_SHORT, 'iTopUpdate:UI:SetupLaunch' => 'Uruchom konfigurację '.ITOP_APPLICATION_SHORT, 'iTopUpdate:UI:SetupLaunchConfirm' => 'Zostanie uruchomiona '.ITOP_APPLICATION_SHORT.' konfiguracja, jesteś pewien?', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Kopia zapasowa bazy danych', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Sprawdzenie aktualizacji aplikacji', 'iTopUpdate:UI:SetupMessage:Compile' => 'Aktualizacja aplikacji', diff --git a/datamodels/2.x/itop-core-update/dictionaries/pt_br.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/pt_br.dict.itop-core-update.php index db40220a2..bc471c832 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/pt_br.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/pt_br.dict.itop-core-update.php @@ -68,6 +68,7 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Backup do banco de dados', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Verificar atualização da aplicação', 'iTopUpdate:UI:SetupMessage:Compile' => 'Atualizar aplicação e banco de dados', diff --git a/datamodels/2.x/itop-core-update/dictionaries/ru.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/ru.dict.itop-core-update.php index eeea1203c..10aee87f3 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/ru.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/ru.dict.itop-core-update.php @@ -68,6 +68,7 @@ Dict::Add('RU RU', 'Russian', 'Русский', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Резервное копирование базы данных', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Проверка обновления', 'iTopUpdate:UI:SetupMessage:Compile' => 'Обновление приложения', diff --git a/datamodels/2.x/itop-core-update/dictionaries/sk.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/sk.dict.itop-core-update.php index 6e6152bc6..28d32c7a0 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/sk.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/sk.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('SK SK', 'Slovak', 'Slovenčina', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Database backup~~', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Check application upgrade~~', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgrade application~~', diff --git a/datamodels/2.x/itop-core-update/dictionaries/tr.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/tr.dict.itop-core-update.php index 31cbde266..822ed6292 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/tr.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/tr.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('TR TR', 'Turkish', 'Türkçe', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunch' => 'Launch '.ITOP_APPLICATION_SHORT.' Setup~~', 'iTopUpdate:UI:SetupLaunchConfirm' => 'This will launch '.ITOP_APPLICATION_SHORT.' setup, are you sure?~~', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => 'Database backup~~', 'iTopUpdate:UI:SetupMessage:CheckCompile' => 'Check application upgrade~~', 'iTopUpdate:UI:SetupMessage:Compile' => 'Upgrade application~~', diff --git a/datamodels/2.x/itop-core-update/dictionaries/zh_cn.dict.itop-core-update.php b/datamodels/2.x/itop-core-update/dictionaries/zh_cn.dict.itop-core-update.php index 45be58cfe..3ca3d6575 100644 --- a/datamodels/2.x/itop-core-update/dictionaries/zh_cn.dict.itop-core-update.php +++ b/datamodels/2.x/itop-core-update/dictionaries/zh_cn.dict.itop-core-update.php @@ -67,6 +67,7 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', [ 'iTopUpdate:UI:Setup' => ITOP_APPLICATION_SHORT.'安装', 'iTopUpdate:UI:SetupLaunch' => '启动'.ITOP_APPLICATION_SHORT.'安装', 'iTopUpdate:UI:SetupLaunchConfirm' => '将启动'.ITOP_APPLICATION_SHORT.'安装, 确定吗?', + 'iTopUpdate:UI:FastSetupLaunch' => 'Fast Setup~~', 'iTopUpdate:UI:SetupMessage:Backup' => '数据库备份', 'iTopUpdate:UI:SetupMessage:CheckCompile' => '检查更新', 'iTopUpdate:UI:SetupMessage:Compile' => '升级应用程序和数据库', diff --git a/datamodels/2.x/itop-core-update/src/Controller/AjaxController.php b/datamodels/2.x/itop-core-update/src/Controller/AjaxController.php index 6cbfd9ddf..6199dcab5 100644 --- a/datamodels/2.x/itop-core-update/src/Controller/AjaxController.php +++ b/datamodels/2.x/itop-core-update/src/Controller/AjaxController.php @@ -7,17 +7,20 @@ namespace Combodo\iTop\CoreUpdate\Controller; +require_once APPROOT.'setup/runtimeenv.class.inc.php'; use Combodo\iTop\Application\TwigBase\Controller\Controller; use Combodo\iTop\CoreUpdate\Service\CoreUpdater; use Combodo\iTop\DBTools\Service\DBToolsUtils; use Combodo\iTop\FilesInformation\Service\FileNotExistException; use Combodo\iTop\FilesInformation\Service\FilesInformation; +use Config; use ContextTag; use Dict; use Exception; use IssueLog; use MetaModel; +use RunTimeEnvironment; use SecurityException; use SetupUtils; use utils; @@ -258,6 +261,30 @@ class AjaxController extends Controller $this->DisplayJSONPage($aParams, $iResponseCode); } + function OperationRebuildToolkitEnvironment() + { + $sTransactionId = utils::GetNewTransactionId(); + $aParams = []; + $aParams['sTransactionId'] = $sTransactionId; + $aParams['bStatus'] = true; + + $iResponseCode = 200; + try { + $aParams['sAjaxURL'] = utils::GetAbsoluteUrlAppRoot().'/pages/UI.php'; + $oConfig = new Config(APPCONF.'production'.'/'.ITOP_CONFIG_FILE); + $oEnvironment = new RunTimeEnvironment('production'); + $oEnvironment->WriteConfigFileSafe($oConfig); + $oEnvironment->CompileFrom('production'); + } + catch (Exception $e) { + IssueLog::Error('RebuildToolkitEnvironment: '.$e->getMessage()); + $aParams['sError'] = $e->getMessage(); + $iResponseCode = 500; + $aParams['bStatus'] = false; + } + $this->DisplayJSONPage($aParams, $iResponseCode); + } + /** * @throws \SecurityException if CSRF token invalid * diff --git a/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.html.twig b/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.html.twig index 5b3deddee..33d68114e 100644 --- a/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.html.twig +++ b/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.html.twig @@ -90,6 +90,13 @@ {% UIForm Standard {'sId':'launch-setup-form', Action:sLaunchSetupUrl} %} {% UIButton ForDestructiveAction {'sLabel':'iTopUpdate:UI:SetupLaunch'|dict_s, 'sName':'launch-setup', 'sValue':'launch-setup', 'bIsSubmit':true, 'sId':'launch-setup'} %} {% EndUIForm %} + {% UIAlert ForInformation {sId:'fast-setup-alert', AddCSSClass:'ibo-is-hidden'} %} + {% UIContentBlock Standard {sId:'fast-setup-content', aContainerClasses:['ibo-fast-setup-content']} %} + {{ 'iTopUpdate:UI:SetupMessage:Compile'|dict_s }} + {% EndUIContentBlock %} + {% EndUIAlert %} + {% UIButton ForDestructiveAction {sLabel:'iTopUpdate:UI:FastSetupLaunch'|dict_s, sName:'launch-fast-setup', sValue:'launch-fast-setup', sId:'launch-fast-setup'} %} + {% UISpinner Standard {sId:'fast-setup-wait', IsHidden:true} %} {% EndUIFieldSet %} {% endif %} diff --git a/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.ready.js.twig b/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.ready.js.twig index 40232213e..1e731f6c4 100644 --- a/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.ready.js.twig +++ b/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.ready.js.twig @@ -114,4 +114,42 @@ $("#check-update").on("click", function(e) { $("#launch-setup-form").on("submit", function () { return window.confirm("{{ 'iTopUpdate:UI:SetupLaunchConfirm'|dict_s }}"); -}); \ No newline at end of file +}); + +$("#launch-fast-setup").on("click", function(e) { + var oMessage = $("#fast-setup-alert"); + var oContent = $("#fast-setup-content"); + oMessage.removeClass("ibo-is-hidden"); + oMessage.addClass("ibo-is-information"); + oContent.html("{{ 'iTopUpdate:UI:SetupMessage:Compile'|dict_s }}"); + + let fast_setup_wait = $("#fast-setup-wait"); + fast_setup_wait.removeClass("ibo-is-hidden"); + $(this).prop("disabled", true); + + $.ajax({ + method: "POST", + url: "{{ sAjaxURL|raw }}", + data: { + route: "core_update_ajax.rebuild_toolkit_environment" + }, + dataType: "json", + success: function (data) { + oMessage.removeClass("ibo-is-information"); + + if (data.bStatus) { + oMessage.addClass("ibo-is-success"); + oContent.html("{{ 'iTopUpdate:UI:SetupMessage:UpdateDone'|dict_s }}"); + } else { + oMessage.addClass("ibo-is-failure"); + oContent.html(data.sError); + } + + $("#fast-setup-wait").addClass("ibo-is-hidden"); + $("#launch-fast-setup").prop("disabled", false); + fast_setup_wait.addClass("ibo-is-hidden"); + } + }); + +}); +