diff --git a/package-lock.json b/package-lock.json index 054782f..67c1b7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1772,6 +1772,12 @@ "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", "license": "MIT" }, + "node_modules/@types/web-bluetooth": { + "version": "0.0.21", + "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.21.tgz", + "integrity": "sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==", + "license": "MIT" + }, "node_modules/@types/ws": { "version": "8.18.1", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", @@ -2026,6 +2032,44 @@ "integrity": "sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==", "license": "MIT" }, + "node_modules/@vueuse/core": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-13.1.0.tgz", + "integrity": "sha512-PAauvdRXZvTWXtGLg8cPUFjiZEddTqmogdwYpnn60t08AA5a8Q4hZokBnpTOnVNqySlFlTcRYIC8OqreV4hv3Q==", + "license": "MIT", + "dependencies": { + "@types/web-bluetooth": "^0.0.21", + "@vueuse/metadata": "13.1.0", + "@vueuse/shared": "13.1.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, + "node_modules/@vueuse/metadata": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-13.1.0.tgz", + "integrity": "sha512-+TDd7/a78jale5YbHX9KHW3cEDav1lz1JptwDvep2zSG8XjCsVE+9mHIzjTOaPbHUAk5XiE4jXLz51/tS+aKQw==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-13.1.0.tgz", + "integrity": "sha512-IVS/qRRjhPTZ6C2/AM3jieqXACGwFZwWTdw5sNTSKk2m/ZpkuuN+ri+WCVUP8TqaKwJYt/KuMwmXspMAw8E6ew==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, "node_modules/@xmldom/xmldom": { "version": "0.8.10", "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz", @@ -8848,12 +8892,13 @@ }, "packages/frontend": { "name": "@nexus-terminal/frontend", - "version": "0.2.4", + "version": "0.2.5", "dependencies": { "@fortawesome/fontawesome-free": "^6.7.2", "@hcaptcha/vue3-hcaptcha": "^1.3.0", "@tailwindcss/vite": "^4.1.4", "@vscode/iconv-lite-umd": "^0.7.0", + "@vueuse/core": "^13.1.0", "@xterm/addon-fit": "^0.10.0", "@xterm/addon-search": "^0.15.0", "axios": "^1.8.4", diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 6473423..90c9f40 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -13,6 +13,7 @@ "@hcaptcha/vue3-hcaptcha": "^1.3.0", "@tailwindcss/vite": "^4.1.4", "@vscode/iconv-lite-umd": "^0.7.0", + "@vueuse/core": "^13.1.0", "@xterm/addon-fit": "^0.10.0", "@xterm/addon-search": "^0.15.0", "axios": "^1.8.4", diff --git a/packages/frontend/src/App.vue b/packages/frontend/src/App.vue index 804d0a4..8bd3ffa 100644 --- a/packages/frontend/src/App.vue +++ b/packages/frontend/src/App.vue @@ -260,12 +260,12 @@ const isElementVisibleAndFocusable = (element: HTMLElement): boolean => {
Project Logo - {{ t('nav.dashboard') }} - {{ t('nav.terminal') }} - {{ t('nav.proxies') }} - {{ t('nav.notifications') }} - {{ t('nav.auditLogs') }} - {{ t('nav.settings') }} + {{ t('nav.dashboard') }} + {{ t('nav.terminal') }} + + + + {{ t('nav.settings') }}
diff --git a/packages/frontend/src/components/CommandInputBar.vue b/packages/frontend/src/components/CommandInputBar.vue index b28699d..e7a82dc 100644 --- a/packages/frontend/src/components/CommandInputBar.vue +++ b/packages/frontend/src/components/CommandInputBar.vue @@ -7,6 +7,7 @@ import { useFocusSwitcherStore } from '../stores/focusSwitcher.store'; import { useSettingsStore } from '../stores/settings.store'; import { useQuickCommandsStore } from '../stores/quickCommands.store'; import { useCommandHistoryStore } from '../stores/commandHistory.store'; +import QuickCommandsModal from './QuickCommandsModal.vue'; // +++ Import the modal component +++ const emit = defineEmits(['send-command', 'search', 'find-next', 'find-previous', 'close-search', 'clear-terminal']); // 添加 clear-terminal 事件 const { t } = useI18n(); @@ -31,11 +32,14 @@ const { updateSessionCommandInput } = sessionStore; // Props definition is now empty as search results are no longer handled here const props = defineProps<{ // No props defined here currently + // +++ Add isMobile prop +++ + isMobile?: boolean; }>(); // --- 移除本地 commandInput ref --- // const commandInput = ref(''); const isSearching = ref(false); const searchTerm = ref(''); +const showQuickCommands = ref(false); // +++ Add state for modal visibility +++ // *** 移除本地的搜索结果 ref *** // const searchResultCount = ref(0); // const currentSearchResultIndex = ref(0); @@ -244,11 +248,27 @@ onBeforeUnmount(() => { unregisterTerminalSearchFocus(); } }); + +// +++ Functions to control the quick commands modal +++ +const openQuickCommandsModal = () => { + showQuickCommands.value = true; +}; + +const closeQuickCommandsModal = () => { + showQuickCommands.value = false; +}; + +// +++ Handler for command execution from the modal +++ +const handleQuickCommandExecute = (command: string) => { + console.log(`[CommandInputBar] Executing quick command: ${command}`); + emit('send-command', command); // Emit the command to the parent + closeQuickCommandsModal(); // Close the modal after selection +};