@fish-under-sea/magpie-neartoken 0.2.0 → 0.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fish-under-sea/magpie-neartoken",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "NearToken for magpie: a provider whose sign-in is the site's own device authorization, models listed per billing group with their multiplier, balance and vouchers on magpie's usage card, plus a page for spending and top-ups.",
5
5
  "type": "module",
6
6
  "main": "index.mjs",
@@ -8,6 +8,9 @@
8
8
  ".": "./index.mjs",
9
9
  "./page": "./page/index.html"
10
10
  },
11
+ "scripts": {
12
+ "prepack": "node scripts/stamp.mjs"
13
+ },
11
14
  "license": "MIT",
12
15
  "files": [
13
16
  "index.mjs",
package/page/app.js CHANGED
@@ -97,6 +97,15 @@
97
97
  // ---------- 主流程 ----------
98
98
 
99
99
  async function boot() {
100
+ // 版本号来自 page/version.js(由 scripts/stamp.mjs 按 package.json 生成)
101
+ const ver = self.NEARTOKEN_VERSION
102
+ if (ver) {
103
+ const chip = document.getElementById('version')
104
+ if (chip) {
105
+ chip.textContent = 'v' + ver
106
+ chip.title = '插件版本 ' + ver
107
+ }
108
+ }
100
109
  // 预览用:?tab=market 可直接落在某个视角,生产里没这个参数就是原本界面
101
110
  const want = new URLSearchParams(location.search).get('tab')
102
111
  if (want === 'market' || want === 'logs' || want === 'home') tab = want
package/page/index.html CHANGED
@@ -14,6 +14,8 @@
14
14
  <h1>NearToken</h1>
15
15
  <p class="sub" id="site">neartoken.cc</p>
16
16
  </div>
17
+ <span class="chip ver" id="version" title="插件版本">v—</span>
18
+ <a class="ghost link" id="updates" href="https://github.com/Fish-under-sea/magpie-neartoken/releases" target="_blank" rel="noreferrer">检查更新</a>
17
19
  <span class="chip" id="status"><span class="dot"></span><span id="status-text">正在读取</span></span>
18
20
  <button class="ghost" id="disconnect" hidden>断开连接</button>
19
21
  </header>
@@ -22,6 +24,7 @@
22
24
  </main>
23
25
  </div>
24
26
  <script src="_magpie/bridge.js"></script>
27
+ <script src="version.js"></script>
25
28
  <script src="app.js"></script>
26
29
  </body>
27
30
  </html>
package/page/style.css CHANGED
@@ -447,4 +447,14 @@ select {
447
447
 
448
448
  .log-row.head { color: var(--nt-muted); font-size: 11px; border-bottom-color: transparent; }
449
449
  .log-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
450
- .log-row .num { text-align: right; font-family: var(--nt-code); font-variant-numeric: tabular-nums; color: var(--nt-muted); }
450
+ .log-row .num { text-align: right; font-family: var(--nt-code); font-variant-numeric: tabular-nums; color: var(--nt-muted); }
451
+ /* 版本号与更新入口 */
452
+ .chip.ver {
453
+ font-family: var(--nt-code);
454
+ font-size: 10.5px;
455
+ letter-spacing: 0.02em;
456
+ color: var(--nt-muted);
457
+ padding: 3px 8px;
458
+ }
459
+
460
+ .ghost.link { text-decoration: none; display: inline-flex; align-items: center; }
@@ -0,0 +1,2 @@
1
+ // 由 scripts/stamp.mjs 生成,别手改:版本号在 package.json。
2
+ self.NEARTOKEN_VERSION = "0.2.1"