-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathguoba.support.js
93 lines (91 loc) · 2.82 KB
/
guoba.support.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import Config from "./components/Config.js";
import lodash from "lodash";
import path from "path";
import { pluginRoot } from "./model/path.js";
export function supportGuoba() {
return {
pluginInfo: {
name: 'neko-status-plugin',
title: '猫猫状态插件',
author: ['@erzaozi', '@CikeyQi'],
authorLink: ['https://github.com/erzaozi', 'https://github.com/CikeyQi'],
link: 'https://github.com/erzaozi/neko-status-plugin',
isV3: true,
isV2: false,
showInMenu: true,
description: '基于 Yunzai 的机器人状态查看插件',
// 显示图标,此为个性化配置
// 图标可在 https://icon-sets.iconify.design 这里进行搜索
icon: 'noto-v1:cat',
// 图标颜色,例:#FF0000 或 rgb(255, 0, 0)
iconColor: '#d19f56',
// 如果想要显示成图片,也可以填写图标路径(绝对路径)
iconPath: path.join(pluginRoot, 'resources/readme/girl.png'),
},
configInfo: {
schemas: [
{
field: "use_template",
label: "使用模板",
bottomHelpMessage: "选择一个模板来展示系统状态",
component: "Select",
componentProps: {
options: Config.getTemplate(),
},
},
{
field: "headimg_url",
label: "头图地址",
bottomHelpMessage: "输入一个图片地址来作为头图",
component: "Input",
componentProps: {
placeholder: '图片地址,请自行测试是否有效',
},
},
{
field: "custom",
label: "自定义内容",
bottomHelpMessage: "自定义内容",
component: "GSubForm",
componentProps: {
multiple: true,
schemas: [
{
field: "name",
label: "名称",
component: "Input",
required: true,
componentProps: {
placeholder: '例:系统名称',
},
},
{
field: "command",
label: "命令",
component: "Input",
required: true,
componentProps: {
placeholder: '例:uname',
},
},
],
},
},
],
getConfigData() {
let config = Config.getConfig()
return config
},
setConfigData(data, { Result }) {
let config = {}
for (let [keyPath, value] of Object.entries(data)) {
lodash.set(config, keyPath, value)
}
config = lodash.merge({}, Config.getConfig(), config)
config.custom = data['custom']
Config.setConfig(config)
return Result.ok({}, '保存成功~')
},
},
}
}