Skip to content

Commit 98e5b5e

Browse files
committed
feat: 同步进度指示行 + 列表倒序 + 等待产品折叠
1 parent 2f594ff commit 98e5b5e

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

quantclass_sync_internal/gui/assets/app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ document.addEventListener('alpine:init', () => {
5757
pollTimer: null, // setTimeout 句柄
5858
syncProducts: [], // 同步过程中已处理产品列表(每项含 name/status/elapsed/files_count/error)
5959
allProducts: [], // 全部待同步产品名(用于计算等待中列表)
60+
showWaiting: false, // 等待中产品列表是否展开
6061

6162
// ===== 初始化 =====
6263
// 先调 get_config() 判断视图:config_exists → main,否则 → setup
@@ -175,6 +176,7 @@ document.addEventListener('alpine:init', () => {
175176
this.runSummary = null;
176177
this.syncProducts = [];
177178
this.allProducts = [];
179+
this.showWaiting = false;
178180
try {
179181
const result = await window.pywebview.api.start_sync();
180182
if (result.started) {
@@ -204,6 +206,7 @@ document.addEventListener('alpine:init', () => {
204206
this.runSummary = null;
205207
this.syncProducts = [];
206208
this.allProducts = [];
209+
this.showWaiting = false;
207210
try {
208211
// true 表示仅重试失败产品
209212
const result = await window.pywebview.api.start_sync(true);

quantclass_sync_internal/gui/assets/index.html

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,14 @@ <h2 class="setup-title">QuantClass Sync 初始设置</h2>
338338
</div>
339339
<span class="qs-progress-text" x-text="total > 0 ? completed + ' / ' + total : '准备中...'"></span>
340340
</div>
341+
<!-- 进度指示行 -->
342+
<div x-show="total === 0" style="font-size:0.92em; color:#6b7280; margin:6px 0 2px;">
343+
正在准备同步计划...
344+
</div>
345+
<div x-show="total > 0" style="font-size:0.92em; color:#6b7280; margin:6px 0 2px;">
346+
<span x-text="'已完成 ' + completed + '/' + total"></span>
347+
<span x-show="currentProduct"> · 最新: <span style="font-weight:600" x-text="currentProduct"></span></span>
348+
</div>
341349
<!-- 耗时/预估 -->
342350
<div class="qs-meta-row">
343351
<span x-text="'已用时: ' + formatDuration(elapsedSeconds)"></span>
@@ -346,8 +354,8 @@ <h2 class="setup-title">QuantClass Sync 初始设置</h2>
346354
<!-- 产品列表 -->
347355
<div class="qs-card" style="padding:10px 14px;">
348356
<ul class="qs-product-list">
349-
<!-- 已完成产品 -->
350-
<template x-for="sp in syncProducts" :key="sp.name">
357+
<!-- 已完成产品(倒序:最新完成的显示在最前面) -->
358+
<template x-for="sp in syncProducts.slice().reverse()" :key="sp.name">
351359
<li class="qs-product-item">
352360
<!-- 状态图标:✓绿/✗红/–灰 -->
353361
<div class="qs-product-icon"
@@ -366,9 +374,18 @@ <h2 class="setup-title">QuantClass Sync 初始设置</h2>
366374
</template>
367375
</li>
368376
</template>
369-
<!-- 等待中产品(灰色弱化) -->
377+
<!-- 等待中产品折叠头 -->
378+
<template x-if="waitingProducts().length > 0">
379+
<li class="qs-product-item" style="cursor:pointer; user-select:none;"
380+
@click="showWaiting = !showWaiting">
381+
<div class="qs-product-icon icon-wait" x-text="showWaiting ? '▾' : '▸'" style="color:#c4c8ce;"></div>
382+
<span class="qs-product-name muted"
383+
x-text="'还有 ' + waitingProducts().length + ' 个产品等待中'"></span>
384+
</li>
385+
</template>
386+
<!-- 等待中产品展开列表 -->
370387
<template x-for="name in waitingProducts()" :key="'wait-' + name">
371-
<li class="qs-product-item">
388+
<li class="qs-product-item" x-show="showWaiting">
372389
<div class="qs-product-icon icon-wait">&middot;</div>
373390
<span class="qs-product-name muted" x-text="name"></span>
374391
<span class="qs-product-meta" style="color:#d0d4da;">等待中</span>

0 commit comments

Comments
 (0)