diff --git a/orion-ops-ui/src/store/modules/terminal/index.ts b/orion-ops-ui/src/store/modules/terminal/index.ts index ad43bae7..ef158d43 100644 --- a/orion-ops-ui/src/store/modules/terminal/index.ts +++ b/orion-ops-ui/src/store/modules/terminal/index.ts @@ -1,11 +1,17 @@ import type { TerminalPreference, TerminalState, TerminalTheme } from './types'; -import { DarkTheme } from './types'; import { defineStore } from 'pinia'; import { getPreference, updatePreferencePartial } from '@/api/user/preference'; import { Message } from '@arco-design/web-vue'; import { useDark } from '@vueuse/core'; import { DEFAULT_SCHEMA } from '@/views/host-ops/terminal/types/terminal.theme'; +// 暗色主题 +export const DarkTheme = { + DARK: 'dark', + LIGHT: 'light', + AUTO: 'auto' +}; + export default defineStore('terminal', { state: (): TerminalState => ({ isDarkTheme: useDark({ @@ -50,15 +56,13 @@ export default defineStore('terminal', { }, // 更新终端偏好 - async updatePreference(preference: TerminalPreference) { + async updatePreference() { try { // 修改配置 await updatePreferencePartial({ type: 'TERMINAL', - config: preference + config: this.preference }); - this.preference = preference; - Message.success('同步成功'); } catch (e) { Message.error('同步失败'); } diff --git a/orion-ops-ui/src/store/modules/terminal/types.ts b/orion-ops-ui/src/store/modules/terminal/types.ts index da6409a3..d74015b2 100644 --- a/orion-ops-ui/src/store/modules/terminal/types.ts +++ b/orion-ops-ui/src/store/modules/terminal/types.ts @@ -11,13 +11,6 @@ export interface TerminalPreference { terminalTheme: TerminalTheme, } -// 暗色主题 -export const DarkTheme = { - DARK: 'dark', - LIGHT: 'light', - AUTO: 'auto' -}; - // 终端主题 export interface TerminalTheme { name: string; diff --git a/orion-ops-ui/src/views/host-ops/terminal/assets/styles/layout.less b/orion-ops-ui/src/views/host-ops/terminal/assets/styles/layout.less index b60852aa..907dc805 100644 --- a/orion-ops-ui/src/views/host-ops/terminal/assets/styles/layout.less +++ b/orion-ops-ui/src/views/host-ops/terminal/assets/styles/layout.less @@ -222,8 +222,19 @@ body[terminal-theme='dark'] .host-layout { margin-bottom: 18px; } + .terminal-setting-subtitle-wrapper { + display: flex; + justify-content: space-between; + align-items: flex-start; + } + .terminal-setting-subtitle { - margin: 0 0 16px 0; + margin: 0; color: var(--color-content-text-3); } + + .terminal-setting-body { + margin: 16px 0 24px 0; + } + } diff --git a/orion-ops-ui/src/views/host-ops/terminal/components/layout/terminal-content.vue b/orion-ops-ui/src/views/host-ops/terminal/components/layout/terminal-content.vue index c026a4b5..aad9e1ef 100644 --- a/orion-ops-ui/src/views/host-ops/terminal/components/layout/terminal-content.vue +++ b/orion-ops-ui/src/views/host-ops/terminal/components/layout/terminal-content.vue @@ -7,8 +7,8 @@ :title="tab.title">