@juejin-opensource/jusage 0.1.6-beta.0 → 0.1.6
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/LICENSE +21 -0
- package/dist/dashboard/assets/{ChevronDown-raqOGGZY.js → ChevronDown-hI5eRGzD.js} +1 -1
- package/dist/dashboard/assets/{dashboard-2aS4UXAq.js → dashboard-CAkIFa6U.js} +1 -1
- package/dist/dashboard/assets/{download-w1_SlsVA.js → download-ByMnRiaK.js} +1 -1
- package/dist/dashboard/assets/{downloads-DRt36RTZ.js → downloads-C3JkgIXC.js} +1 -1
- package/dist/dashboard/assets/{env-Bahc-RuR.js → env-Cw7aSECu.js} +1 -1
- package/dist/dashboard/assets/{index-DpG68XJd.js → index-C-ulpYDE.js} +30 -30
- package/dist/dashboard/assets/{index-C28OANM4.js → index-CeqvL8Jz.js} +1 -1
- package/dist/dashboard/assets/{index-I_ub2jqy.css → index-CmpX7J2H.css} +1 -1
- package/dist/dashboard/assets/{pricing-C1AgdgdM.js → pricing-J0aEt4op.js} +1 -1
- package/dist/dashboard/assets/{rank-DNpmekT1.js → rank-DNcLrJpg.js} +1 -1
- package/dist/dashboard/assets/{settings-BA_UlPf3.js → settings-Cud6Sr27.js} +1 -1
- package/dist/dashboard/index.html +2 -2
- package/dist/service-linux.js +6 -1
- package/package.json +13 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as F,r as u,j as e,M as R,B as S,A as ne,C as ce,Q as de,a as ue,b as me,e as _e,f as X,g as P,h as L,i as fe,T as A,P as B,k as C,u as Y,l as he,m as pe,D as G,n as xe,S as we,d as be,o as ge}from"./index-
|
|
1
|
+
import{c as F,r as u,j as e,M as R,B as S,A as ne,C as ce,Q as de,a as ue,b as me,e as _e,f as X,g as P,h as L,i as fe,T as A,P as B,k as C,u as Y,l as he,m as pe,D as G,n as xe,S as we,d as be,o as ge}from"./index-C-ulpYDE.js";import{C as U,T,a as ke,S as M,i as ve}from"./env-Cw7aSECu.js";import{S as b,a as v,L as Z,b as y}from"./index-CeqvL8Jz.js";import{L as ye,G as W}from"./downloads-C3JkgIXC.js";/**
|
|
2
2
|
* @license lucide-react v1.24.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,d as n}from"./index-
|
|
1
|
+
import{r as t,d as n}from"./index-C-ulpYDE.js";function e(){return t.useEffect(()=>{n()},[]),null}const s=e;export{s as component};
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>AI Usage Dashboard</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-C-ulpYDE.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CmpX7J2H.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/dist/service-linux.js
CHANGED
|
@@ -89,7 +89,10 @@ function assertSystemdUser() {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
export async function isLinuxAutostartRegistered() {
|
|
92
|
-
|
|
92
|
+
const unitPath = linuxUnitPath();
|
|
93
|
+
if (!existsSync(unitPath))
|
|
94
|
+
return false;
|
|
95
|
+
return runSystemctl(['is-enabled', '--quiet', `${LINUX_UNIT_NAME}.service`]).ok;
|
|
93
96
|
}
|
|
94
97
|
export async function registerLinuxAutostart(cliBinPath, dataDir) {
|
|
95
98
|
assertSystemdUser();
|
|
@@ -102,10 +105,12 @@ export async function registerLinuxAutostart(cliBinPath, dataDir) {
|
|
|
102
105
|
await writeFile(unitPath, buildLinuxUnit(nodePath, args, homedir(), daemonLogPath(dataDir)), 'utf8');
|
|
103
106
|
const reloaded = runSystemctl(['daemon-reload']);
|
|
104
107
|
if (!reloaded.ok) {
|
|
108
|
+
await unregisterLinuxAutostart();
|
|
105
109
|
throw new Error(`注册 Linux 自启失败(daemon-reload): ${reloaded.stderr || 'systemctl 返回非零'}`);
|
|
106
110
|
}
|
|
107
111
|
const enabled = runSystemctl(['enable', '--now', `${LINUX_UNIT_NAME}.service`]);
|
|
108
112
|
if (!enabled.ok) {
|
|
113
|
+
await unregisterLinuxAutostart();
|
|
109
114
|
throw new Error(`注册 Linux 自启失败: ${enabled.stderr || 'systemctl enable --now 返回非零'}`);
|
|
110
115
|
}
|
|
111
116
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juejin-opensource/jusage",
|
|
3
|
-
"version": "0.1.6
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Juejin AI Usage 统计 CLI:Token 用量明细追踪,本地记录、云端同步,内置用量看板。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,6 +33,17 @@
|
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@juejin-opensource/jusage-core": "0.1.6"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^22.13.10",
|
|
41
|
+
"typescript": "^5.8.2",
|
|
42
|
+
"@juejin-opensource/jusage-dashboard": "0.1.5"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=20"
|
|
46
|
+
},
|
|
36
47
|
"scripts": {
|
|
37
48
|
"build": "tsc -p tsconfig.json && node ./scripts/copy-dashboard.mjs",
|
|
38
49
|
"start": "node ./bin/jusage.js start",
|
|
@@ -41,16 +52,5 @@
|
|
|
41
52
|
"upload": "node ./bin/jusage.js upload",
|
|
42
53
|
"service": "node ./bin/jusage.js service",
|
|
43
54
|
"test": "tsc -p tsconfig.json && node --test \"test/**/*.test.js\""
|
|
44
|
-
},
|
|
45
|
-
"dependencies": {
|
|
46
|
-
"@juejin-opensource/jusage-core": "0.1.5"
|
|
47
|
-
},
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"@juejin-opensource/jusage-dashboard": "workspace:*",
|
|
50
|
-
"@types/node": "^22.13.10",
|
|
51
|
-
"typescript": "^5.8.2"
|
|
52
|
-
},
|
|
53
|
-
"engines": {
|
|
54
|
-
"node": ">=20"
|
|
55
55
|
}
|
|
56
|
-
}
|
|
56
|
+
}
|