Some fixes to make status actually accurate

feature/node-rewrite
Sven Slootweg 13 years ago
parent df7751ce80
commit 341d74c469

@ -103,15 +103,24 @@ class Container extends CPHPDatabaseRecordClass
public function GetStatusText()
{
if($this->GetStatus() == CVM_STATUS_STARTED)
if(isset($this->sStatus))
{
$status = $this->sStatus;
}
else
{
$status = $this->GetStatus();
}
if($status == CVM_STATUS_STARTED)
{
return "running";
}
elseif($this->GetStatus() == CVM_STATUS_STOPPED)
elseif($status == CVM_STATUS_STOPPED)
{
return "stopped";
}
elseif($this->GetStatus() == CVM_STATUS_SUSPENDED)
elseif($status == CVM_STATUS_SUSPENDED)
{
return "suspended";
}

@ -50,6 +50,12 @@ table.vpsinfo td
clear: both;
}
.preload
{
width: 1px;
height: 1px;
}
.wrapper
{
width: 900px;

@ -16,6 +16,7 @@ if($_GET['action'] == "start")
try
{
$sContainer->Start();
$sContainer->sStatus = CVM_STATUS_STARTED;
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container started", "Your container was successfully started.");
$sError .= $err->Render();
@ -39,6 +40,7 @@ elseif($_GET['action'] == "stop")
try
{
$sContainer->Stop();
$sContainer->sStatus = CVM_STATUS_STOPPED;
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container stopped", "Your container was successfully stopped.");
$sError .= $err->Render();
@ -69,6 +71,7 @@ elseif($_GET['action'] == "restart")
}
$sContainer->Start();
$sContainer->sStatus = CVM_STATUS_STARTED;
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container restarted", "Your container was successfully restarted.");
$sError .= $err->Render();

@ -117,5 +117,6 @@
</div>
</div>
</div>
<img class="preload" src="images/loading.gif">
</body>
</html>

Loading…
Cancel
Save