From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 26 Jan 2007 17:56:15 -0000 Subject: [Cluster-devel] conga/luci cluster/form-macros cluster/resourc ... Message-ID: <20070126175615.30156.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 2007-01-26 17:56:15 Modified files: luci/cluster : form-macros resource-form-macros resource_form_handlers.js luci/site/luci/Extensions: cluster_adapters.py Log message: fix for adding global resources to services and other cleanup/polish Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.162&r2=1.163 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.29&r2=1.30 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.28&r2=1.29 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.211&r2=1.212 --- conga/luci/cluster/form-macros 2007/01/26 16:53:53 1.162 +++ conga/luci/cluster/form-macros 2007/01/26 17:56:14 1.163 @@ -223,14 +223,14 @@ - + + @@ -2700,62 +2700,62 @@
- + - + - + - + - + - + - + - + - + - + - + - + @@ -3738,8 +3738,10 @@ + + @@ -3790,45 +3792,55 @@
- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + +
@@ -3930,7 +3942,7 @@ tal:replace="structure python: '
'" /> @@ -3979,9 +3991,11 @@ + +
@@ -4238,12 +4252,12 @@
-
- Cluster Name -
+
+ Cluster Name + -
-
Node Hostname Root Password
- + - +
Name Type Configure
@@ -4334,7 +4348,7 @@ - + @@ -4376,7 +4390,7 @@ tal:attributes="value request/clustername" /> -
@@ -4408,22 +4422,28 @@

Edit cluster.conf

- - - - - - + tal:attributes="action python: './?' + request['QUERY_STRING']" + tal:define="ret python: here.process_cluster_conf_editor(request)"> + + + + + + + + + + + +
--- conga/luci/cluster/resource-form-macros 2007/01/22 17:05:59 1.29 +++ conga/luci/cluster/resource-form-macros 2007/01/26 17:56:14 1.30 @@ -281,66 +281,17 @@ +

Configure

+
-
- -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- -
+
--- conga/luci/cluster/resource_form_handlers.js 2007/01/22 17:06:00 1.28 +++ conga/luci/cluster/resource_form_handlers.js 2007/01/26 17:56:14 1.29 @@ -279,7 +279,10 @@ var errors = check_form(form); if (error_dialog(errors)) return (-1); - form.submit(); + + var confirm_str = form.edit ? 'Update this resource?' : 'Add this resource?'; + if (confirm(confirm_str)) + form.submit(); } function delete_resource(form) { --- conga/luci/site/luci/Extensions/cluster_adapters.py 2007/01/24 19:45:44 1.211 +++ conga/luci/site/luci/Extensions/cluster_adapters.py 2007/01/26 17:56:14 1.212 @@ -5050,6 +5050,7 @@ itemmap['name'] = item.getName() itemmap['attrs'] = item.attr_hash itemmap['type'] = item.resource_type + itemmap['tag_name'] = item.TAG_NAME itemmap['cfgurl'] = baseurl + "?" + "clustername=" + cluname + "&resourcename=" + item.getName() + "&pagetype=" + RESOURCE_CONFIG itemmap['url'] = baseurl + "?" + "clustername=" + cluname + "&resourcename=" + item.getName() + "&pagetype=" + RESOURCE itemmap['delurl'] = baseurl + "?" + "clustername=" + cluname + "&resourcename=" + item.getName() + "&pagetype=" + RESOURCE_REMOVE @@ -5264,7 +5265,7 @@ return errstr try: - set_node_flag(self, clustername, ragent, str(batch_number), RESOURCE_REMOVE, "Removing Resource \'%s\'" % request['resourcename']) + set_node_flag(self, clustername, ragent, str(batch_number), RESOURCE_REMOVE, "Removing resource \'%s\'" % request['resourcename']) except Exception, e: luci_log.debug_verbose('delResource7: failed to set flags: %s' % str(e)) @@ -6593,7 +6594,17 @@ res_name = res.attr_hash['address'] try: - set_node_flag(self, clustername, ragent, str(batch_number), RESOURCE_ADD, "Creating New Resource \'%s\'" % res_name) + try: + if request.form.has_key('edit'): + action_type = RESOURCE_CONFIG + action_str = 'Configuring resource \"%s\"' % res_name + else: + raise Exception, 'new' + except Exception, e: + action_type = RESOURCE_ADD + action_str = 'Creating new resource \"%s\"' % res_name + + set_node_flag(self, clustername, ragent, str(batch_number), action_type, action_str) except Exception, e: luci_log.debug_verbose('addResource7: failed to set flags: %s' % str(e))