diff --git a/ui/new/jsp/dashboard.jsp b/ui/new/jsp/dashboard.jsp
index 3027a31d6d6..8d5fdf2bc0a 100644
--- a/ui/new/jsp/dashboard.jsp
+++ b/ui/new/jsp/dashboard.jsp
@@ -1,430 +1,460 @@
-<%@ page import="java.util.*" %>
-
-<%@ page import="com.cloud.utils.*" %>
-
-<%
- Locale browserLocale = request.getLocale();
- CloudResourceBundle t = CloudResourceBundle.getBundle("resources/resource", browserLocale);
-%>
-
-
-
-

-
- Dashboard
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Public IP Addresses
-
-
-
-
-
-
-
-
-
-
- Private IP Addresses
-
-
-
-
-
-
-
-
-
-
-
-
- Primary Storage Allocated
-
-
-
-
-
-
-
-
-
-
- Primary Storage Used
-
-
-
-
-
-
-
-
-
-
- Secondary Storage Used
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Available Public IPs:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Error's Name
-
Error Description will appear here
-
-
-
-
-
-
-
-
Error's Name
-
Error Description will appear here
-
-
-
-
-
-
-
-
Error's Name
-
Error Description will appear here
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+<%@ page import="java.util.*" %>
+
+<%@ page import="com.cloud.utils.*" %>
+
+<%
+ Locale browserLocale = request.getLocale();
+ CloudResourceBundle t = CloudResourceBundle.getBundle("resources/resource", browserLocale);
+%>
+
+
+

+
+ Dashboard
+
+
+
+
+
+
+
+
+
+
+
+
+ Public IP Addresses
+
+
+
+
+
+
+
+
+
+
+ Private IP Addresses
+
+
+
+
+
+
+
+
+
+
+
+
+ Primary Storage Allocated
+
+
+
+
+
+
+
+
+
+
+ Primary Storage Used
+
+
+
+
+
+
+
+
+
+
+ Secondary Storage Used
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Available Public IPs:
+
+
+
+
+
+
+
+ Owned Public IPs:
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+ Error's Name
+
+ Error Description will appear here
+
+
+
+ 09/29/2010 15:20:10
+
+
+
+
+
+

+
+
+
+ Error's Name
+
+ Error Description will appear here
+
+
+
+ 09/29/2010 15:20:10
+
+
+
+
+
+

+
+
+
+ Error's Name
+
+ Error Description will appear here
+
+
+
+ 09/29/2010 15:20:10
+
+
+
+
+
+
+
diff --git a/ui/new/scripts/cloud.core2.dashboard.js b/ui/new/scripts/cloud.core2.dashboard.js
index 78d00e576d4..aa9c28b777b 100644
--- a/ui/new/scripts/cloud.core2.dashboard.js
+++ b/ui/new/scripts/cloud.core2.dashboard.js
@@ -1,5 +1,7 @@
function afterLoadDashboardJSP() {
if (isAdmin()) {
+ showDashboard("dashboard_admin");
+
var sessionExpired = false;
var zones = null;
var noZones = false;
@@ -204,17 +206,28 @@ function afterLoadDashboardJSP() {
}
else if (isDomainAdmin()) {
-
+ showDashboard("dashboard_domainadmin");
}
else if(isUser()) {
-
+ showDashboard("dashboard_user");
}
else { //no role
- logout(false);
- return;
+ logout(false);
}
}
+function showDashboard(dashboardToShow) {
+ var allDashboards = ["dashboard_admin", "dashboard_domainadmin", "dashboard_user"];
+ for(var i=0; i < allDashboards.length; i++) {
+ dashboard = allDashboards[i];
+ if(dashboard == dashboardToShow)
+ $("#"+dashboard).show();
+ else
+ $("#"+dashboard).hide();
+ }
+}
+
+//*** dashboard admin (begin) ***
function capacityBarChart($capacity, percentused) {
var percentused2 = (percentused + "%");
$capacity.find("#percentused").text(percentused2);
@@ -225,4 +238,6 @@ function capacityBarChart($capacity, percentused) {
$capacity.find("#bar_chart").removeClass().addClass("db_barbox mid").css("width", percentused2);
else if (percentused > 80 )
$capacity.find("#bar_chart").removeClass().addClass("db_barbox high").css("width", percentused2);
-}
\ No newline at end of file
+}
+//*** dashboard admin (end) ***
+
diff --git a/ui/new/scripts/cloud.core2.js b/ui/new/scripts/cloud.core2.js
index f1461f9c185..028b8f5e786 100644
--- a/ui/new/scripts/cloud.core2.js
+++ b/ui/new/scripts/cloud.core2.js
@@ -836,14 +836,14 @@ function isAdmin() {
return (g_role == 1);
}
-function isUser() {
- return (g_role == 0);
-}
-
function isDomainAdmin() {
return (g_role == 2);
}
+function isUser() {
+ return (g_role == 0);
+}
+
function setDateField(dateValue, dateField, htmlMarkup) {
if (dateValue != null && dateValue.length > 0) {
var disconnected = new Date();