Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion dashboard/src/assets/mdi-subset/materialdesignicons-subset.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Auto-generated MDI subset – 260 icons */
/* Auto-generated MDI subset – 262 icons */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

该文件是自动生成的(如注释所述),手动修改的内容在下次运行 pnpm run subset-icons 时会被覆盖。请按照文件头部的说明,通过运行脚本来更新图标子集,而不是直接编辑 CSS 文件。

/* Do not edit manually. Run: pnpm run subset-icons */

@font-face {
Expand Down Expand Up @@ -500,6 +500,14 @@
content: "\F07B9";
}

.mdi-format-align-left::before {
content: "\F0262";
}

.mdi-format-columns::before {
content: "\F08DF";
}

.mdi-format-list-bulleted::before {
content: "\F0279";
}
Expand Down
Binary file not shown.
Binary file not shown.
30 changes: 29 additions & 1 deletion dashboard/src/components/shared/ConsoleDisplayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ import { EventSourcePolyfill } from 'event-source-polyfill';
</v-chip>
</v-chip-group>
<v-spacer></v-spacer>
<v-btn
:icon="flushMode ? 'mdi-format-columns' : 'mdi-format-align-left'"
variant="text"
density="compact"
class="fullscreen-btn"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

建议为该按钮添加 me-2 类名,以增加与全屏按钮之间的间距,避免视觉上过于拥挤。另外,fullscreen-btn 类名用于布局切换按钮会产生误导(虽然目前仅用于颜色定义),建议考虑重构为更通用的名称。

        class="me-2 fullscreen-btn"

@click="toggleFlushMode"
></v-btn>
<v-btn
:icon="isFullscreen ? 'mdi-fullscreen-exit' : 'mdi-fullscreen'"
variant="text"
Expand All @@ -23,7 +30,7 @@ import { EventSourcePolyfill } from 'event-source-polyfill';
></v-btn>
</div>

<div id="term" class="console-term">
<div id="term" class="console-term" :class="{ 'console-term--flush': flushMode }">
</div>
</div>
</template>
Expand All @@ -35,6 +42,7 @@ export default {
return {
autoScroll: true,
isFullscreen: false,
flushMode: false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

建议将 flushMode 的初始值从 localStorage 中读取,以便在页面刷新后保留用户的显示偏好,提升用户体验。

      flushMode: localStorage.getItem('console_flush_mode') === 'true',

logColorAnsiMap: {
'\u001b[1;34m': 'color: #6cb6d9; font-weight: bold;',
'\u001b[1;36m': 'color: #72c4cc; font-weight: bold;',
Expand Down Expand Up @@ -264,6 +272,10 @@ export default {
this.autoScroll = !this.autoScroll;
},

toggleFlushMode() {
this.flushMode = !this.flushMode;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

在切换模式时,建议将新的状态同步保存到 localStorage 中,以配合初始化的持久化逻辑。

      this.flushMode = !this.flushMode;
      localStorage.setItem('console_flush_mode', this.flushMode);

},

toggleFullscreen() {
const container = document.getElementById('console-wrapper');
if (!document.fullscreenElement) {
Expand Down Expand Up @@ -386,6 +398,22 @@ export default {
white-space: normal;
}

.console-term--flush :deep(.console-log-line--structured) {
display: block;
white-space: pre-wrap;
}

.console-term--flush :deep(.console-log-prefix),
.console-term--flush :deep(.console-log-level),
.console-term--flush :deep(.console-log-message) {
display: inline;
}

.console-term--flush :deep(.console-log-prefix),
.console-term--flush :deep(.console-log-level) {
margin-right: 4px;
}

:deep(.console-log-prefix),
:deep(.console-log-level),
:deep(.console-log-message) {
Expand Down
Loading