mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-22 12:26:08 +00:00
fix: errors when npm lint
This commit is contained in:
@@ -142,8 +142,12 @@ export default function BotForm({
|
|||||||
|
|
||||||
// 尝试使用现代API
|
// 尝试使用现代API
|
||||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||||
console.log('[Copy] Using Clipboard API with input value:', inputElement.value);
|
console.log(
|
||||||
navigator.clipboard.writeText(inputElement.value)
|
'[Copy] Using Clipboard API with input value:',
|
||||||
|
inputElement.value,
|
||||||
|
);
|
||||||
|
navigator.clipboard
|
||||||
|
.writeText(inputElement.value)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('[Copy] Clipboard API success');
|
console.log('[Copy] Clipboard API success');
|
||||||
inputElement.blur(); // 取消选中
|
inputElement.blur(); // 取消选中
|
||||||
@@ -151,7 +155,10 @@ export default function BotForm({
|
|||||||
toast.success(t('bots.webhookUrlCopied'));
|
toast.success(t('bots.webhookUrlCopied'));
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error('[Copy] Clipboard API failed, trying execCommand:', err);
|
console.error(
|
||||||
|
'[Copy] Clipboard API failed, trying execCommand:',
|
||||||
|
err,
|
||||||
|
);
|
||||||
// 降级到execCommand
|
// 降级到execCommand
|
||||||
const successful = document.execCommand('copy');
|
const successful = document.execCommand('copy');
|
||||||
console.log('[Copy] execCommand result:', successful);
|
console.log('[Copy] execCommand result:', successful);
|
||||||
@@ -165,7 +172,10 @@ export default function BotForm({
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 直接使用execCommand
|
// 直接使用execCommand
|
||||||
console.log('[Copy] Using execCommand with input value:', inputElement.value);
|
console.log(
|
||||||
|
'[Copy] Using execCommand with input value:',
|
||||||
|
inputElement.value,
|
||||||
|
);
|
||||||
const successful = document.execCommand('copy');
|
const successful = document.execCommand('copy');
|
||||||
console.log('[Copy] execCommand result:', successful);
|
console.log('[Copy] execCommand result:', successful);
|
||||||
inputElement.blur();
|
inputElement.blur();
|
||||||
@@ -300,7 +310,8 @@ export default function BotForm({
|
|||||||
enable: bot.enable ?? true,
|
enable: bot.enable ?? true,
|
||||||
use_pipeline_uuid: bot.use_pipeline_uuid ?? '',
|
use_pipeline_uuid: bot.use_pipeline_uuid ?? '',
|
||||||
webhook_full_url: bot.adapter_runtime_values
|
webhook_full_url: bot.adapter_runtime_values
|
||||||
? (bot.adapter_runtime_values as any).webhook_full_url
|
? ((bot.adapter_runtime_values as Record<string, unknown>)
|
||||||
|
.webhook_full_url as string)
|
||||||
: undefined,
|
: undefined,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
@@ -479,7 +490,10 @@ export default function BotForm({
|
|||||||
<SelectContent className="fixed z-[1000]">
|
<SelectContent className="fixed z-[1000]">
|
||||||
<SelectGroup>
|
<SelectGroup>
|
||||||
{pipelineNameList.map((item) => (
|
{pipelineNameList.map((item) => (
|
||||||
<SelectItem key={item.value} value={item.value}>
|
<SelectItem
|
||||||
|
key={item.value}
|
||||||
|
value={item.value}
|
||||||
|
>
|
||||||
{item.label}
|
{item.label}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -153,7 +153,8 @@ const enUS = {
|
|||||||
logs: 'Logs',
|
logs: 'Logs',
|
||||||
webhookUrl: 'Webhook Callback URL',
|
webhookUrl: 'Webhook Callback URL',
|
||||||
webhookUrlCopied: 'Webhook URL copied',
|
webhookUrlCopied: 'Webhook URL copied',
|
||||||
webhookUrlHint: 'Click the input to select all, then press Ctrl+C (Mac: Cmd+C) to copy, or click the button',
|
webhookUrlHint:
|
||||||
|
'Click the input to select all, then press Ctrl+C (Mac: Cmd+C) to copy, or click the button',
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
title: 'Plugins',
|
title: 'Plugins',
|
||||||
|
|||||||
@@ -155,7 +155,8 @@ const jaJP = {
|
|||||||
logs: 'ログ',
|
logs: 'ログ',
|
||||||
webhookUrl: 'Webhook コールバック URL',
|
webhookUrl: 'Webhook コールバック URL',
|
||||||
webhookUrlCopied: 'Webhook URL をコピーしました',
|
webhookUrlCopied: 'Webhook URL をコピーしました',
|
||||||
webhookUrlHint: '入力ボックスをクリックして全選択し、Ctrl+C (Mac: Cmd+C) でコピーするか、右側のボタンをクリックしてください',
|
webhookUrlHint:
|
||||||
|
'入力ボックスをクリックして全選択し、Ctrl+C (Mac: Cmd+C) でコピーするか、右側のボタンをクリックしてください',
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
title: 'プラグイン',
|
title: 'プラグイン',
|
||||||
|
|||||||
@@ -150,7 +150,8 @@ const zhHans = {
|
|||||||
logs: '日志',
|
logs: '日志',
|
||||||
webhookUrl: 'Webhook 回调地址',
|
webhookUrl: 'Webhook 回调地址',
|
||||||
webhookUrlCopied: 'Webhook 地址已复制',
|
webhookUrlCopied: 'Webhook 地址已复制',
|
||||||
webhookUrlHint: '点击输入框自动全选,然后按 Ctrl+C (Mac: Cmd+C) 复制,或点击右侧按钮',
|
webhookUrlHint:
|
||||||
|
'点击输入框自动全选,然后按 Ctrl+C (Mac: Cmd+C) 复制,或点击右侧按钮',
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
title: '插件管理',
|
title: '插件管理',
|
||||||
|
|||||||
@@ -150,7 +150,8 @@ const zhHant = {
|
|||||||
logs: '日誌',
|
logs: '日誌',
|
||||||
webhookUrl: 'Webhook 回調位址',
|
webhookUrl: 'Webhook 回調位址',
|
||||||
webhookUrlCopied: 'Webhook 位址已複製',
|
webhookUrlCopied: 'Webhook 位址已複製',
|
||||||
webhookUrlHint: '點擊輸入框自動全選,然後按 Ctrl+C (Mac: Cmd+C) 複製,或點擊右側按鈕',
|
webhookUrlHint:
|
||||||
|
'點擊輸入框自動全選,然後按 Ctrl+C (Mac: Cmd+C) 複製,或點擊右側按鈕',
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
title: '外掛管理',
|
title: '外掛管理',
|
||||||
|
|||||||
Reference in New Issue
Block a user