niuma-codex 0.0.1-beta.26 → 0.0.1-beta.28
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/dist/assets/pairing-web/settings.js +14 -6
- package/dist/cli.js +2057 -2031
- package/dist/managed-tauri.js +2095 -2069
- package/dist/managed.js +2082 -2056
- package/package.json +1 -1
- package/resources/lite-release.json +7 -7
- package/resources/niuma-daemon-arm64.tgz +0 -0
- package/resources/niuma-lite-arm64.dmg +0 -0
|
@@ -4,12 +4,20 @@ export function mountAutostartSettings(doc,win,request){
|
|
|
4
4
|
const bridge=win.niumaLoginItem;
|
|
5
5
|
const approvalMessage='请前往「系统设置 → 通用 → 登录项与扩展」,允许 Niuma Lite 登录时打开。返回后将自动检查状态。';
|
|
6
6
|
const errorMessage=(error,fallback)=>typeof error==='string'?error:error?.message||fallback;
|
|
7
|
-
//
|
|
7
|
+
// Lite 版本来自宿主;浏览器单独查询当前 daemon,不依赖自启动状态。
|
|
8
8
|
const about=$('app-about');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const hostVersion=typeof bridge?.version==='string'?bridge.version:'';
|
|
10
|
+
if(about&&hostVersion){about.hidden=false;$('app-version').textContent=hostVersion;}
|
|
11
|
+
async function loadVersion(){
|
|
12
|
+
if(!about||hostVersion)return;
|
|
13
|
+
try{
|
|
14
|
+
const response=await request('/api/v1/settings/version',{cache:'no-store'});
|
|
15
|
+
const payload=await response.json();
|
|
16
|
+
const version=response.ok&&payload.code===0&&typeof payload.data?.daemon_version==='string'?payload.data.daemon_version:'';
|
|
17
|
+
about.hidden=!version;
|
|
18
|
+
$('app-about-title').textContent='关于 Niuma daemon';
|
|
19
|
+
$('app-version').textContent=version;
|
|
20
|
+
}catch{about.hidden=true;}
|
|
13
21
|
}
|
|
14
22
|
// 只有应用 preload 提供登录项能力;普通浏览器继续使用 npm 设置接口。
|
|
15
23
|
if(bridge){
|
|
@@ -88,7 +96,7 @@ export function mountAutostartSettings(doc,win,request){
|
|
|
88
96
|
$('device-workspace').hidden=settings;
|
|
89
97
|
$('settings-toggle').setAttribute('aria-current',settings?'page':'false');
|
|
90
98
|
$('devices-nav').setAttribute('aria-current',settings?'false':'page');
|
|
91
|
-
stop();if(visible())void load();
|
|
99
|
+
stop();if(visible()){void loadVersion();void load();}
|
|
92
100
|
}
|
|
93
101
|
$('settings-toggle').onclick=()=>navigate(true);
|
|
94
102
|
$('devices-nav').onclick=()=>navigate(false);
|