Add node overview

feature/node-rewrite
Sven Slootweg 12 years ago
parent 753e122d81
commit ee3fbcf781

@ -30,6 +30,7 @@ title-password; Set new root password
title-console; Out-of-band console
title-admin-userlist; User overview
title-admin-containerlist; Container overview
title-admin-nodelist; Node overview
title-admin-userinfo; User lookup
title-admin-overview; Administrative overview
title-admin-vps-suspend; Suspend container
@ -70,6 +71,7 @@ menu-password; Root Password
menu-admin-overview; Overview
menu-admin-users; Users
menu-admin-containers; Containers
menu-admin-nodes; Nodes
login-username; Username
login-password; Password
@ -103,6 +105,7 @@ list-column-node; Node
list-column-disk; Disk space
list-column-ram; RAM
list-column-template; Template
list-column-location; Physical location
list-status-running; Running
list-status-stopped; Stopped
list-status-suspended; Suspended

@ -0,0 +1,34 @@
<?php
/*
* CVM is more free software. It is licensed under the WTFPL, which
* allows you to do pretty much anything with it, without having to
* ask permission. Commercial use is allowed, and no attribution is
* required. We do politely request that you share your modifications
* to benefit other developers, but you are under no enforced
* obligation to do so :)
*
* Please read the accompanying LICENSE document for the full WTFPL
* licensing text.
*/
if(!isset($_CVM)) { die("Unauthorized."); }
$sNodeList = array();
if($result = mysql_query_cached("SELECT * FROM nodes"))
{
foreach($result->data as $row)
{
$sNode = new Node($row);
$sNodeList[] = array(
'id' => $sNode->sId,
'hostname' => $sNode->sHostname,
'location' => $sNode->sPhysicalLocation
);
}
}
$sPageContents = Templater::AdvancedParse("admin.nodes", $locale->strings, array(
'nodes' => $sNodeList
));

@ -123,6 +123,12 @@ try
'auth_error' => "error.access.php",
'_menu' => "admin"
),
'^/admin/nodes/?$' => array(
'target' => "module.admin.nodes.php",
'authenticator' => "authenticator.admin.php",
'auth_error' => "error.access.php",
'_menu' => "admin"
),
'^/admin/container/([0-9]+)/suspend/?$' => array(
'target' => "module.admin.container.suspend.php",
'authenticator' => "authenticator.admin.php",

@ -0,0 +1,20 @@
<h2>{%!title-admin-nodelist}</h2>
<table class="vpslist">
<tr>
<th>{%!list-column-hostname}</th>
<th>{%!list-column-location}</th>
</tr>
{%foreach node in nodes}
<tr class="clickable" data-url="/admin/node/{%?node[id]}/">
<td>
<a href="/admin/node/{%?node[id]}/">
{%?node[hostname]}
</a>
</td>
<td>
{%?node[location]}
</td>
</tr>
{%/foreach}
</table>

@ -1,5 +1,6 @@
<div class="sidebar">
<a class="sidebutton" href="/admin/">{%!menu-admin-overview}</a>
<a class="sidebutton" href="/admin/nodes/">{%!menu-admin-nodes}</a>
<a class="sidebutton" href="/admin/users/">{%!menu-admin-users}</a>
<a class="sidebutton" href="/admin/containers/">{%!menu-admin-containers}</a>
</div>

Loading…
Cancel
Save