SW Manager 功能說明SW Manager features
表格的載入模式How the grids load their rows
同一張表格有兩種載入方式,而畫面上幾乎看不出來自己在哪一種。很多「按鈕不見了」「功能是不是壞了」的疑問,答案都在這裡。The same grid has two loading modes, and the screen barely tells you which one you are in. Most "the button disappeared" / "is this broken" questions land here.
兩種模式The two modes
| 模式Mode | 資料怎麼來How rows arrive | 看得到 Refresh / Loaded N / N 嗎Refresh / Loaded N / N visible? |
|---|---|---|
| 一般(客戶端)Client-side | 一次全撈回來,之後在瀏覽器裡排序分組Fetched in one go, then sorted and grouped in the browser | 會Yes |
| 伺服器端Server-side | 捲到哪、才去要哪一段Blocks are requested as you scroll | 不會No |
伺服器端模式下「總共載入了幾筆」這件事本身就不存在 —— 資料是分塊取的,所以那組顯示會收起來,不是壞掉。In server-side mode "how many rows are loaded in total" has no meaning — rows come block by block, so the strip is withdrawn rather than broken.
Refresh 與「Loaded N / N」什麼時候會出現When Refresh and "Loaded N / N" appear
那組控制項長這樣:Loaded 205 / 205 · as of 10:05 · Refresh。有兩種情況看不到它,兩種都是正常的:The strip reads Loaded 205 / 205 · as of 10:05 · Refresh. Two situations hide it, and both are expected:
- 你在 Actions 系列的報表頁。包含
/actions、/actions-deep-dive、/actions-marketing-sources、/actions-endpoint-attributes、/actions-technographics、/admin/actions。這六頁本來就沒有這組控制項,跟任何設定無關。You are on an Actions report page —/actions,/actions-deep-dive,/actions-marketing-sources,/actions-endpoint-attributes,/actions-technographics,/admin/actions. These six never have the strip, regardless of any setting. - 你在 Contacts 頁,但表格切到了伺服器端載入。You are on a Contacts page whose grid switched to server-side loading.
這兩個是各自獨立的條件,不是同一回事 —— 所以在 Actions 頁上怎麼調載入模式都不會讓它出現。These are two independent conditions — so no amount of switching load modes brings the strip back on an Actions page.
Contacts 頁怎麼決定用哪一種How a Contacts page picks its mode
flowchart TD
A["打開 Contacts 頁"] --> B{"網址有 ?ssrm=1"}
B -->|有| S["伺服器端"]
B -->|沒有| C{"網址有 ?ssrm=0"}
C -->|有| K["一般(客戶端)<br>看得到 Refresh"]
C -->|沒有| D{"功能旗標開著?"}
D -->|沒開| K
D -->|開著| E{"選到的分組維度<br>伺服器端都支援?"}
E -->|都支援| S
E -->|有不支援的| K
flowchart TD
A["Open a Contacts page"] --> B{"URL has ?ssrm=1"}
B -->|yes| S["Server-side"]
B -->|no| C{"URL has ?ssrm=0"}
C -->|yes| K["Client-side<br>Refresh is visible"]
C -->|no| D{"Feature flag on?"}
D -->|no| K
D -->|yes| E{"Are all picked groupings<br>served server-side?"}
E -->|yes| S
E -->|no| K
想切回一般模式看:網址後面加 ?ssrm=0。這是不用重新部署就能回退的開關,優先序高於功能旗標。
另外,選到伺服器端還不支援的分組維度(例如時間相關的分組)時,系統會自己退回一般模式 —— 這時 Refresh 就又出現了。To force client-side: add ?ssrm=0 to the URL. It is the no-deploy rollback switch and outranks the feature flag.
Also, picking a grouping that is not yet served server-side (time-based groupings, for example) makes the grid fall back on its own — and Refresh reappears.
伺服器端模式下 Download 會是灰的。同樣不是壞掉:匯出需要完整的結果集,而分塊載入手上沒有。這也是為什麼有人會問「CSV 匯出怎麼不能按」。Download is greyed out in server-side mode. Also not a bug: export needs the complete result set, and block loading does not have one. This is the source of "why can't I click CSV export".
程式位置:顯示條件在 samurai-world-client/src/modules/contact/contacts-27/ContactGridToolbar.tsx 的 LoadStatusControls(Actions 報表與伺服器端模式是兩個獨立的提前返回);模式怎麼決定在同目錄的 contactGridRowModel.ts。Where the code lives: the display conditions are in LoadStatusControls inside samurai-world-client/src/modules/contact/contacts-27/ContactGridToolbar.tsx (Action reports and server-side mode are two separate early returns); the mode itself is decided in contactGridRowModel.ts in the same folder.