* Add update log of upgrade page.

This commit is contained in:
zhaoke
2023-07-27 11:03:17 +08:00
parent f842e17c67
commit 7f1acf3767
4 changed files with 28 additions and 3 deletions
+3 -2
View File
@@ -326,8 +326,9 @@ class instance extends control
return $this->send(array('result' => 'success', 'message' => $this->lang->instance->notices['upgradeSuccess'], 'load' => $this->createLink('instance', 'view', "id=$id"), 'closeModal' => true));
}
$this->view->title = $this->lang->instance->upgrade . $instance->name;
$this->view->instance = $instance;
$this->view->title = $this->lang->instance->upgrade . $instance->name;
$this->view->desc = $this->instanceZen->getLastArticle($instance->appID);
$this->view->instance = $instance;
$this->display();
}
+1 -1
View File
@@ -29,7 +29,7 @@ window.afterPageUpdate = function()
{
setTimeout(function()
{
if(reloadTimes > 10) return;
if(reloadTimes > 20) return;
if($('#statusTD').data('reload') === true || $('#memoryRate').data('load') == true)
{
reloadTimes++;
+1
View File
@@ -18,6 +18,7 @@ formPanel
set::title(''),
set::actions(array('submit')),
set::submitBtnText($lang->instance->upgrade),
h::p($desc),
span
(
setClass('p-5'),
+23
View File
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
class instanceZen extends instance
{
/**
* 获取最新一条app动态。
* Get the last article of an app.
*
* @param int $appID
* @access protected
* @return string
*/
protected function getLastArticle(int $appID): string
{
$appInfo = $this->store->getAppInfo($appID, true);
if(empty($appInfo)) return '';
$dynamicResult = $this->store->appDynamic($appInfo, 1, 1);
if(empty($dynamicResult) || empty($dynamicResult->articles)) return '';
return $dynamicResult->articles[0]->title;
}
}