Skip to contentSkip to conversation

conga/luci cluster/form-chooser cluster/form-m ...

Cluster-devel [email protected] 1 participant 1 message Dec 6, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-12-06 18:38:55

Modified files:
luci/cluster : form-chooser form-macros
luci/site/luci/Extensions: cluster_adapters.py
conga_constants.py

Log message:
The service delete option was doing nothing. Make it work, but only when the service is not running.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-chooser.diff?cvsroot=cluster&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.121&r2=1.122
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.172&r2=1.173
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&r1=1.27&r2=1.28

luci/cluster/form-chooser +3 -0
@@ -80,6 +80,9 @@
     <span tal:omit-tag="" tal:condition="python: ptype == '25'">
      <div metal:use-macro="here/form-macros/macros/serviceprocess-form"/>
     </span>
+	<tal:block tal:condition="python: ptype == '56'">
+		<div metal:use-macro="here/form-macros/macros/servicedelete-form" />
+	</tal:block>
     <span tal:omit-tag="" tal:condition="python: ptype == '26'">
      <div metal:use-macro="here/form-macros/macros/servicestart"/>
     </span>
luci/cluster/form-macros +32 -4
@@ -2775,9 +2775,31 @@
 					<form method="post" onSubmit="return dropdown(this.gourl)">
 						<select name="gourl">
 							<option value="">Choose a Task...</option>
-							<option value="" tal:attributes="value svc/cfgurl">Configure</option>
+							<option
+								tal:attributes="value svc/cfgurl | nothing"
+								tal:content="string:Configure this service" />
+
 							<option value="">----------</option>
-							<option value="">Delete</option>
+
+							<option
+								tal:condition="running"
+								tal:attributes="value svc/retstarturl| nothing"
+								tal:content="string:Restart this service" />
+
+							<option
+								tal:condition="running"
+								tal:attributes="value svc/disableurl | nothing"
+								tal:content="string:Stop this service" />
+
+							<option
+								tal:condition="not: running"
+								tal:attributes="value svc/enableurl | nothing"
+								tal:content="string:Start this service" />
+
+							<option
+								tal:condition="not: running"
+								tal:attributes="value svc/delurl | nothing"
+								tal:content="string:Delete this service" />
 						</select>
 						<input type="submit" value="Go"/>
 					</form>
@@ -3047,14 +3069,15 @@
 							<option value="" tal:attributes="value innermap/disableurl">Disable this service</option>
 							<option value="">----------</option>
 							<option tal:repeat="starturl innermap/links" value="" tal:attributes="value starturl/url">Start this service on <span tal:replace="starturl/nodename"/></option>
-							<option value="">----------</option>
-							<option value="">Delete this service</option>
 						</tal:block>
 
 						<tal:block tal:condition="not: running">
 							<option value="">----------</option>
 							<option value="" tal:attributes="value innermap/enableurl">Enable this service</option>
 							<option value="">----------</option>
+							<option
+								tal:attributes="value innermap/delurl | nothing"
+								tal:content="string:Delete this service" />
 						</tal:block>
 					</select>
 					<input type="submit" value="Go"/>
@@ -3152,6 +3175,11 @@
 	<h2>Service Process Form</h2>
 </div>
 
+<div metal:define-macro="servicedelete-form">
+	<h2>Service Delete Form</h2>
+	<tal:block tal:define="dummy python: here.delService(request)" />
+</div>
+
 <div metal:define-macro="resources-form">
 	<h2>Resources Form</h2>
 </div>
luci/site/luci/Extensions/cluster_adapters.py +83 -6

133 lines not on this page · raw message

luci/site/luci/Extensions/conga_constants.py +1 -0
@@ -43,6 +43,7 @@
 FENCEDEV_CONFIG="53"
 FENCEDEV="54"
 CLUSTER_DAEMON="55"
+SERVICE_DELETE = '56'
 
 #Cluster tasks
 CLUSTER_STOP = '1000'