diff --git a/app/plugins/customhosts/__init__.py b/app/plugins/customhosts/__init__.py index 7233b231..c5c44421 100644 --- a/app/plugins/customhosts/__init__.py +++ b/app/plugins/customhosts/__init__.py @@ -54,7 +54,7 @@ class CustomHosts(_PluginBase): # 更新错误Hosts self.update_config({ - "hosts": self._hosts, + "hosts": ''.join(self._hosts), "err_hosts": error_hosts, "enabled": self._enabled }) @@ -74,82 +74,82 @@ class CustomHosts(_PluginBase): 拼装插件配置页面,需要返回两块数据:1、页面配置;2、数据结构 """ return [ - { - 'component': 'VForm', - 'content': [ - { - 'component': 'VRow', - 'content': [ - { - 'component': 'VCol', - 'props': { - 'cols': 12, - 'md': 6 - }, - 'content': [ - { - 'component': 'VSwitch', - 'props': { - 'model': 'enabled', - 'label': '启用插件', - } - } - ] - } - ] - }, - { - 'component': 'VRow', - 'content': [ - { - 'component': 'VCol', - 'props': { - 'cols': 12 - }, - 'content': [ - { - 'component': 'VTextarea', - 'props': { - 'model': 'hosts', - 'label': '自定义hosts', - 'rows': 10, - 'placeholder': '每行一个配置,格式为:ip host1 host2 ...' - } - } - ] - } - ] - }, - { - 'component': 'VRow', - 'content': [ - { - 'component': 'VCol', - 'props': { - 'cols': 12 - }, - 'content': [ - { - 'component': 'VTextarea', - 'props': { - 'model': 'err_hosts', - 'readonly': True, - 'label': '错误hosts', - 'rows': 2, - 'placeholder': '错误的hosts配置会展示在此处,请修改上方hosts重新提交(错误的hosts不会写入系统hosts文件)' - } - } - ] - } - ] - } - ] - } - ], { - "enabled": False, - "hosts": "", - "err_hosts": "" - } + { + 'component': 'VForm', + 'content': [ + { + 'component': 'VRow', + 'content': [ + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 6 + }, + 'content': [ + { + 'component': 'VSwitch', + 'props': { + 'model': 'enabled', + 'label': '启用插件', + } + } + ] + } + ] + }, + { + 'component': 'VRow', + 'content': [ + { + 'component': 'VCol', + 'props': { + 'cols': 12 + }, + 'content': [ + { + 'component': 'VTextarea', + 'props': { + 'model': 'hosts', + 'label': '自定义hosts', + 'rows': 10, + 'placeholder': '每行一个配置,格式为:ip host1 host2 ...' + } + } + ] + } + ] + }, + { + 'component': 'VRow', + 'content': [ + { + 'component': 'VCol', + 'props': { + 'cols': 12 + }, + 'content': [ + { + 'component': 'VTextarea', + 'props': { + 'model': 'err_hosts', + 'readonly': True, + 'label': '错误hosts', + 'rows': 2, + 'placeholder': '错误的hosts配置会展示在此处,请修改上方hosts重新提交(错误的hosts不会写入系统hosts文件)' + } + } + ] + } + ] + } + ] + } + ], { + "enabled": False, + "hosts": "", + "err_hosts": "" + } def get_page(self) -> List[dict]: pass