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() 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"; return "running";
} }
elseif($this->GetStatus() == CVM_STATUS_STOPPED) elseif($status == CVM_STATUS_STOPPED)
{ {
return "stopped"; return "stopped";
} }
elseif($this->GetStatus() == CVM_STATUS_SUSPENDED) elseif($status == CVM_STATUS_SUSPENDED)
{ {
return "suspended"; return "suspended";
} }

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

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

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

Loading…
Cancel
Save