dsh-ustc-quota 1.1.32 → 1.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/client.js +33 -1
- package/index.js +23 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -108,7 +108,7 @@ key-c 8.7/30 29% 8.7/70 12% 11.1/100 11%
|
|
|
108
108
|
## 面板位置
|
|
109
109
|
|
|
110
110
|
- 卡片默认在左侧边栏底部。**鼠标移到卡片上时,标题左边的品牌图标会变成方向图标**(布局图示,标出卡片将要去的那一侧),点一下即可换边;移开鼠标图标复原。选择会记住,重启后保持。
|
|
111
|
-
-
|
|
111
|
+
- 右侧位置会在对话区右侧**预留一条槽**:插件给对话列加右侧内边距(约列宽的 26%,封顶 34%),正文与轮次导航条整体左移,卡片占住这条槽——因此不遮挡正文、不遮挡轮次导航条、也不遮挡右侧原生按钮。上沿从「对话 / 轨迹 / 看板」选项卡下的分隔线以下 6px 开始。
|
|
112
112
|
- 窄窗口或打开侧栏时槽宽自动收窄(下限 140px),卡片始终可见;如果连正文最小宽度都不够,则允许卡片比常规更窄,而不是消失。
|
|
113
113
|
- 换边不重新加载:两处卡片共用同一份已取到的数据。底色用左侧边栏的底色(`--dsw-specific-sidebar-fill`),阴影与左侧一致。
|
|
114
114
|
## 更新
|
package/client.js
CHANGED
|
@@ -11,7 +11,7 @@ window.__ModuleLoader__.load({
|
|
|
11
11
|
const UPDATE_ENDPOINT = 'plugins/dsh-ustc-quota/update';
|
|
12
12
|
const UPDATE_APPLY_ENDPOINT = 'plugins/dsh-ustc-quota/update/apply';
|
|
13
13
|
const WINDOW_IDS = ['3h', '12h', '24h'];
|
|
14
|
-
const CLIENT_VERSION = '1.1.
|
|
14
|
+
const CLIENT_VERSION = '1.1.34';
|
|
15
15
|
const UPDATE_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
16
16
|
const CLIENT_VERSION_KEY = `${NS}:client-version`;
|
|
17
17
|
const CLIENT_RELOAD_KEY = `${NS}:client-reload`;
|
|
@@ -1141,6 +1141,38 @@ window.__ModuleLoader__.load({
|
|
|
1141
1141
|
const DOCK_TRANSCRIPT_FLOOR = 360;
|
|
1142
1142
|
|
|
1143
1143
|
|
|
1144
|
+
// Reserved right strip: applied from the measure loop so a DSH re-render of the
|
|
1145
|
+
// column cannot drop it, and restored whenever the dock leaves the right seat.
|
|
1146
|
+
let reservedColumn = null;
|
|
1147
|
+
let reservedSaved = null;
|
|
1148
|
+
let reservedSavedPriority = '';
|
|
1149
|
+
|
|
1150
|
+
function applyReservedPadding(reserve) {
|
|
1151
|
+
const holder = document.querySelector('[data-slot="main.conversation"]');
|
|
1152
|
+
const column = holder ? (holder.firstElementChild || holder) : null;
|
|
1153
|
+
if (!column) return false;
|
|
1154
|
+
if (reservedColumn !== column) {
|
|
1155
|
+
releaseReservedPadding();
|
|
1156
|
+
reservedColumn = column;
|
|
1157
|
+
reservedSaved = column.style.getPropertyValue('padding-right');
|
|
1158
|
+
reservedSavedPriority = column.style.getPropertyPriority('padding-right');
|
|
1159
|
+
}
|
|
1160
|
+
const wanted = reserve + 'px';
|
|
1161
|
+
if (column.style.getPropertyValue('padding-right') !== wanted) {
|
|
1162
|
+
column.style.setProperty('padding-right', wanted, 'important');
|
|
1163
|
+
}
|
|
1164
|
+
return true;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
function releaseReservedPadding() {
|
|
1168
|
+
if (!reservedColumn) return;
|
|
1169
|
+
if (reservedSaved) reservedColumn.style.setProperty('padding-right', reservedSaved, reservedSavedPriority);
|
|
1170
|
+
else reservedColumn.style.removeProperty('padding-right');
|
|
1171
|
+
reservedColumn = null;
|
|
1172
|
+
reservedSaved = null;
|
|
1173
|
+
reservedSavedPriority = '';
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1144
1176
|
function measureRightDock() {
|
|
1145
1177
|
const holder = document.querySelector('[data-slot="main.conversation"]');
|
|
1146
1178
|
const column = holder ? (holder.firstElementChild || holder) : null;
|
package/index.js
CHANGED
|
@@ -22,7 +22,7 @@ const ROUTE_PATH = '/plugins/dsh-ustc-quota/snapshot';
|
|
|
22
22
|
const UPDATE_PATH = '/plugins/dsh-ustc-quota/update';
|
|
23
23
|
const UPDATE_APPLY_PATH = '/plugins/dsh-ustc-quota/update/apply';
|
|
24
24
|
const UPDATE_TOKEN_TTL_MS = 30 * 60 * 1000;
|
|
25
|
-
const PLUGIN_VERSION = '1.1.
|
|
25
|
+
const PLUGIN_VERSION = '1.1.34';
|
|
26
26
|
const KEY_INFO_PATH = 'key/info';
|
|
27
27
|
const USER_INFO_PATH = 'user/info';
|
|
28
28
|
const DISCOVERY_TTL_MS = 30000;
|
|
@@ -57,7 +57,28 @@ export function apply(ctx, config) {
|
|
|
57
57
|
path: UPDATE_APPLY_PATH,
|
|
58
58
|
handler: (request, response) => handleUpdateApply(ctx, updates, updateTokens, request, response),
|
|
59
59
|
}), 'dsh-ustc-quota: update apply route');
|
|
60
|
-
|
|
60
|
+
|
|
61
|
+
// TEMPORARY probe (removed in the next build).
|
|
62
|
+
ctx.effect(() => ctx.webServer.register({
|
|
63
|
+
kind: 'exact',
|
|
64
|
+
path: '/plugins/dsh-ustc-quota/probe',
|
|
65
|
+
handler: (request, response) => {
|
|
66
|
+
const out = {};
|
|
67
|
+
try {
|
|
68
|
+
const conn = ctx.connection || {};
|
|
69
|
+
out.connectionKeys = Object.keys(conn);
|
|
70
|
+
for (const key of out.connectionKeys) {
|
|
71
|
+
const value = conn[key];
|
|
72
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') out[key] = value;
|
|
73
|
+
}
|
|
74
|
+
out.ctxKeys = Object.keys(ctx);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
out.error = String(error);
|
|
77
|
+
}
|
|
78
|
+
response.writeHead(200, { 'content-type': 'application/json', 'cache-control': 'no-store' });
|
|
79
|
+
response.end(JSON.stringify(out));
|
|
80
|
+
},
|
|
81
|
+
}), 'dsh-ustc-quota: probe route');}
|
|
61
82
|
|
|
62
83
|
function createReader(ctx, settings) {
|
|
63
84
|
const cache = new Map();
|
package/package.json
CHANGED