@zhangferry-dev/tokendash 1.6.0 → 1.6.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/dist/client/popover.html +4 -3
- package/dist/electron-server.cjs +29 -4
- package/dist/electron-server.cjs.map +2 -2
- package/dist/server/index.js +18 -3
- package/dist/server/routes/api.d.ts +6 -1
- package/dist/server/routes/api.js +11 -1
- package/electron/main.cjs +34 -8
- package/electron/npmSync.cjs +62 -0
- package/electron/serverReuse.cjs +59 -0
- package/electron/updateService.cjs +75 -3
- package/package.json +1 -1
- package/dist/server/ccusage.d.ts +0 -7
- package/dist/server/ccusage.js +0 -69
- package/electron/main.js +0 -291
- package/electron/trayBadge.js +0 -30
- package/resources/entitlements.mac.plist +0 -10
- package/resources/icon.png +0 -0
package/dist/client/popover.html
CHANGED
|
@@ -553,7 +553,8 @@
|
|
|
553
553
|
.drawer-overlay {
|
|
554
554
|
position: absolute;
|
|
555
555
|
inset: 0;
|
|
556
|
-
|
|
556
|
+
z-index: 20;
|
|
557
|
+
background: rgba(250, 252, 251, 0.96);
|
|
557
558
|
border: 1px solid rgba(255, 255, 255, 0.72);
|
|
558
559
|
border-radius: var(--radius-shell);
|
|
559
560
|
opacity: 0;
|
|
@@ -569,7 +570,7 @@
|
|
|
569
570
|
flex-direction: column;
|
|
570
571
|
padding: 0 24px;
|
|
571
572
|
border-radius: var(--radius-shell);
|
|
572
|
-
background: linear-gradient(180deg, rgba(250, 252, 251, 0.
|
|
573
|
+
background: linear-gradient(180deg, rgba(250, 252, 251, 0.98), rgba(244, 247, 245, 0.96));
|
|
573
574
|
border: none;
|
|
574
575
|
box-shadow: none;
|
|
575
576
|
transform: translateY(10px);
|
|
@@ -1246,7 +1247,7 @@
|
|
|
1246
1247
|
var label = document.createElement('span');
|
|
1247
1248
|
label.className = 'x-axis-label' + (shouldLabel ? '' : ' is-unlabeled');
|
|
1248
1249
|
label.style.gridColumn = String(entry.hour + 1);
|
|
1249
|
-
label.textContent = String(entry.hour).padStart(2, '0')
|
|
1250
|
+
label.textContent = String(entry.hour).padStart(2, '0');
|
|
1250
1251
|
xAxis.appendChild(label);
|
|
1251
1252
|
});
|
|
1252
1253
|
}
|
package/dist/electron-server.cjs
CHANGED
|
@@ -2103,7 +2103,17 @@ function getAgents(_req, res) {
|
|
|
2103
2103
|
res.status(500).json({ error: "Failed to detect agents", hint: message });
|
|
2104
2104
|
}
|
|
2105
2105
|
}
|
|
2106
|
-
function
|
|
2106
|
+
function getAppInfo(info) {
|
|
2107
|
+
return (req, res) => {
|
|
2108
|
+
const host = req.get("host");
|
|
2109
|
+
res.json({
|
|
2110
|
+
...info,
|
|
2111
|
+
dashboardUrl: host ? `${req.protocol}://${host}` : info.dashboardUrl
|
|
2112
|
+
});
|
|
2113
|
+
};
|
|
2114
|
+
}
|
|
2115
|
+
function registerApiRoutes(router, appInfo) {
|
|
2116
|
+
router.get("/app-info", getAppInfo(appInfo));
|
|
2107
2117
|
router.get("/agents", getAgents);
|
|
2108
2118
|
router.get("/daily", getDaily);
|
|
2109
2119
|
router.get("/monthly", getMonthly);
|
|
@@ -2122,11 +2132,22 @@ var CLI_USAGE = [
|
|
|
2122
2132
|
" tokendash --port <number> [--no-open]",
|
|
2123
2133
|
" tokendash --tray [--port <number>]"
|
|
2124
2134
|
].join("\n");
|
|
2135
|
+
var PACKAGE_NAME = "@zhangferry-dev/tokendash";
|
|
2125
2136
|
function getPackageVersion() {
|
|
2126
2137
|
const __filename = (0, import_node_url.fileURLToPath)(__esbuild_import_meta_url);
|
|
2127
2138
|
const __dirname = (0, import_node_path8.dirname)(__filename);
|
|
2128
|
-
const
|
|
2129
|
-
|
|
2139
|
+
const packageJsonPaths = [
|
|
2140
|
+
(0, import_node_path8.join)(__dirname, "..", "..", "package.json"),
|
|
2141
|
+
// dist/server/index.js
|
|
2142
|
+
(0, import_node_path8.join)(__dirname, "..", "package.json")
|
|
2143
|
+
// dist/electron-server.cjs
|
|
2144
|
+
];
|
|
2145
|
+
for (const packageJsonPath of packageJsonPaths) {
|
|
2146
|
+
if (!(0, import_node_fs8.existsSync)(packageJsonPath)) continue;
|
|
2147
|
+
const packageJson = JSON.parse((0, import_node_fs8.readFileSync)(packageJsonPath, "utf8"));
|
|
2148
|
+
if (packageJson.version) return packageJson.version;
|
|
2149
|
+
}
|
|
2150
|
+
return "unknown";
|
|
2130
2151
|
}
|
|
2131
2152
|
function exitWithCliError(message) {
|
|
2132
2153
|
console.error(message);
|
|
@@ -2234,7 +2255,11 @@ function resolveStaticAssetBaseDir(moduleUrl = __esbuild_import_meta_url, baseDi
|
|
|
2234
2255
|
function createApp(_port, baseDir) {
|
|
2235
2256
|
const app = (0, import_express.default)();
|
|
2236
2257
|
const router = import_express.default.Router();
|
|
2237
|
-
registerApiRoutes(router
|
|
2258
|
+
registerApiRoutes(router, {
|
|
2259
|
+
packageName: PACKAGE_NAME,
|
|
2260
|
+
version: getPackageVersion(),
|
|
2261
|
+
dashboardUrl: `http://localhost:${resolvePort(_port)}`
|
|
2262
|
+
});
|
|
2238
2263
|
app.use("/api", router);
|
|
2239
2264
|
const { baseDir: _baseDir, isProduction } = resolveStaticAssetBaseDir(__esbuild_import_meta_url, baseDir);
|
|
2240
2265
|
const popoverPath = isProduction ? (0, import_node_path8.join)(_baseDir, "client", "popover.html") : (0, import_node_path8.join)(_baseDir, "..", "..", "public", "popover.html");
|