-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathguoba.support.js
40 lines (38 loc) · 1.11 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
import lodash from 'lodash'
import { Config } from '#components'
import { setting } from '#models'
export function supportGuoba () {
return {
pluginInfo: {
name: 'steam-plugin',
title: 'steam-plugin',
author: '@小叶',
authorLink: 'https://github.com/XasYer',
link: 'https://github.com/XasYer/steam-plugin',
isV3: true,
isV2: false,
description: '提供 steam 相关功能',
icon: 'mdi:steam'
},
configInfo: {
schemas: setting.getGuobasChemas(),
getConfigData () {
const data = {}
for (const file of Config.files) {
const name = file.replace('.yaml', '')
data[name] = Config.getDefOrConfig(name)
}
return data
},
setConfigData (data, { Result }) {
const config = Config.getCfg()
for (const key in data) {
const split = key.split('.')
if (lodash.isEqual(config[split[1]], data[key])) continue
Config.modify(split[0], split[1], data[key])
}
return Result.ok({}, '𝑪𝒊𝒂𝒍𝒍𝒐~(∠・ω< )⌒★')
}
}
}
}