mirror of https://git.48k.eu/ogcp
Add reboot action
This action handles reboot on one or multiple scopes.multi-ogserver
parent
ef609cf52a
commit
73a6e07b83
|
@ -33,6 +33,8 @@
|
|||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<input class="dropdown-item" type="submit" value="{{ _('Poweroff') }}"
|
||||
formaction="{{ url_for('action_poweroff') }}">
|
||||
<input class="dropdown-item" type="submit" value="{{ _('Reboot') }}"
|
||||
formaction="{{ url_for('action_reboot') }}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -48,3 +48,10 @@ def action_poweroff():
|
|||
payload = {'clients': list(ips)}
|
||||
g.server.post('/poweroff', payload)
|
||||
return make_response("200 OK", 200)
|
||||
|
||||
@app.route('/action/reboot', methods=['POST'])
|
||||
def action_reboot():
|
||||
ips = parse_ips(request.form.to_dict())
|
||||
payload = {'clients': list(ips)}
|
||||
g.server.post('/reboot', payload)
|
||||
return make_response("200 OK", 200)
|
||||
|
|
Loading…
Reference in New Issue