()
| 652 | |
| 653 | @app.route('/plugins/status', methods=["POST", 'PUT']) |
| 654 | async def change_status() -> Response: |
| 655 | data = await request.get_json() |
| 656 | name = data.get('plugin_name', None) |
| 657 | status = data.get('status', None) |
| 658 | if name is None or status is None: |
| 659 | return error('the plugin_name and status field is required ...') |
| 660 | status = int(status) |
| 661 | if status == 0: |
| 662 | await self.stop_plugin(name) |
| 663 | elif status == 1: |
| 664 | await self.start_plugin(name) |
| 665 | else: |
| 666 | return error("unexpected plugin status, which should be one of<Stopped, Running>") |
| 667 | return success('changes success ...') |
| 668 | |
| 669 | @app.route('/plugins/setting', methods=['GET']) |
| 670 | async def get_plugin_setting() -> Response: |
nothing calls this directly
no test coverage detected