generated from template/astro-simple-template
update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kevisual/hot-api",
|
"name": "@kevisual/hot-api",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"basename": "/root/hot-api",
|
"basename": "/root/hot-api",
|
||||||
@@ -8,11 +8,11 @@
|
|||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
"build": "astro build",
|
"build": "astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"pub": "envision deploy ./dist -k hot-api -v 0.0.2 -u -y y",
|
"pub": "envision deploy ./dist -k hot-api -v 0.0.3 -u -y y",
|
||||||
"pub:docs": "envision deploy ./dist -k hot-api-docs -v 0.0.2 -u",
|
"pub:docs": "envision deploy ./dist -k hot-api-docs -v 0.0.3 -u",
|
||||||
"slide:dev": "slidev --open slides/index.md",
|
"slide:dev": "slidev --open slides/index.md",
|
||||||
"slide:build": "slidev build slides/index.md --base /root/hot-api-slide/",
|
"slide:build": "slidev build slides/index.md --base /root/hot-api-slide/",
|
||||||
"slide:pub": "envision deploy ./slides/dist -k hot-api-slide -v 0.0.2 -u",
|
"slide:pub": "envision deploy ./slides/dist -k hot-api-slide -v 0.0.3 -u",
|
||||||
"ui": "pnpm dlx shadcn@latest add "
|
"ui": "pnpm dlx shadcn@latest add "
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
|||||||
@@ -36,8 +36,23 @@ export const useStore = create<StoreState>((set) => ({
|
|||||||
mockData.unshift({
|
mockData.unshift({
|
||||||
id: 'item-search',
|
id: 'item-search',
|
||||||
title: 'win+d 显示桌面',
|
title: 'win+d 显示桌面',
|
||||||
|
data: { type: "hotkeys", hotkeys: "win+d" },
|
||||||
iconUrl: 'https://api.dicebear.com/7.x/icons/svg?seed=search',
|
iconUrl: 'https://api.dicebear.com/7.x/icons/svg?seed=search',
|
||||||
description: '显示桌面'
|
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
|
// Simulate network delay
|
||||||
await new Promise(resolve => setTimeout(resolve, 800));
|
await new Promise(resolve => setTimeout(resolve, 800));
|
||||||
@@ -46,9 +61,10 @@ export const useStore = create<StoreState>((set) => ({
|
|||||||
},
|
},
|
||||||
sendEvent: async (item: CardItem) => {
|
sendEvent: async (item: CardItem) => {
|
||||||
// client/router?path=key-sender&keys=win+d
|
// client/router?path=key-sender&keys=win+d
|
||||||
|
console.log('Sending event for item:', item);
|
||||||
const res = await query.post({
|
const res = await query.post({
|
||||||
path: 'key-sender',
|
path: 'key-sender',
|
||||||
keys: 'win+d'
|
keys: item?.data?.hotkeys || 'win+d'
|
||||||
});
|
});
|
||||||
console.log('Event sent for item:', item, 'Response:', res);
|
console.log('Event sent for item:', item, 'Response:', res);
|
||||||
if (res.code !== 200) {
|
if (res.code !== 200) {
|
||||||
|
|||||||
Reference in New Issue
Block a user