diff --git a/module/install/control.php b/module/install/control.php index 79a65ce44d..fbf06cd7c0 100644 --- a/module/install/control.php +++ b/module/install/control.php @@ -19,7 +19,8 @@ class install extends control */ public function __construct() { - if(!defined('IN_INSTALL')) helper::end(); + if(!defined('IN_INSTALL') && !isonlybody()) helper::end(); + parent::__construct(); $this->app->loadLang('user'); $this->app->loadLang('admin'); diff --git a/module/install/js/progress.js b/module/install/js/progress.js index 5fc55b149d..02381eb7ed 100644 --- a/module/install/js/progress.js +++ b/module/install/js/progress.js @@ -45,7 +45,7 @@ $(function() if(res.logs.hasOwnProperty(cloudApp.chart)) { if(!shownLogs.hasOwnProperty(cloudApp.chart)) shownLogs[cloudApp.chart] = []; - + var logs = res.logs[cloudApp.chart] for(var j in logs) { @@ -67,7 +67,8 @@ $(function() else { $('#retryInstallBtn').show(); - $('#skipInstallBtn').show(); + $('#skipInstallBtn').removeClass('btn-primary'); + $('#skipInstallBtn').text(skipLang); $('#cancelInstallBtn').hide(); $('.progress.loading').hide(); @@ -117,7 +118,8 @@ $(function() if(!result) return; $('#retryInstallBtn').hide(); - $('#skipInstallBtn').hide(); + $('#skipInstallBtn').text(backgroundLang); + $('#skipInstallBtn').addClass('btn-primary'); $('#cancelInstallBtn').show(); $('.error-message').text(''); $('.progress.loading').show(); @@ -142,7 +144,6 @@ $(function() }); $('#retryInstallBtn').hide(); - $('#skipInstallBtn').hide(); $('#cancelInstallBtn').show(); if('true' === startInstall) @@ -154,4 +155,4 @@ $(function() term.open(document.getElementById('terminal')); }); -var shownLogs = []; \ No newline at end of file +var shownLogs = []; diff --git a/module/install/view/progress.html.php b/module/install/view/progress.html.php index 6064645375..98f8ae9655 100644 --- a/module/install/view/progress.html.php +++ b/module/install/view/progress.html.php @@ -19,18 +19,29 @@ solution->install);?> solution->config);?> +install->solution->skip);?> +solution->background);?> + + + +
- app->getModuleRoot() . '/common/view/footer.html.php';?> diff --git a/module/solution/model.php b/module/solution/model.php index e041b67014..63eadbb690 100644 --- a/module/solution/model.php +++ b/module/solution/model.php @@ -529,4 +529,18 @@ class solutionModel extends model file_put_contents($errorFile, $message . "\n", FILE_APPEND); } + + /** + * Get last solution. + * + * @access public + * @return object + */ + public function getLastSolution() + { + return $this->dao->select('*')->from(TABLE_SOLUTION) + ->where('deleted')->eq(0) + ->orderBy('id_desc') + ->fetch(); + } } diff --git a/module/space/control.php b/module/space/control.php index f390a71457..1f6b02ecca 100644 --- a/module/space/control.php +++ b/module/space/control.php @@ -88,10 +88,15 @@ class space extends control $pager = new pager($recTotal, $recPerPage, $pageID); $allInstances = array_chunk($allInstances, $pager->recPerPage); + $solutionID = 0; + $solution = $this->loadModel('solution')->getLastSolution(); + if($solution && $solution->status == 'installing') $solutionID = $solution->id; + $this->view->title = $this->lang->space->common; $this->view->position[] = $this->lang->space->common; $this->view->pager = $pager; $this->view->orderBy = $orderBy; + $this->view->solutionID = $solutionID; $this->view->browseType = $browseType; $this->view->spaceType = $spaceType; $this->view->instances = (empty($allInstances) or empty($allInstances[$pageID - 1])) ? array() : $allInstances[$pageID - 1]; diff --git a/module/space/ui/browse.html.php b/module/space/ui/browse.html.php index 4463e2a3cd..87e5dd33ee 100644 --- a/module/space/ui/browse.html.php +++ b/module/space/ui/browse.html.php @@ -30,6 +30,15 @@ featureBar toolBar ( + $config->inQuickon && $solutionID && hasPriv('install', 'progress') ? item(set(array + ( + 'text' => $lang->solution->progress, + 'icon' => 'spinner-indicator', + 'class' => 'btn ghost', + 'url' => createLink('install', 'progress', "solutionID=$solutionID&install=true", '', true), + 'data-size' => 800, + 'data-toggle' => 'iframeModal', + ))) : null, $config->inQuickon && $canInstall ? item(set(array ( 'text' => $lang->store->cloudStore, @@ -59,4 +68,3 @@ dtable a(setStyle('display', 'none'), setID('editLinkContainer'), setData('toggle', 'modal')); render(); -