* Adjust code.

This commit is contained in:
zenggang
2023-08-29 07:13:37 +00:00
parent 922a78e71d
commit d2a9a821d6
5 changed files with 9 additions and 8 deletions
+5 -5
View File
@@ -420,12 +420,12 @@ class instance extends control
$freeMemory = intval($clusterResource->metrics->memory->allocatable * 0.9); // Remain 10% memory for system.
if($cloudApp->memory > $freeMemory)
{
$this->view->cloudApp = $cloudApp;
$this->view->gapMemory = helper::formatKB(intval(($cloudApp->memory - $freeMemory)));
$this->view->requiredMemory = helper::formatKB(intval($cloudApp->memory));
$this->view->freeMemory = helper::formatKB(intval($freeMemory));
$cloudApp = $cloudApp;
$gapMemory = helper::formatKB(intval(($cloudApp->memory - $freeMemory)));
$requiredMemory = helper::formatKB(intval($cloudApp->memory));
$freeMemory = helper::formatKB(intval($freeMemory));
return $this->display('instance','resourceerror');
return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->instance->errors->notEnoughMemory, $cloudApp->alias, $requiredMemory, $freeMemory, $gapMemory)));
}
}