glad-web 1.0.9 → 1.0.11

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.
@@ -385,7 +385,14 @@ async function webCommand(options) {
385
385
  });
386
386
 
387
387
  // Frontend routes
388
- const logoPath = path.resolve(__dirname, '../../assets/logo.svg');
388
+ const assetsDir = path.resolve(__dirname, '../../assets');
389
+ const webDir = path.join(__dirname, '../web');
390
+
391
+ const sendLogo = (req, res) => {
392
+ res.sendFile('logo.svg', { root: assetsDir }, error => {
393
+ if (error && !res.headersSent) res.status(404).send('Not found');
394
+ });
395
+ };
389
396
 
390
397
  app.get('/', (req, res) => {
391
398
  try {
@@ -397,37 +404,29 @@ async function webCommand(options) {
397
404
  }
398
405
  });
399
406
 
400
- app.get('/gitgraph.js', (req, res) => {
401
- try {
402
- res.sendFile(path.join(__dirname, '../web/gitgraph.js'));
403
- } catch (e) {
404
- res.status(404).send('Not found');
405
- }
406
- });
407
-
408
- app.get('/logo.svg', (req, res) => {
409
- res.sendFile(logoPath, error => {
407
+ app.get(['/gitgraph.js', /.*\/gitgraph\.js$/], (req, res) => {
408
+ res.sendFile('gitgraph.js', { root: webDir }, error => {
410
409
  if (error && !res.headersSent) res.status(404).send('Not found');
411
410
  });
412
411
  });
413
412
 
414
- app.get('/favicon.ico', (req, res) => {
413
+ app.get(['/logo.svg', /.*\/logo\.svg$/], sendLogo);
414
+
415
+ app.get(['/favicon.ico', /.*\/favicon\.ico$/], (req, res) => {
415
416
  res.type('image/svg+xml');
416
- res.sendFile(logoPath, error => {
417
- if (error && !res.headersSent) res.status(404).send('Not found');
418
- });
417
+ sendLogo(req, res);
419
418
  });
420
419
 
421
- app.get('/manifest.json', (req, res) => res.json({
420
+ app.get(['/manifest.json', /.*\/manifest\.json$/], (req, res) => res.json({
422
421
  name: "Glad Web",
423
422
  short_name: "Glad",
424
- start_url: "/",
423
+ start_url: ".",
425
424
  display: "standalone",
426
425
  background_color: "#000000",
427
426
  theme_color: "#007aff",
428
427
  icons: [
429
428
  {
430
- src: "/logo.svg",
429
+ src: "logo.svg",
431
430
  sizes: "any",
432
431
  type: "image/svg+xml"
433
432
  }
@@ -5,9 +5,9 @@
5
5
  <title>Glad - AI Sessions</title>
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
7
7
  <meta name="apple-mobile-web-app-capable" content="yes">
8
- <link rel="manifest" href="/manifest.json">
9
- <link rel="icon" type="image/svg+xml" href="/logo.svg">
10
- <link rel="apple-touch-icon" href="/logo.svg">
8
+ <link rel="manifest" href="manifest.json">
9
+ <link rel="icon" type="image/svg+xml" href="logo.svg">
10
+ <link rel="apple-touch-icon" href="logo.svg">
11
11
  <link rel="stylesheet" href="https://unpkg.com/xterm@5.3.0/css/xterm.css" />
12
12
  <style>
13
13
  :root { --primary: #007aff; --bg: #000; --card-bg: #1c1c1e; --text: #fff; --text-dim: #8e8e93; --terminal-controls-rest-height: 108px; }
@@ -119,7 +119,7 @@
119
119
  <div id="lobby-view" class="view active">
120
120
  <div id="lobby">
121
121
  <div class="header">
122
- <h1><img class="header-logo" src="/logo.svg" alt="">Glad</h1>
122
+ <h1><img class="header-logo" src="logo.svg" alt="">Glad</h1>
123
123
  <div style="display:flex; gap:6px;">
124
124
  <button class="btn-new" onclick="showToolModal()" title="New session"><span>+</span><span>Session</span></button>
125
125
  <button class="btn-new" onclick="showScheduleModal()" title="New scheduler"><span>+</span><span>Sched</span></button>
@@ -306,7 +306,7 @@
306
306
 
307
307
  <script defer src="https://unpkg.com/xterm@5.3.0/lib/xterm.js"></script>
308
308
  <script defer src="https://unpkg.com/xterm-addon-fit@0.8.0/lib/xterm-addon-fit.js"></script>
309
- <script src="/gitgraph.js"></script>
309
+ <script src="gitgraph.js"></script>
310
310
  <script>
311
311
  let currentSocket = null, term = null, fitAddon = null, activeSessionId = null, activeToolKey = null;
312
312
  let appConfig = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glad-web",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Glad transforms terminal-based AI coding tools into a polished, mobile-friendly local Web interface.",
5
5
  "main": "index.js",
6
6
  "bin": {