mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 09:32:21 +00:00
Rework the 'update' button for clearer use alongside other buttons
This commit is contained in:
parent
163f96177a
commit
343600c2aa
@ -257,7 +257,6 @@ def _assemble_html(responses, resource, querydict, url):
|
||||
yield '<hr>'
|
||||
yield 'Only fields that have their boxes checked will have their '
|
||||
yield 'respective values honored by the confluent server.<hr>'
|
||||
yield '<input type="hidden" name="restexplorerop" value="update">'
|
||||
yield '<input type="hidden" name="restexplorerhonorkey" value="">'
|
||||
yield '<a rel="self" href="%s">%s</a><br>' % (resource, resource)
|
||||
if url == '/':
|
||||
@ -279,7 +278,9 @@ def _assemble_html(responses, resource, querydict, url):
|
||||
yield rsp.html()
|
||||
yield "<br>"
|
||||
if not iscollection:
|
||||
yield '<input value="PUT" type="submit"></form></body></html>'
|
||||
yield '<input value="update" name="restexplorerop" type="submit"></form></body></html>'
|
||||
else:
|
||||
yield '<input type="hidden" name="restexplorerop" value="update">'
|
||||
|
||||
|
||||
def _assemble_json(responses, resource, url):
|
||||
|
@ -98,6 +98,7 @@ class LinkRelation(ConfluentMessage):
|
||||
|
||||
This is used by the API explorer aspect of httpapi"""
|
||||
return '<a href="%s" rel="%s">%s</a>' % (self.href, self.rel, self.href)
|
||||
#return '<a href="%s" rel="%s">%s</a><input type="submit" name="restexprerorop" value="delete:%s"' % (self.href, self.rel, self.href, self.href)
|
||||
|
||||
|
||||
|
||||
@ -187,7 +188,7 @@ class BootDevice(ConfluentChoiceMessage):
|
||||
|
||||
def __init__(self, node, device):
|
||||
if device not in self.valid_values:
|
||||
raise Exception("Invalid boot device argument passed in")
|
||||
raise Exception("Invalid boot device argument passed in: %s" % device)
|
||||
self.kvpairs = {
|
||||
node: {
|
||||
'bootdevice': { 'value': device },
|
||||
|
@ -251,6 +251,9 @@ class IpmiHandler(object):
|
||||
def handle_request(self):
|
||||
while not self.loggedin:
|
||||
wait_on_ipmi()
|
||||
bootdevices = {
|
||||
'optical': 'cd'
|
||||
}
|
||||
if self.element == [ 'power', 'state' ]:
|
||||
if 'read' == self.op:
|
||||
power = self.call_ipmicmd(self.ipmicmd.get_power)
|
||||
@ -266,12 +269,15 @@ class IpmiHandler(object):
|
||||
elif self.element == [ 'boot', 'device' ]:
|
||||
if 'read' == self.op:
|
||||
bootdev = self.call_ipmicmd(self.ipmicmd.get_bootdev)
|
||||
print repr(bootdev)
|
||||
if bootdev['bootdev'] in bootdevices:
|
||||
bootdev['bootdev'] = bootdevices[bootdev['bootdev']]
|
||||
return msg.BootDevice(node=self.node,
|
||||
device=bootdev['bootdev'])
|
||||
elif 'update' == self.op:
|
||||
bootdev = self.inputdata.bootdevice(self.node)
|
||||
bootdev = self.call_ipmicmd(self.ipmicmd.set_bootdev, bootdev)
|
||||
if bootdev['bootdev'] in bootdevices:
|
||||
bootdev['bootdev'] = bootdevices[bootdev['bootdev']]
|
||||
return msg.BootDevice(node=self.node,
|
||||
device=bootdev['bootdev'])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user