generated from template/astro-simple-template
update
This commit is contained in:
@@ -36,8 +36,23 @@ export const useStore = create<StoreState>((set) => ({
|
||||
mockData.unshift({
|
||||
id: 'item-search',
|
||||
title: 'win+d 显示桌面',
|
||||
data: { type: "hotkeys", hotkeys: "win+d" },
|
||||
iconUrl: 'https://api.dicebear.com/7.x/icons/svg?seed=search',
|
||||
description: '显示桌面'
|
||||
});
|
||||
mockData.unshift({
|
||||
id: 'item-recor',
|
||||
title: 'ctrl+alt+h 开始或停止语音转文字',
|
||||
data: { type: "hotkeys", hotkeys: "ctrl+alt+h" },
|
||||
iconUrl: 'https://api.dicebear.com/7.x/icons/svg?seed=record',
|
||||
description: '开始或停止语音转文字'
|
||||
})
|
||||
mockData.unshift({
|
||||
id: 'item-newtab',
|
||||
title: 'ctrl+t 打开浏览器新标签页',
|
||||
data: { type: "hotkeys", hotkeys: "ctrl+t" },
|
||||
iconUrl: 'https://api.dicebear.com/7.x/icons/svg?seed=newtab',
|
||||
description: '打开浏览器新标签页'
|
||||
})
|
||||
// Simulate network delay
|
||||
await new Promise(resolve => setTimeout(resolve, 800));
|
||||
@@ -46,9 +61,10 @@ export const useStore = create<StoreState>((set) => ({
|
||||
},
|
||||
sendEvent: async (item: CardItem) => {
|
||||
// client/router?path=key-sender&keys=win+d
|
||||
console.log('Sending event for item:', item);
|
||||
const res = await query.post({
|
||||
path: 'key-sender',
|
||||
keys: 'win+d'
|
||||
keys: item?.data?.hotkeys || 'win+d'
|
||||
});
|
||||
console.log('Event sent for item:', item, 'Response:', res);
|
||||
if (res.code !== 200) {
|
||||
|
||||
Reference in New Issue
Block a user