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
## VPS list
title-admin-containerlist; VPS overview
title-admin-vpslist; VPS overview
list-column-hostname; Hostname
list-column-platform; Platform
list-column-node; Node

@ -19,25 +19,24 @@ if($result = mysql_query_cached("SELECT * FROM containers"))
{
foreach($result->data as $row)
{
$sContainer = new Container($row);
$sVps = new Container($row);
$sContainerList[] = array(
'id' => $sContainer->sId,
'hostname' => $sContainer->sHostname,
'node' => $sContainer->sNode->sName,
'node-hostname' => $sContainer->sNode->sHostname,
'template' => $sContainer->sTemplate->sName,
'diskspace' => number_format($sContainer->sDiskSpace / 1024),
$sVpsList[] = array(
'id' => $sVps->sId,
'hostname' => $sVps->sHostname,
'node' => $sVps->sNode->sName,
'node-hostname' => $sVps->sNode->sHostname,
'template' => $sVps->sTemplate->sName,
'diskspace' => number_format($sVps->sDiskSpace / 1024),
'diskspace-unit' => "GB",
'guaranteed-ram' => $sContainer->sGuaranteedRam,
'guaranteed-ram' => $sVps->sGuaranteedRam,
'guaranteed-ram-unit' => "MB",
'status' => $sContainer->sStatusText,
'virtualization-type' => $sContainer->sVirtualizationType
'status' => $sVps->sStatusText,
'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(
'containers' => $sContainerList
'vpses' => $sVpsList
));

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

Loading…
Cancel
Save