fix: errors when npm lint

This commit is contained in:
wangcham
2025-11-13 14:30:26 +08:00
parent 81e411c558
commit 2ef47ebfb1
5 changed files with 28 additions and 10 deletions

View File

@@ -142,8 +142,12 @@ export default function BotForm({
// 尝试使用现代API
if (navigator.clipboard && navigator.clipboard.writeText) {
console.log('[Copy] Using Clipboard API with input value:', inputElement.value);
navigator.clipboard.writeText(inputElement.value)
console.log(
'[Copy] Using Clipboard API with input value:',
inputElement.value,
);
navigator.clipboard
.writeText(inputElement.value)
.then(() => {
console.log('[Copy] Clipboard API success');
inputElement.blur(); // 取消选中
@@ -151,7 +155,10 @@ export default function BotForm({
toast.success(t('bots.webhookUrlCopied'));
})
.catch((err) => {
console.error('[Copy] Clipboard API failed, trying execCommand:', err);
console.error(
'[Copy] Clipboard API failed, trying execCommand:',
err,
);
// 降级到execCommand
const successful = document.execCommand('copy');
console.log('[Copy] execCommand result:', successful);
@@ -165,7 +172,10 @@ export default function BotForm({
});
} else {
// 直接使用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');
console.log('[Copy] execCommand result:', successful);
inputElement.blur();
@@ -300,7 +310,8 @@ export default function BotForm({
enable: bot.enable ?? true,
use_pipeline_uuid: bot.use_pipeline_uuid ?? '',
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,
});
})
@@ -479,7 +490,10 @@ export default function BotForm({
<SelectContent className="fixed z-[1000]">
<SelectGroup>
{pipelineNameList.map((item) => (
<SelectItem key={item.value} value={item.value}>
<SelectItem
key={item.value}
value={item.value}
>
{item.label}
</SelectItem>
))}

View File

@@ -153,7 +153,8 @@ const enUS = {
logs: 'Logs',
webhookUrl: 'Webhook Callback URL',
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: {
title: 'Plugins',

View File

@@ -155,7 +155,8 @@ const jaJP = {
logs: 'ログ',
webhookUrl: 'Webhook コールバック URL',
webhookUrlCopied: 'Webhook URL をコピーしました',
webhookUrlHint: '入力ボックスをクリックして全選択し、Ctrl+C (Mac: Cmd+C) でコピーするか、右側のボタンをクリックしてください',
webhookUrlHint:
'入力ボックスをクリックして全選択し、Ctrl+C (Mac: Cmd+C) でコピーするか、右側のボタンをクリックしてください',
},
plugins: {
title: 'プラグイン',

View File

@@ -150,7 +150,8 @@ const zhHans = {
logs: '日志',
webhookUrl: 'Webhook 回调地址',
webhookUrlCopied: 'Webhook 地址已复制',
webhookUrlHint: '点击输入框自动全选,然后按 Ctrl+C (Mac: Cmd+C) 复制,或点击右侧按钮',
webhookUrlHint:
'点击输入框自动全选,然后按 Ctrl+C (Mac: Cmd+C) 复制,或点击右侧按钮',
},
plugins: {
title: '插件管理',

View File

@@ -150,7 +150,8 @@ const zhHant = {
logs: '日誌',
webhookUrl: 'Webhook 回調位址',
webhookUrlCopied: 'Webhook 位址已複製',
webhookUrlHint: '點擊輸入框自動全選,然後按 Ctrl+C (Mac: Cmd+C) 複製,或點擊右側按鈕',
webhookUrlHint:
'點擊輸入框自動全選,然後按 Ctrl+C (Mac: Cmd+C) 複製,或點擊右側按鈕',
},
plugins: {
title: '外掛管理',