dsh-plugin-system-status 0.1.0 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +4 -1
  2. package/client.js +22 -6
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # dsh-plugin-system-status
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/dsh-plugin-system-status.svg)](https://www.npmjs.com/package/dsh-plugin-system-status)
4
+ [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
5
+
3
6
  一个 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)插件:在对话页输入框下方常驻显示本机的 **CPU、内存、GPU、显存、GPU 温度** 实时读数,并从左侧栏进入 **历史曲线**(CPU、GPU、内存、显存、GPU 温度、各磁盘已用空间)。
4
7
 
5
- A DSH plugin (`dsh-plugin`) that shows live CPU / memory / GPU / VRAM / GPU temperature under the composer, with historical charts behind a left-sidebar entry.
8
+ A DSH plugin (`dsh-plugin`) that shows live CPU / memory / GPU / VRAM / GPU temperature under the composer, with historical charts behind a left-sidebar entry. Install it by name: `dsh-plugin-system-status`.
6
9
 
7
10
  <p align="center"><img src="icon.svg" width="96" height="96" alt="System status icon"></p>
8
11
 
package/client.js CHANGED
@@ -126,26 +126,42 @@ window.__ModuleLoader__.load({
126
126
  translate = null
127
127
  }
128
128
  }
129
- const activeIsChinese = () => {
129
+ const activeLanguage = () => {
130
130
  try {
131
- return String(locale?.getLocale?.().active ?? 'en').toLowerCase().startsWith('zh')
131
+ const active = locale?.getLocale?.().active
132
+ if (typeof active === 'string' && active !== '') return active
132
133
  } catch {
133
- return false
134
+ /* fall through to the browser language */
134
135
  }
136
+ try {
137
+ if (typeof navigator !== 'undefined' && typeof navigator.language === 'string') {
138
+ return navigator.language
139
+ }
140
+ } catch {
141
+ /* fall through to English */
142
+ }
143
+ return 'en'
135
144
  }
145
+ const isChinese = () => activeLanguage().toLowerCase().startsWith('zh')
136
146
  return {
137
147
  disposers,
138
148
  t(key) {
149
+ // Both inline dictionaries are complete, so the active language decides
150
+ // directly and a missing locale service only degrades to the browser
151
+ // language instead of silently forcing English.
152
+ const primary = isChinese() ? DICT.zh : DICT.en
153
+ const secondary = isChinese() ? DICT.en : DICT.zh
154
+ if (typeof primary[key] === 'string') return primary[key]
155
+ if (typeof secondary[key] === 'string') return secondary[key]
139
156
  if (translate !== null) {
140
157
  try {
141
158
  const value = translate(key)
142
159
  if (typeof value === 'string' && value !== '' && value !== key) return value
143
160
  } catch {
144
- /* fall through to the inline dictionary */
161
+ /* fall through to the key */
145
162
  }
146
163
  }
147
- const dict = activeIsChinese() ? DICT.zh : DICT.en
148
- return dict[key] ?? DICT.en[key] ?? key
164
+ return key
149
165
  },
150
166
  subscribe: typeof locale?.subscribe === 'function' ? (fn) => locale.subscribe(fn) : null,
151
167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-system-status",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Real-time and historical CPU, GPU, memory, disk and temperature status for the machine running DeepSeek Harness.",
5
5
  "license": "MIT",
6
6
  "author": "chenmohan123",