fix plugin form

This commit is contained in:
jxxghp
2023-07-24 11:35:30 +08:00
parent d95808edef
commit 1bf48e7c57
2 changed files with 77 additions and 20 deletions

View File

@ -122,6 +122,9 @@ class SiteStatistic(_PluginBase):
"""
拼装插件配置页面需要返回两块数据1、页面配置2、数据结构
"""
# 站点的可选项
site_options = [{"title": site.get("name"), "value": site.get("id")}
for site in self.sites.get_indexers()]
return [
{
'component': 'VForm',
@ -131,6 +134,10 @@ class SiteStatistic(_PluginBase):
'content': [
{
'component': 'VCol',
'props': {
'cols': 12,
'md': 6
},
'content': [
{
'component': 'VSwitch',
@ -138,7 +145,16 @@ class SiteStatistic(_PluginBase):
'model': 'enabled',
'label': '启用插件',
}
},
}
]
},
{
'component': 'VCol',
'props': {
'cols': 12,
'md': 6
},
'content': [
{
'component': 'VSwitch',
'props': {
@ -155,22 +171,31 @@ class SiteStatistic(_PluginBase):
'content': [
{
'component': 'VCol',
'props': {
'cols': 12,
'md': 6
},
'content': [
{
'component': 'VTextField',
'props': {
'cols': 12,
'md': 6,
'model': 'cron',
'label': '执行周期',
'placeholder': '0 9,18 * * *'
}
},
}
]
},
{
'component': 'VCol',
'props': {
'cols': 12,
'md': 6
},
'content': [
{
'component': 'VTextField',
'props': {
'cols': 12,
'md': 6,
'model': 'queue_cnt',
'label': '队列数量'
}
@ -192,7 +217,7 @@ class SiteStatistic(_PluginBase):
'multiple': True,
'model': 'statistic_sites',
'label': '统计站点',
'items': []
'items': site_options
}
}
]