Replace 'container' with 'vps' in various places

feature/node-rewrite
Sven Slootweg 12 years ago
parent 62588bee99
commit 51f59ad69d

@ -245,7 +245,7 @@ admin-level-masteradmin; Master administrator
header-admin-user-containers; VPSes owned by this user header-admin-user-containers; VPSes owned by this user
## VPS list ## VPS list
title-admin-containerlist; VPS overview title-admin-vpslist; VPS overview
list-column-hostname; Hostname list-column-hostname; Hostname
list-column-platform; Platform list-column-platform; Platform
list-column-node; Node list-column-node; Node

@ -19,25 +19,24 @@ if($result = mysql_query_cached("SELECT * FROM containers"))
{ {
foreach($result->data as $row) foreach($result->data as $row)
{ {
$sContainer = new Container($row); $sVps = new Container($row);
$sContainerList[] = array( $sVpsList[] = array(
'id' => $sContainer->sId, 'id' => $sVps->sId,
'hostname' => $sContainer->sHostname, 'hostname' => $sVps->sHostname,
'node' => $sContainer->sNode->sName, 'node' => $sVps->sNode->sName,
'node-hostname' => $sContainer->sNode->sHostname, 'node-hostname' => $sVps->sNode->sHostname,
'template' => $sContainer->sTemplate->sName, 'template' => $sVps->sTemplate->sName,
'diskspace' => number_format($sContainer->sDiskSpace / 1024), 'diskspace' => number_format($sVps->sDiskSpace / 1024),
'diskspace-unit' => "GB", 'diskspace-unit' => "GB",
'guaranteed-ram' => $sContainer->sGuaranteedRam, 'guaranteed-ram' => $sVps->sGuaranteedRam,
'guaranteed-ram-unit' => "MB", 'guaranteed-ram-unit' => "MB",
'status' => $sContainer->sStatusText, 'status' => $sVps->sStatusText,
'virtualization-type' => $sContainer->sVirtualizationType 'virtualization-type' => $sVps->sVirtualizationType
); );
} }
} }
/* TODO: Change variable name to phase out the use of the term "container". */
$sPageContents = Templater::AdvancedParse("{$sTheme}/admin/vps/list", $locale->strings, array( $sPageContents = Templater::AdvancedParse("{$sTheme}/admin/vps/list", $locale->strings, array(
'containers' => $sContainerList 'vpses' => $sVpsList
)); ));

@ -1,4 +1,4 @@
<h2>{%!title-admin-containerlist}</h2> <h2>{%!title-admin-vpslist}</h2>
<table class="vpslist"> <table class="vpslist">
<tr> <tr>
@ -9,44 +9,44 @@
<th>{%!list-column-ram}</th> <th>{%!list-column-ram}</th>
<th>{%!list-column-template}</th> <th>{%!list-column-template}</th>
</tr> </tr>
{%foreach container in containers} {%foreach vps in vpses}
<tr class="clickable" data-url="/{%?container[id]}/"> <tr class="clickable" data-url="/{%?vps[id]}/">
<td class="container-status"> <td class="container-status">
{%if container[status] == running} {%if vps[status] == running}
<img src="/images/icon_online.png" alt="{%!list-status-running}"> <img src="/images/icon_online.png" alt="{%!list-status-running}">
{%/if}{%if container[status] == stopped} {%/if}{%if vps[status] == stopped}
<img src="/images/icon_offline.png" alt="{%!list-status-stopped}"> <img src="/images/icon_offline.png" alt="{%!list-status-stopped}">
{%/if}{%if container[status] == suspended} {%/if}{%if vps[status] == suspended}
<img src="/images/icon_suspended.png" alt="{%!list-status-suspended}"> <img src="/images/icon_suspended.png" alt="{%!list-status-suspended}">
{%/if} {%/if}
</td> </td>
<td> <td>
<a href="/{%?container[id]}/"> <a href="/{%?vps[id]}/">
{%?container[hostname]} {%?vps[hostname]}
</a> </a>
</td> </td>
<td> <td>
<a href="/{%?container[id]}/"> <a href="/{%?vps[id]}/">
{%if container[virtualization-type] == 1} {%if vps[virtualization-type] == 1}
OpenVZ OpenVZ
{%/if}{%if container[virtualization-type] == 2} {%/if}{%if vps[virtualization-type] == 2}
Xen PV Xen PV
{%/if}{%if container[virtualization-type] == 3} {%/if}{%if vps[virtualization-type] == 3}
Xen HVM Xen HVM
{%/if}{%if container[virtualization-type] == 4} {%/if}{%if vps[virtualization-type] == 4}
KVM KVM
{%/if} {%/if}
</a> </a>
</td> </td>
<td> <td>
{%?container[diskspace]} {%?vps[diskspace]}
<span class="unit">{%?container[diskspace-unit]}</span> <span class="unit">{%?vps[diskspace-unit]}</span>
</td> </td>
<td> <td>
{%?container[guaranteed-ram]} {%?vps[guaranteed-ram]}
<span class="unit">{%?container[guaranteed-ram-unit]}</span> <span class="unit">{%?vps[guaranteed-ram-unit]}</span>
</td> </td>
<td>{%?container[template]}</td> <td>{%?vps[template]}</td>
</tr> </tr>
{%/foreach} {%/foreach}
</table> </table>

Loading…
Cancel
Save