This commit is contained in:
Baobhan Sith
2025-04-22 20:32:13 +08:00
parent f74c61a8bb
commit 08b55a2ce6
9 changed files with 918 additions and 24 deletions
+864 -15
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -32,6 +32,7 @@
"vuedraggable": "^4.1.0" "vuedraggable": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@tailwindcss/postcss": "^4.1.4",
"@types/qrcode": "^1.5.5", "@types/qrcode": "^1.5.5",
"@types/speakeasy": "^2.0.10", "@types/speakeasy": "^2.0.10",
"qrcode": "^1.5.4", "qrcode": "^1.5.4",
+4
View File
@@ -25,8 +25,12 @@
"xterm-addon-web-links": "^0.9.0" "xterm-addon-web-links": "^0.9.0"
}, },
"devDependencies": { "devDependencies": {
"@tailwindcss/postcss": "^4.1.4",
"@types/splitpanes": "^2.2.6", "@types/splitpanes": "^2.2.6",
"@vitejs/plugin-vue": "^4.2.0", "@vitejs/plugin-vue": "^4.2.0",
"autoprefixer": "^10.4.21",
"postcss": "^8.5.3",
"tailwindcss": "^4.1.4",
"typescript": "^5.0.0", "typescript": "^5.0.0",
"vite": "^4.4.0", "vite": "^4.4.0",
"vue-tsc": "^1.8.0" "vue-tsc": "^1.8.0"
+6
View File
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
'@tailwindcss/postcss': {},
autoprefixer: {},
},
}
@@ -116,14 +116,21 @@ const focusSearchInput = (): boolean => {
defineExpose({ focusCommandInput, focusSearchInput }); defineExpose({ focusCommandInput, focusSearchInput });
// --- Register/Unregister Focus Actions --- // --- Register/Unregister Focus Actions ---
let unregisterCommandInputFocus: (() => void) | null = null;
let unregisterTerminalSearchFocus: (() => void) | null = null;
onMounted(() => { onMounted(() => {
focusSwitcherStore.registerFocusAction('commandInput', focusCommandInput); unregisterCommandInputFocus = focusSwitcherStore.registerFocusAction('commandInput', focusCommandInput);
focusSwitcherStore.registerFocusAction('terminalSearch', focusSearchInput); unregisterTerminalSearchFocus = focusSwitcherStore.registerFocusAction('terminalSearch', focusSearchInput);
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {
focusSwitcherStore.unregisterFocusAction('commandInput'); if (unregisterCommandInputFocus) {
focusSwitcherStore.unregisterFocusAction('terminalSearch'); unregisterCommandInputFocus();
}
if (unregisterTerminalSearchFocus) {
unregisterTerminalSearchFocus();
}
}); });
</script> </script>
+7 -1
View File
@@ -1,3 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
/* 全局样式和 CSS 变量定义 */ /* 全局样式和 CSS 变量定义 */
:root { :root {
/* 基础颜色 */ /* 基础颜色 */
@@ -21,6 +25,8 @@
--split-line-hover-color: var(--border-color); /* 分割线悬停颜色 */ --split-line-hover-color: var(--border-color); /* 分割线悬停颜色 */
--input-focus-border-color: var(--link-active-color); /* 输入框聚焦边框颜色 */ --input-focus-border-color: var(--link-active-color); /* 输入框聚焦边框颜色 */
--input-focus-glow: var(--link-active-color); /* 输入框聚焦光晕值 */ --input-focus-glow: var(--link-active-color); /* 输入框聚焦光晕值 */
--ssh-tab-active: none/* ssh标签激活状态颜色 */
--ssh-tab-background: none/* ssh标签背景颜色 */
/* 字体 */ /* 字体 */
--font-family-sans-serif: sans-serif; /* 默认字体 */ --font-family-sans-serif: sans-serif; /* 默认字体 */
@@ -74,7 +80,7 @@ hr {
/* 为 xterm 终端添加内边距 */ /* 为 xterm 终端添加内边距 */
.xterm{ .xterm{
padding: 10px 10px 10px 10px; padding: 10px 10px 10px 10px;
} }
@@ -66,6 +66,7 @@ const hoveredItemId = ref<number | null>(null);
const selectedIndex = ref<number>(-1); // -1 const selectedIndex = ref<number>(-1); // -1
const historyListRef = ref<HTMLUListElement | null>(null); // Ref for the history list UL const historyListRef = ref<HTMLUListElement | null>(null); // Ref for the history list UL
const searchInputRef = ref<HTMLInputElement | null>(null); // +++ Ref for the search input +++ const searchInputRef = ref<HTMLInputElement | null>(null); // +++ Ref for the search input +++
let unregisterFocus: (() => void) | null = null; // +++ +++
// --- Store Getter --- // --- Store Getter ---
const searchTerm = computed(() => commandHistoryStore.searchTerm); const searchTerm = computed(() => commandHistoryStore.searchTerm);
@@ -89,10 +90,14 @@ onMounted(() => {
// +++ / +++ // +++ / +++
onMounted(() => { onMounted(() => {
focusSwitcherStore.registerFocusAction('commandHistorySearch', focusSearchInput); // +++ +++
unregisterFocus = focusSwitcherStore.registerFocusAction('commandHistorySearch', focusSearchInput);
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {
focusSwitcherStore.unregisterFocusAction('commandHistorySearch'); // +++ +++
if (unregisterFocus) {
unregisterFocus();
}
}); });
// --- --- // --- ---
@@ -82,6 +82,7 @@ const commandToEdit = ref<QuickCommandFE | null>(null);
const selectedIndex = ref<number>(-1); // -1 const selectedIndex = ref<number>(-1); // -1
const commandListRef = ref<HTMLUListElement | null>(null); // Ref for the command list UL const commandListRef = ref<HTMLUListElement | null>(null); // Ref for the command list UL
const searchInputRef = ref<HTMLInputElement | null>(null); // +++ Ref for the search input +++ const searchInputRef = ref<HTMLInputElement | null>(null); // +++ Ref for the search input +++
let unregisterFocus: (() => void) | null = null; // +++ +++
// --- Store Getter --- // --- Store Getter ---
const searchTerm = computed(() => quickCommandsStore.searchTerm); const searchTerm = computed(() => quickCommandsStore.searchTerm);
@@ -101,10 +102,14 @@ onMounted(() => {
// +++ / +++ // +++ / +++
onMounted(() => { onMounted(() => {
focusSwitcherStore.registerFocusAction('quickCommandsSearch', focusSearchInput); // +++ +++
unregisterFocus = focusSwitcherStore.registerFocusAction('quickCommandsSearch', focusSearchInput);
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {
focusSwitcherStore.unregisterFocusAction('quickCommandsSearch'); // +++ +++
if (unregisterFocus) {
unregisterFocus();
}
}); });
// --- --- // --- ---
+11
View File
@@ -0,0 +1,11 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./index.html",
"./src/**/*.{vue,js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}