* Adjust solution install progress page.

This commit is contained in:
caoyanyi
2023-10-24 10:56:17 +08:00
parent feeefdc819
commit 9bc06c3846
6 changed files with 52 additions and 11 deletions
+2 -1
View File
@@ -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');
+6 -5
View File
@@ -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 = [];
var shownLogs = [];
+16 -4
View File
@@ -19,18 +19,29 @@
<?php js::set('installLabel', $lang->solution->install);?>
<?php js::set('configLabel', $lang->solution->config);?>
<?php js::set('startInstall', $install);?>
<?php js::set('skipLang', $lang->install->solution->skip);?>
<?php js::set('backgroundLang', $lang->solution->background);?>
<?php if(isonlybody()):?>
<style>
.solution-progress {margin-top: -20px;}
.m-install-progress .modal-dialog {margin-top: 0;}
</style>
<?php endif;?>
<div class='container'>
<div class='modal-dialog'>
<?php if(!isonlybody()):?>
<div class='modal-header'>
<h3><?php echo $lang->install->solution->progress;?></h3>
</div>
<?php endif;?>
<div class='modal-body'>
<div class='solution-progress'>
<div id='terminal'><h3><?php echo $lang->install->solution->log;?></h3></div>
<div class='text-center'>
<?php $components = json_decode($solution->components);?>
<?php $order =0;?>
<?php $order = 0;?>
<?php foreach($components as $category => $cloudApp):?>
<?php $active = (isset($cloudApp->status) && $cloudApp->status !='waiting') ? 'active' : '';?>
<?php if($order++ > 0):?>
@@ -47,14 +58,15 @@
<span class='progress-message'></span>
</div>
<div class='error-message text-red text-center'></div>
<?php if(!isonlybody()):?>
<div class='form-actions text-center'>
<?php echo html::a(inlink('step6'), $lang->install->solution->skip, '', "class='btn btn-install btn-wide' style='display: none;' id='skipInstallBtn'");?>
<?php echo html::a(inlink('step6'), $lang->solution->background, '', "class='btn btn-install btn-primary btn-wide' id='skipInstallBtn'");?>
<?php echo html::commonButton($lang->solution->retryInstall, "id='retryInstallBtn' class='hide'", 'btn btn-primary btn-wide');?>
<?php echo html::commonButton($lang->solution->cancelInstall, "id='cancelInstallBtn'", 'btn btn-primary btn-wide');?>
<?php echo html::commonButton($lang->solution->cancelInstall, "id='cancelInstallBtn'", 'btn btn-wide');?>
</div>
<?php endif;?>
</div>
</div>
</div>
</div>
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
+14
View File
@@ -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();
}
}
+5
View File
@@ -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];
+9 -1
View File
@@ -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();