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
-

- Dashboard -

-
- -
- - - - -
-
-
-
- System Wide Capacity
-
-
-
- - -
-
-
-
-
-
-

- Public IP Addresses

-
-

- Used: N/A -

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- Private IP Addresses

-
-

- Used: N/A -

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- Memory Allocated

-
-

- Used: N/A -

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- CPU

-
-

- Used: N/A -

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- Primary Storage Allocated

-
-

- Used: N/A -

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- Primary Storage Used

-
-

- Used: N/A -

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- Secondary Storage Used

-
-

- Used: N/A -

-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- General Alerts
-
-
-
-
-
-
-
-
-
-
- No Recent Alerts -
-
-
- -
-
-
-
- Hosts Alerts
-
-
-
-
-
-
-
-
-
-
- No Recent Alerts -
-
-
-
- - - - - - - - - - - - - - -
-
-
-
- Public IPs
-
-
-
-
-
Available Public IPs:
-
-
-
Unlimited
-
-
-
-
-
Owned Public IPs:
-
-
-
5
-
-
- -
- - -
-
-
-
- Recent Errors
-
-
- -
-
-
-
-
-
-
-
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
-
-
-
- - - -
-
-
-
- Account
-
-
-
- My Account
-
- -
- -
-
-
Account ID
-
-
-
3
-
-
- -
-
-
Account
-
-
-
Niki
-
-
- -
-
-
Type
-
-
-
User
-
-
- -
-
-
Domain
-
-
-
Root
-
-
- - - -
- - \ 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
+

+ Dashboard +

+
+ + + + + + + + + + + + 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();