mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
feat: Made select works
This commit is contained in:
parent
cbb732c778
commit
afacc79b56
@ -61,6 +61,14 @@ async function onSettingWindowCreated(view: Element) {
|
|||||||
SettingItem('Access token', null,
|
SettingItem('Access token', null,
|
||||||
`<div class="q-input" style="width:210px;"><input class="q-input__inner" data-config-key="token" type="text" value="${config.token}" placeholder="未设置" /></div>`,
|
`<div class="q-input" style="width:210px;"><input class="q-input__inner" data-config-key="token" type="text" value="${config.token}" placeholder="未设置" /></div>`,
|
||||||
),
|
),
|
||||||
|
SettingItem(
|
||||||
|
'消息上报格式类型',
|
||||||
|
'如客户端无特殊需求推荐保持默认设置,两者的详细差异可参考 <a href="javascript:LiteLoader.api.openExternal(\'https://github.com/botuniverse/onebot-11/tree/master/message#readme\');">OneBot v11 文档</a>',
|
||||||
|
SettingSelect([
|
||||||
|
{ text: '消息段', value: 'array' },
|
||||||
|
{ text: 'CQ码', value: 'string' },
|
||||||
|
], 'ob11.messagePostFormat', config.ob11.messagePostFormat),
|
||||||
|
),
|
||||||
SettingItem(
|
SettingItem(
|
||||||
'ffmpeg 路径', `${!isEmpty(config.ffmpeg) ? config.ffmpeg : '未指定'}`,
|
'ffmpeg 路径', `${!isEmpty(config.ffmpeg) ? config.ffmpeg : '未指定'}`,
|
||||||
SettingButton('选择', 'config-ffmpeg-select'),
|
SettingButton('选择', 'config-ffmpeg-select'),
|
||||||
@ -72,14 +80,6 @@ async function onSettingWindowCreated(view: Element) {
|
|||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
SettingList([
|
SettingList([
|
||||||
SettingItem(
|
|
||||||
'消息上报格式类型',
|
|
||||||
'如客户端无特殊需求推荐保持默认设置,两者的详细差异可参考 <a href="javascript:LiteLoader.api.openExternal(\'https://github.com/botuniverse/onebot-11/tree/master/message#readme\');">OneBot v11 文档</a>',
|
|
||||||
SettingSelect([
|
|
||||||
{ text: '消息段', value: 'array' },
|
|
||||||
{ text: 'CQ码', value: 'string' },
|
|
||||||
], 'ob11.messagePostFormat', config.ob11.messagePostFormat),
|
|
||||||
),
|
|
||||||
SettingItem(
|
SettingItem(
|
||||||
'使用 Base64 编码获取文件',
|
'使用 Base64 编码获取文件',
|
||||||
'开启后,调用 /get_image、/get_record 时,获取不到 url 时添加一个 Base64 字段',
|
'开启后,调用 /get_image、/get_record 时,获取不到 url 时添加一个 Base64 字段',
|
||||||
@ -149,6 +149,16 @@ async function onSettingWindowCreated(view: Element) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 下拉框
|
||||||
|
doc.querySelectorAll('setting-select').forEach((dom: HTMLElement) => {
|
||||||
|
dom.addEventListener('selected', (e: CustomEvent) => {
|
||||||
|
const configKey = dom.dataset.configKey;
|
||||||
|
const configValue = e.detail.value;
|
||||||
|
|
||||||
|
setConfig(configKey, configValue);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
doc.body.childNodes.forEach(node => {
|
doc.body.childNodes.forEach(node => {
|
||||||
view.appendChild(node);
|
view.appendChild(node);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user