diff --git a/frontend/css/cvm.css b/frontend/css/cvm.css index e15ac33..2052949 100644 --- a/frontend/css/cvm.css +++ b/frontend/css/cvm.css @@ -23,6 +23,8 @@ h2 h3 { font-size: 20px; + margin-top: 8px; + margin-bottom: 3px; } p diff --git a/frontend/locales/english.lng b/frontend/locales/english.lng index f166412..2aecdd1 100644 --- a/frontend/locales/english.lng +++ b/frontend/locales/english.lng @@ -31,6 +31,8 @@ title-console; Out-of-band console title-admin-userlist; User overview title-admin-userinfo; User lookup +header-admin-user-containers; Containers owned by this user + button-login; Login button-reinstall; Reinstall button-password; Set new root password diff --git a/frontend/module.admin.user.php b/frontend/module.admin.user.php index 76b4ae6..304b4a1 100644 --- a/frontend/module.admin.user.php +++ b/frontend/module.admin.user.php @@ -15,12 +15,37 @@ try { $sUserEntry = new User($router->uParameters[1]); + $sContainerList = array(); + + if($result = mysql_query_cached("SELECT * FROM containers WHERE `UserId` = '{$sUserEntry->sId}'")) + { + foreach($result->data as $row) + { + $sContainer = 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), + 'diskspace-unit' => "GB", + 'guaranteed-ram' => $sContainer->sGuaranteedRam, + 'guaranteed-ram-unit' => "MB", + 'status' => $sContainer->sStatusText, + 'virtualization-type' => $sContainer->sVirtualizationType + ); + } + } + $sPageContents = Templater::InlineRender("admin.user", $locale->strings, array( 'id' => $sUserEntry->sId, 'username' => $sUserEntry->sUsername, 'email' => $sUserEntry->sEmailAddress, 'accesslevel' => $sUserEntry->sAccessLevel, - 'containers' => $sUserEntry->sContainerCount + 'containercount' => $sUserEntry->sContainerCount, + 'containers' => $sContainerList )); } catch (NotFoundException $e) diff --git a/frontend/templates/admin.user.tpl b/frontend/templates/admin.user.tpl index 223babd..447536c 100644 --- a/frontend/templates/admin.user.tpl +++ b/frontend/templates/admin.user.tpl @@ -29,6 +29,58 @@
+ | <%!list-column-hostname> | +<%!list-column-platform> | +<%!list-column-disk> | +<%!list-column-ram> | +<%!list-column-template> | +
---|---|---|---|---|---|
+ <%if container[status] == running> + + <%/if><%if container[status] == stopped> + + <%/if><%if container[status] == suspended> + + <%/if> + | ++ + <%?container[hostname]> + + | ++ + <%if container[virtualization-type] == 1> + OpenVZ + <%/if><%if container[virtualization-type] == 2> + Xen PV + <%/if><%if container[virtualization-type] == 3> + Xen HVM + <%/if><%if container[virtualization-type] == 4> + KVM + <%/if> + + | ++ <%?container[diskspace]> + <%?container[diskspace-unit]> + | ++ <%?container[guaranteed-ram]> + <%?container[guaranteed-ram-unit]> + | +<%?container[template]> | +