From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 8 Sep 2006 22:54:33 -0000 Subject: [Cluster-devel] conga/luci cluster/form-macros cluster/index_h ... Message-ID: <20060908225433.28542.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Changes by: rmccabe at sourceware.org 2006-09-08 22:54:32 Modified files: luci/cluster : form-macros index_html resource-form-macros resource_form_handlers.js luci/homebase : homebase_common.js luci_homebase.css luci/site/luci/Extensions: cluster_adapters.py Log message: resource and service stuff Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.56&r2=1.57 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/index_html.diff?cvsroot=cluster&r1=1.11&r2=1.12 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/homebase_common.js.diff?cvsroot=cluster&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/luci_homebase.css.diff?cvsroot=cluster&r1=1.19&r2=1.20 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.62&r2=1.63 --- conga/luci/cluster/form-macros 2006/09/06 22:13:33 1.56 +++ conga/luci/cluster/form-macros 2006/09/08 22:54:32 1.57 @@ -1139,13 +1139,14 @@

Service Composition

+
+ tal:replace="structure python: '
'" /> - + [-] Hide Children @@ -1197,6 +1198,7 @@
+
--- conga/luci/cluster/index_html 2006/08/28 23:04:59 1.11 +++ conga/luci/cluster/index_html 2006/09/08 22:54:32 1.12 @@ -29,6 +29,7 @@ +
--- conga/luci/cluster/resource-form-macros 2006/09/06 22:13:33 1.7 +++ conga/luci/cluster/resource-form-macros 2006/09/08 22:54:32 1.8 @@ -70,22 +70,25 @@ src="/luci/cluster/resource_form_handlers.js"> + +

Add a Resource

- Select Resource Type + Select a Resource Type
@@ -150,19 +153,19 @@
- + + global type python: res['tag_name']"> -

Configure

+

Configure

@@ -198,17 +201,12 @@
-
- +
- IP Address Resource Configuration +
IP Address Resource Configuration
- - + + + + IP address - IP - - - . - . - . - + - - Monitor Link - + Monitor link - - - + + + + + +
-
+
@@ -305,17 +304,20 @@ tmp_URL context/cluster/index_html/absolute_url; global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" /> - File System Resource Configuration +
File System Resource Configuration
- - + + + + tal:attributes="value res/name | nothing" /> @@ -324,9 +326,7 @@ - + - + - + - + - + - + - + - + +
- Resource Name - Name
- File System Type - File system type
- Mount Point - Mount point + tal:attributes="value mountPoint | nothing" />
- Device - Device + tal:attributes="value device | nothing" />
- Options - Options @@ -381,9 +373,7 @@
- File System ID - File system ID @@ -391,9 +381,7 @@
- Force unmount - Force unmount @@ -401,9 +389,7 @@
- Reboot host node if unmount fails - Reboot host node if unmount fails - - Check file system before mounting - Check file system before mounting - - - + + + + + + -
+
@@ -458,17 +446,20 @@ tmp_URL context/cluster/index_html/absolute_url; global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" /> - GFS Resource Configuration -
+
GFS Resource Configuration
+ + + + tal:attributes="value cluname | nothing" /> + tal:attributes="value res/name | nothing" /> @@ -477,9 +468,7 @@ - + - - + - + - + - + - +
- Resource Name - Name
- Mount Point - Mount point @@ -499,9 +485,7 @@
- Device - Device @@ -509,9 +493,7 @@
- Options - Options @@ -519,9 +501,7 @@
- File System ID - File system ID @@ -529,9 +509,7 @@
- Force unmount - Force unmount - - - + + + + + + -
+
@@ -574,17 +556,21 @@ global cluname request/clustername; tmp_URL context/cluster/index_html/absolute_url; global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" /> -
- NFS Mount Resource Configuration +
NFS Mount Resource Configuration
+ - + + + + tal:attributes="value res/name | nothing" /> @@ -593,9 +579,7 @@ - + - + - + - + - + - + - +
- Resource Name - Name
- Mount Point - Mount point @@ -614,9 +596,7 @@
- Host - Host @@ -624,19 +604,15 @@
- Export Path - Export path + tal:attributes="value expath | nothing" />
- NFS Type - NFS version @@ -649,19 +625,15 @@
- Options - Options + tal:attributes="value opt | nothing" />
- Force unmount - Force unmount - - - + + + + + + -
+
- NFS Client Resource Configuration +
NFS Client Resource Configuration
- - + + + + tal:attributes="value res/name | nothing" /> @@ -720,9 +699,7 @@ - + - + - +
- Resource Name - Name
- Target - Target @@ -741,9 +716,7 @@
- Options - Options @@ -752,22 +725,26 @@
- - - + + + + + +
-
+
@@ -778,16 +755,20 @@ tmp_URL context/cluster/index_html/absolute_url; global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" /> - NFS Export Resource Configuration -
+
NFS Export Resource Configuration
+ - + + + + tal:attributes="value res/name | nothing" /> @@ -796,9 +777,7 @@ - +
- Name - Name
- - - + + + + + +
-
+
@@ -835,16 +818,20 @@ tmp_URL context/cluster/index_html/absolute_url; global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" /> - Script Resource Configuration -
+
Script Resource Configuration
+ - + + + + tal:attributes="value res/name | nothing" /> @@ -853,9 +840,7 @@ - + - +
- Name - Name
- Full path to script file - Full path to script file @@ -875,45 +858,55 @@
- - - + + + + + +
-
+
- Samba Server Configuration +
+ Samba Server Configuration +
- - + + + + tal:attributes="value res/name | nothing" /> @@ -922,9 +915,7 @@ - + - +
- Name - Name
- Workgroup - Workgroup @@ -944,12 +933,16 @@
- - - + + + + + +
--- conga/luci/cluster/resource_form_handlers.js 2006/09/06 22:13:33 1.4 +++ conga/luci/cluster/resource_form_handlers.js 2006/09/08 22:54:32 1.5 @@ -18,11 +18,14 @@ function validate_ip(form) { var errors = new Array(); - var ipstr = form.ip1.value + '.' + form.ip2.value + '.' + - form.ip3.value + '.' + form.ip4.value; + if (!form.ip_address || str_is_blank(form.ip_address.value)) + errors.push('You did not give an IP address.'); + return (errors); + + var ipstr = form.ip_address.value; if (!isValidHost(ipstr)) - errors.push('\"' + ipstr '\" is an invalid IP address.'); + errors.push('\"' + ipstr + '\" is an invalid IP address.'); return (errors); } @@ -71,7 +74,7 @@ } function validate_gfs(form) { - my errors = new Array(); + var errors = new Array(); if (!form.mountpoint || str_is_blank(form.mountpoint.value)) errors.push('No file system mount point was given.'); @@ -110,20 +113,33 @@ form_validators['scr'] = validate_script; form_validators['smb'] = validate_samba; -function validate(form) { +function validate_form(form) { var valfn = form_validators[form.type.value]; if (!valfn) return (-1); - if (error_dialog(valfn(form))) + var errors = valfn(form); + if (form.type.value != 'ip') { + if (!form.resourceName || str_is_blank(form.resourceName.value)) + errors.push('No resource name was given.') + } + + if (error_dialog(errors)) return (-1); form.submit(); } function delete_resource(form) { - return (-1); + if (!confirm('Are you sure you want to delete this resource?')) + return (-1); + form.submit(); } function add_child_resource(form) { - return (-1); + if (!form || !form.tree_level || + !is_valid_int(form.tree_level.value, 0, null)) + { + return (-1); + } + var level = Number(form.tree_level.value); } --- conga/luci/homebase/homebase_common.js 2006/09/05 21:25:45 1.7 +++ conga/luci/homebase/homebase_common.js 2006/09/08 22:54:32 1.8 @@ -8,14 +8,22 @@ else span = null; - div = image.parentNode.parentNode.parentNode.getElementsByTagName('div'); - if (!div || div.length < 1) + var div = null; + divc = image.parentNode.parentNode.parentNode.getElementsByTagName('div'); + for (var i = 0 ; i < divc.length ; i++) { + if (divc[i].className.match(/service_comp/)) { + div = divc[i]; + break; + } + } + + if (!div) return (-1); - div = div[3]; if (image.name == 'arrow_down') { image.src = 'arrow_right.png'; image.name = 'arrow_right'; + image.alt = '[-]'; if (span) span.innerHTML = 'Show Children'; div.style.visibility = 'hidden'; @@ -23,6 +31,7 @@ } else { image.src = 'arrow_down.png'; image.name = 'arrow_down'; + image.alt = '[+]'; if (span) span.innerHTML = 'Hide Children'; div.style.visibility = 'inherit'; --- conga/luci/homebase/luci_homebase.css 2006/09/06 22:14:42 1.19 +++ conga/luci/homebase/luci_homebase.css 2006/09/08 22:54:32 1.20 @@ -259,14 +259,23 @@ strong.cluster { text-align: top; font-size: 9pt; - letter-spacing: 120%; + letter-spacing: +1px; } +*.reshdr { + text-align: top; + font-size: 9pt; + letter-spacing: +1px; + font-weight: 600; + padding-bottom: +1em; +} + + strong.service_name, strong.node_name, strong.cluster_name { font-size: 10pt; - letter-spacing: 120%; + letter-spacing: +1px; } td.service_name, @@ -363,38 +372,36 @@ } div.systemsList { - margin-top: .25em !important; - margin-bottom: .25em !important; + margin-top: .25em ! important; + margin-bottom: .25em ! important; } -div.service_comp { +#service_comp_list { background: #dee7ec; - padding: .66em; - margin-top: .5em; -} - -div.rc_indent0 { - margin-left: 0px; max-width: 700px; + padding: 1em; } -div.rc_indent1 { - margin-left: 30px -} - -div.rc_indent2 { - margin-left: 60px +div.rescfg { + background: #dee7ec; } -div.rc_indent3 { - margin-left: 90px +div.service_comp { + background: #dee7ec; + padding: .66em; + margin-top: .5em; + border-left: thin solid #c9c9c9; + border-bottom: thin solid #c9c9c9; + margin-bottom: 1em; } -div.rc_indent4 { - margin-left: 120px +div.service_comp > div.service_comp { + margin-left: +20px; + margin-bottom: 0px; + border-bottom: none; } - -div.rc_indent5 { - margin-left: 150px +/* +div.rc_indent0 { + border-left: none ! important; } - +*/ --- conga/luci/site/luci/Extensions/cluster_adapters.py 2006/08/30 22:59:01 1.62 +++ conga/luci/site/luci/Extensions/cluster_adapters.py 2006/09/08 22:54:32 1.63 @@ -150,7 +150,7 @@ cluster_properties['isComplete'] = False errors.append(error) return (False, {'errors': errors, 'requestResults':cluster_properties }) - batch_id_map = {} + batch_id_map = {} for i in nodeList: try: rc = RicciCommunicator(i['ricci_host']) @@ -1786,21 +1786,23 @@ return resList def getResourceInfo(modelb, request): - resMap = {} - name = request['resourcename'] - baseurl = request['URL'] - cluname = request['clustername'] - for res in modelb.getResources(): - if res.getName() == name: - resMap['name'] = res.getName() - resMap['type'] = res.resource_type - resMap['tag_name'] = res.TAG_NAME - resMap['attrs'] = res.attr_hash - resMap['cfgurl'] = baseurl + "?" + "clustername=" + cluname + "&resourcename=" + res.getName() + "&pagetype=" + RESOURCE_CONFIG - return resMap - - return {} + resMap = {} + try: + name = request['resourcename'] + baseurl = request['URL'] + cluname = request['clustername'] + + for res in modelb.getResources(): + if res.getName() == name: + resMap['name'] = res.getName() + resMap['type'] = res.resource_type + resMap['tag_name'] = res.TAG_NAME + resMap['attrs'] = res.attr_hash + resMap['cfgurl'] = baseurl + "?" + "clustername=" + cluname + "&resourcename=" + res.getName() + "&pagetype=" + RESOURCE_CONFIG + return resMap + except: pass + return {} def delResource(self, request, ragent): modelb = request.SESSION.get('model') @@ -1906,13 +1908,13 @@ else: res = apply(Ip) form = request.form - addr = form["ip1"]+"."+form["ip2"]+"."+form["ip3"]+"."+form["ip4"] + addr = form['ip_address'] res.attr_hash["address"] = addr if form.has_key('monitorLink'): res.attr_hash["monitor_link"] = '1' else: res.attr_hash["monitor_link"] = '0' - modelb.getResourcesPtr().addChild(res); + modelb.getResourcesPtr().addChild(res) return res def addFs(request): @@ -1943,7 +1945,7 @@ else: res.attr_hash["force_fsck"] = '0' - modelb.getResourcesPtr().addChild(res); + modelb.getResourcesPtr().addChild(res) return res def addGfs(request): @@ -1964,7 +1966,7 @@ else: res.attr_hash["force_unmount"] = '0' - modelb.getResourcesPtr().addChild(res); + modelb.getResourcesPtr().addChild(res) return res def addNfsm(request): @@ -1986,7 +1988,7 @@ else: res.attr_hash["force_unmount"] = '0' - modelb.getResourcesPtr().addChild(res); + modelb.getResourcesPtr().addChild(res) return res def addNfsc(request): @@ -2000,7 +2002,7 @@ res.attr_hash["target"] = form["target"] res.attr_hash["options"] = form["options"] - modelb.getResourcesPtr().addChild(res); + modelb.getResourcesPtr().addChild(res) return res def addNfsx(request): @@ -2012,7 +2014,7 @@ form = request.form res.attr_hash["name"] = form["resourceName"] - modelb.getResourcesPtr().addChild(res); + modelb.getResourcesPtr().addChild(res) return res def addScr(request): @@ -2025,7 +2027,7 @@ res.attr_hash["name"] = form["resourceName"] res.attr_hash["file"] = form["file"] - modelb.getResourcesPtr().addChild(res); + modelb.getResourcesPtr().addChild(res) return res def addSmb(request): @@ -2038,7 +2040,7 @@ res.attr_hash["name"] = form["resourceName"] res.attr_hash["workgroup"] = form["workgroup"] - modelb.getResourcesPtr().addChild(res); + modelb.getResourcesPtr().addChild(res) return res def appendModel(request, model):