From 7e108fd187ca5d85aabec7175b011fcbbe9436c0 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 7 Oct 2010 18:00:02 -0700 Subject: [PATCH] new UI - add Service Offerings page. --- .../classes/resources/resource.properties | 7 + ui/new/index.jsp | 2 + ui/new/jsp/serviceoffering.jsp | 263 ++++++++++++++++++ ui/new/scripts/cloud.core2.init.js | 2 + ui/new/scripts/cloud.core2.serviceoffering.js | 34 +++ 5 files changed, 308 insertions(+) create mode 100644 ui/new/jsp/serviceoffering.jsp create mode 100644 ui/new/scripts/cloud.core2.serviceoffering.js diff --git a/client/WEB-INF/classes/resources/resource.properties b/client/WEB-INF/classes/resources/resource.properties index aa5f63a7dcd..89a034da27d 100644 --- a/client/WEB-INF/classes/resources/resource.properties +++ b/client/WEB-INF/classes/resources/resource.properties @@ -35,6 +35,7 @@ secondary.storage = Secondary Storage no.available.actions = No available actions +ID = ID name = Name display.text = Display Text os.type = OS Type @@ -52,6 +53,12 @@ URL = URL zone = Zone bootable = Bootable group = Group +storage.type = Storage Type +CPU = CPU +memory = Memory +offer.HA = Offer HA +network.type = Network Type +created = Created disk.offering = Disk Offering copy.ISO.to = Copy ISO to diff --git a/ui/new/index.jsp b/ui/new/index.jsp index bfcc6af96cf..c649e9b1c5e 100644 --- a/ui/new/index.jsp +++ b/ui/new/index.jsp @@ -69,6 +69,8 @@ long milliseconds = new Date().getTime(); + + Cloud.com CloudStack diff --git a/ui/new/jsp/serviceoffering.jsp b/ui/new/jsp/serviceoffering.jsp new file mode 100644 index 00000000000..6c9e924d09c --- /dev/null +++ b/ui/new/jsp/serviceoffering.jsp @@ -0,0 +1,263 @@ +<%@ page import="java.util.*" %> + +<%@ page import="com.cloud.utils.*" %> + +<% + Locale browserLocale = request.getLocale(); + CloudResourceBundle t = CloudResourceBundle.getBundle("resources/resource", browserLocale); +%> + +
+ +

+ Service Offering +

+
+
+ +
+
+ <%=t.t("details")%>
+
+
+
+ +
+
+
+
+
+

+ Waiting …

+
+
+
+
+
+
+ <%=t.t("ID")%>:
+
+
+
+
+
+
+
+
+
+ <%=t.t("name")%>:
+
+
+
+
+
+
+
+
+
+ <%=t.t("display.text")%>:
+
+
+
+
+
+
+
+
+
+ <%=t.t("storage.type")%>:
+
+
+
+
+
+
+
+
+
+ <%=t.t("CPU")%>:
+
+
+
+
+
+
+
+
+
+ <%=t.t("memory")%>:
+
+
+
+
+
+
+
+
+
+ <%=t.t("offer.HA")%>:
+
+
+
+
+
+
+
+
+
+ <%=t.t("network.type")%>:
+
+
+
+
+
+
+
+
+
+ <%=t.t("tags")%>:
+
+
+
+
+
+
+
+
+
+ <%=t.t("created")%>:
+
+
+
+
+
+
+
+
+ + +
+
+
+ + + + + + + + + + + + + + + + + + diff --git a/ui/new/scripts/cloud.core2.init.js b/ui/new/scripts/cloud.core2.init.js index 6c238b8df24..89e0526af61 100644 --- a/ui/new/scripts/cloud.core2.init.js +++ b/ui/new/scripts/cloud.core2.init.js @@ -85,6 +85,8 @@ $(document).ready(function() { listMidMenuItems("leftmenu_submenu_my_iso", "listIsos&isofilter=self", "listisosresponse", "iso", "jsp/iso.jsp", afterLoadIsoJSP, isoToMidmenu, isoToRigntPanel, isoGetMidmenuId); listMidMenuItems("leftmenu_submenu_featured_iso", "listIsos&isofilter=featured", "listisosresponse", "iso", "jsp/iso.jsp", afterLoadIsoJSP, isoToMidmenu, isoToRigntPanel, isoGetMidmenuId); listMidMenuItems("leftmenu_submenu_community_iso", "listIsos&isofilter=community", "listisosresponse", "iso", "jsp/iso.jsp", afterLoadIsoJSP, isoToMidmenu, isoToRigntPanel, isoGetMidmenuId); + + listMidMenuItems("leftmenu_service_offering", "listServiceOfferings", "listserviceofferingsresponse", "serviceoffering", "jsp/serviceoffering.jsp", afterLoadServiceOfferingJSP, serviceOfferingToMidmenu, serviceOfferingToRigntPanel); $("#leftmenu_instance_group_header").bind("click", function(event) { showMiddleMenu(); diff --git a/ui/new/scripts/cloud.core2.serviceoffering.js b/ui/new/scripts/cloud.core2.serviceoffering.js new file mode 100644 index 00000000000..cbddabc1c6d --- /dev/null +++ b/ui/new/scripts/cloud.core2.serviceoffering.js @@ -0,0 +1,34 @@ +function afterLoadServiceOfferingJSP() { + +} + +function serviceOfferingToMidmenu(jsonObj, $midmenuItem1) { + $midmenuItem1.attr("id", ("midmenuItem_"+jsonObj.id)); + $midmenuItem1.data("jsonObj", jsonObj); + + //var $iconContainer = $midmenuItem1.find("#icon_container").show(); + //$iconContainer.find("#icon").attr("src", "images/midmenuicon_storage_volume.png"); + + $midmenuItem1.find("#first_row").text(fromdb(jsonObj.name).substring(0,25)); + $midmenuItem1.find("#second_row").text(jsonObj.cpunumber + " x " + convertHz(jsonObj.cpuspeed)); +} + +function serviceOfferingToRigntPanel($midmenuItem) { + var jsonObj = $midmenuItem.data("jsonObj"); + serviceOfferingJsonToDetailsTab(jsonObj); +} + +function serviceOfferingJsonToDetailsTab(jsonObj) { + var $detailsTab = $("#right_panel_content #tab_content_details"); + $detailsTab.data("jsonObj", jsonObj); + $detailsTab.find("#id").text(jsonObj.id); + $detailsTab.find("#name").text(fromdb(jsonObj.name)); + $detailsTab.find("#displaytext").text(fromdb(jsonObj.displaytext)); + $detailsTab.find("#storagetype").text(jsonObj.storagetype); + $detailsTab.find("#cpu").text(jsonObj.cpunumber + " x " + convertHz(jsonObj.cpuspeed)); + $detailsTab.find("#memory").text(convertBytes(parseInt(jsonObj.memory)*1024*1024)); + $detailsTab.find("#offerha").text(toBooleanText(jsonObj.offerha)); + $detailsTab.find("#networktype").text(toNetworkType(jsonObj.usevirtualnetwork)); + $detailsTab.find("#tags").text(fromdb(jsonObj.tags)); + setDateField(jsonObj.created, $detailsTab.find("#created")); +} \ No newline at end of file