add PersonMeta

This commit is contained in:
jxxghp 2023-09-28 17:11:55 +08:00
parent 760e3d6de0
commit 3999c64853

View File

@ -0,0 +1,87 @@
from typing import Any, List, Dict, Tuple
from app.plugins import _PluginBase
class PersonMeta(_PluginBase):
# 插件名称
plugin_name = "演职人员刮削"
# 插件描述
plugin_desc = "刮削演职人员图片以及中文名称。"
# 插件图标
plugin_icon = "actor.png"
# 主题色
plugin_color = "#E66E72"
# 插件版本
plugin_version = "1.0"
# 插件作者
plugin_author = "jxxghp"
# 作者主页
author_url = "https://github.com/jxxghp"
# 插件配置项ID前缀
plugin_config_prefix = "personmeta_"
# 加载顺序
plugin_order = 24
# 可使用的用户级别
auth_level = 1
# 私有属性
_enabled = False
def init_plugin(self, config: dict = None):
if config:
self._enabled = config.get("enabled")
def get_state(self) -> bool:
return self._enabled
@staticmethod
def get_command() -> List[Dict[str, Any]]:
pass
def get_api(self) -> List[Dict[str, Any]]:
pass
def get_form(self) -> Tuple[List[dict], Dict[str, Any]]:
"""
拼装插件配置页面需要返回两块数据1页面配置2数据结构
"""
return [
{
'component': 'VForm',
'content': [
{
'component': 'VRow',
'content': [
{
'component': 'VCol',
'props': {
'cols': 12,
'md': 6
},
'content': [
{
'component': 'VSwitch',
'props': {
'model': 'enabled',
'label': '启用插件',
}
}
]
}
]
}
]
}
], {
"enabled": False
}
def get_page(self) -> List[dict]:
pass
def stop_service(self):
"""
退出插件
"""
pass