def admin_on_command_texte(self, req: HTTPRequest, res: HTTPResponse): if not self.is_authorized(req, res): return data = req.body_json() cmd = Command.from_text(data["cmd"]) self._on_command(cmd, req, res)
def admin_on_server_command(self, req: HTTPRequest, res: HTTPResponse): if not self.is_authorized(req, res): return data = req.body_json() cmd = Command.from_text(data["cmd"]) out = cmd.start(self).json() res.ok(errors.OK, "OK", out)