jskelet 0.2.2 → 0.2.3

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.
@@ -19,7 +19,8 @@
19
19
  --line: #23272f;
20
20
  --text: #e7e9ee;
21
21
  --muted: #8b93a1;
22
- --accent: #6ea8fe;
22
+ /* Pazarlama sitesiyle aynı vurgu: cyan. */
23
+ --accent: #22d3ee;
23
24
  --ok: #4ade80;
24
25
  --warn: #fbbf24;
25
26
  --bad: #f87171;
@@ -33,6 +34,8 @@ body {
33
34
  }
34
35
 
35
36
  body {
37
+ display: flex;
38
+ flex-direction: column;
36
39
  min-height: 100vh;
37
40
  background:
38
41
  radial-gradient(1200px 600px at 20% -10%, #16202f 0%, transparent 60%),
@@ -78,6 +81,10 @@ a {
78
81
  box-shadow: 0 24px 60px rgb(0 0 0 / 45%);
79
82
  }
80
83
 
84
+ .login .brand {
85
+ margin-bottom: 16px;
86
+ }
87
+
81
88
  .login h1 {
82
89
  margin: 0 0 6px;
83
90
  font-size: 18px;
@@ -134,14 +141,120 @@ header {
134
141
  z-index: 5;
135
142
  }
136
143
 
137
- header h1 {
138
- margin: 0;
144
+ header .spacer {
145
+ flex: 1;
146
+ }
147
+
148
+ /* ------------------------------------------------------------------ marka */
149
+
150
+ .brand {
151
+ display: flex;
152
+ gap: 9px;
153
+ align-items: center;
154
+ }
155
+
156
+ .brand img,
157
+ .foot-brand img {
158
+ object-fit: contain;
159
+ }
160
+
161
+ .wordmark {
139
162
  font-size: 15px;
140
- font-weight: 600;
163
+ font-weight: 700;
164
+ letter-spacing: -0.03em;
141
165
  }
142
166
 
143
- header .spacer {
144
- flex: 1;
167
+ .badge {
168
+ padding: 2px 8px;
169
+ border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--line));
170
+ border-radius: 999px;
171
+ background: color-mix(in oklab, var(--accent) 12%, transparent);
172
+ color: color-mix(in oklab, var(--accent) 85%, var(--text));
173
+ font-family: ui-monospace, monospace;
174
+ font-size: 11px;
175
+ font-weight: 700;
176
+ }
177
+
178
+ .crumbs {
179
+ display: flex;
180
+ gap: 8px;
181
+ align-items: center;
182
+ padding-left: 12px;
183
+ border-left: 1px solid var(--line);
184
+ color: var(--text);
185
+ font-size: 13px;
186
+ }
187
+
188
+ /* ------------------------------------------------------------------ footer */
189
+
190
+ footer {
191
+ display: flex;
192
+ flex-wrap: wrap;
193
+ gap: 12px 20px;
194
+ align-items: center;
195
+ justify-content: space-between;
196
+ margin-top: auto;
197
+ padding: 18px 20px;
198
+ border-top: 1px solid var(--line);
199
+ background: rgb(18 20 26 / 60%);
200
+ color: var(--muted);
201
+ font-size: 12px;
202
+ }
203
+
204
+ .foot-brand {
205
+ display: flex;
206
+ gap: 8px;
207
+ align-items: center;
208
+ }
209
+
210
+ .foot-brand .wordmark {
211
+ font-size: 13px;
212
+ }
213
+
214
+ .foot-links {
215
+ display: flex;
216
+ flex-wrap: wrap;
217
+ gap: 10px;
218
+ align-items: center;
219
+ }
220
+
221
+ .foot-links a {
222
+ color: var(--muted);
223
+ text-decoration: none;
224
+ }
225
+
226
+ .foot-links a:hover {
227
+ color: var(--accent);
228
+ text-decoration: underline;
229
+ }
230
+
231
+ .dot {
232
+ color: color-mix(in oklab, var(--line) 80%, var(--muted));
233
+ }
234
+
235
+ .live {
236
+ display: inline-flex;
237
+ gap: 7px;
238
+ align-items: center;
239
+ }
240
+
241
+ .pulse {
242
+ width: 7px;
243
+ height: 7px;
244
+ border-radius: 999px;
245
+ background: var(--ok);
246
+ box-shadow: 0 0 0 0 color-mix(in oklab, var(--ok) 60%, transparent);
247
+ animation: pulse 2.4s ease-out infinite;
248
+ }
249
+
250
+ @keyframes pulse {
251
+ 70% {
252
+ box-shadow: 0 0 0 6px transparent;
253
+ }
254
+
255
+ 100% {
256
+ box-shadow: 0 0 0 0 transparent;
257
+ }
145
258
  }
146
259
 
147
260
  .chip {
@@ -322,6 +435,157 @@ label.check {
322
435
  font-size: 12px;
323
436
  }
324
437
 
438
+ .m0 {
439
+ margin: 0;
440
+ }
441
+
442
+ /* ------------------------------------------------ anahtar/değer ve ölçüler */
443
+
444
+ .kv {
445
+ display: grid;
446
+ grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
447
+ gap: 10px 20px;
448
+ margin: 0;
449
+ }
450
+
451
+ .kv > div {
452
+ display: flex;
453
+ gap: 10px;
454
+ align-items: baseline;
455
+ justify-content: space-between;
456
+ padding-bottom: 7px;
457
+ border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
458
+ }
459
+
460
+ .kv dt {
461
+ color: var(--muted);
462
+ font-size: 12px;
463
+ }
464
+
465
+ .kv dd {
466
+ margin: 0;
467
+ font-family: ui-monospace, monospace;
468
+ font-size: 12.5px;
469
+ overflow-wrap: anywhere;
470
+ text-align: right;
471
+ }
472
+
473
+ .kv dd.on {
474
+ color: var(--ok);
475
+ }
476
+
477
+ .kv dd.off {
478
+ color: var(--muted);
479
+ }
480
+
481
+ .kv dd.bad {
482
+ color: var(--bad);
483
+ }
484
+
485
+ .meter + .meter {
486
+ margin-top: 16px;
487
+ }
488
+
489
+ .meter-head {
490
+ display: flex;
491
+ gap: 12px;
492
+ align-items: baseline;
493
+ justify-content: space-between;
494
+ margin-bottom: 7px;
495
+ font-size: 12.5px;
496
+ }
497
+
498
+ .meter-head span:first-child {
499
+ color: var(--muted);
500
+ }
501
+
502
+ .bar {
503
+ height: 8px;
504
+ border-radius: 999px;
505
+ background: #0d0f14;
506
+ overflow: hidden;
507
+ }
508
+
509
+ .bar > span {
510
+ display: block;
511
+ width: 0;
512
+ height: 100%;
513
+ border-radius: 999px;
514
+ background: linear-gradient(
515
+ 90deg,
516
+ color-mix(in oklab, var(--accent) 70%, transparent),
517
+ var(--accent)
518
+ );
519
+ transition: width 0.3s ease;
520
+ }
521
+
522
+ .bar > span.warn {
523
+ background: linear-gradient(90deg, color-mix(in oklab, var(--warn) 70%, transparent), var(--warn));
524
+ }
525
+
526
+ .bar > span.bad {
527
+ background: linear-gradient(90deg, color-mix(in oklab, var(--bad) 70%, transparent), var(--bad));
528
+ }
529
+
530
+ /* ------------------------------------------------------- analitik dökümü */
531
+
532
+ .report {
533
+ margin-top: 14px;
534
+ border: 1px solid var(--line);
535
+ border-radius: var(--radius);
536
+ overflow: hidden;
537
+ }
538
+
539
+ .report table {
540
+ font-size: 12px;
541
+ }
542
+
543
+ .report .note {
544
+ padding: 9px 12px;
545
+ border-top: 1px solid var(--line);
546
+ color: var(--muted);
547
+ font-size: 11.5px;
548
+ }
549
+
550
+ select {
551
+ padding: 8px 11px;
552
+ border: 1px solid var(--line);
553
+ border-radius: 8px;
554
+ background: #0d0f14;
555
+ color: var(--text);
556
+ font: inherit;
557
+ font-size: 12.5px;
558
+ }
559
+
560
+ /* --------------------------------------------------------------- öneri kutusu */
561
+
562
+ .suggest {
563
+ padding: 14px 16px;
564
+ border: 1px dashed color-mix(in oklab, var(--accent) 40%, var(--line));
565
+ border-radius: var(--radius);
566
+ background: color-mix(in oklab, var(--accent) 6%, transparent);
567
+ font-size: 12.5px;
568
+ line-height: 1.6;
569
+ }
570
+
571
+ .suggest pre {
572
+ margin: 12px 0 0;
573
+ padding: 10px 12px;
574
+ border: 1px solid var(--line);
575
+ border-radius: 8px;
576
+ background: #0d0f14;
577
+ overflow-x: auto;
578
+ font-size: 12px;
579
+ }
580
+
581
+ .suggest code {
582
+ color: color-mix(in oklab, var(--accent) 75%, var(--text));
583
+ }
584
+
585
+ .suggest .hint {
586
+ margin-top: 12px;
587
+ }
588
+
325
589
  /* -------------------------------------------------------------- sekme/tablo */
326
590
 
327
591
  .tabs {
@@ -380,6 +644,34 @@ td.key {
380
644
  overflow-wrap: anywhere;
381
645
  }
382
646
 
647
+ td.key a {
648
+ color: inherit;
649
+ text-decoration: none;
650
+ border-bottom: 1px dotted color-mix(in oklab, var(--accent) 55%, transparent);
651
+ }
652
+
653
+ td.key a:hover {
654
+ color: var(--accent);
655
+ border-bottom-color: var(--accent);
656
+ }
657
+
658
+ /* Kopyalanabilir anahtar: buton gibi davranır, metin gibi görünür. */
659
+ button.as-text {
660
+ padding: 0;
661
+ border: none;
662
+ border-bottom: 1px dotted transparent;
663
+ border-radius: 0;
664
+ background: none;
665
+ color: inherit;
666
+ font: inherit;
667
+ text-align: left;
668
+ }
669
+
670
+ button.as-text:hover:not(:disabled) {
671
+ color: var(--accent);
672
+ border-bottom-color: color-mix(in oklab, var(--accent) 55%, transparent);
673
+ }
674
+
383
675
  td.num {
384
676
  text-align: right;
385
677
  white-space: nowrap;
@@ -5,17 +5,29 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <meta name="robots" content="noindex, nofollow, noarchive, nosnippet" />
7
7
  <meta name="referrer" content="no-referrer" />
8
- <title>Cache</title>
8
+ <title>Cache · JSkelet</title>
9
+ <link rel="icon" href="logo.png" />
9
10
  <link rel="stylesheet" href="panel.css" />
10
11
  </head>
11
12
  <body>
12
13
  <header>
13
- <h1>Cache</h1>
14
+ <div class="brand">
15
+ <img src="logo.png" alt="" width="30" height="30" />
16
+ <span class="wordmark">JSkelet</span>
17
+ <span class="badge" id="version">—</span>
18
+ </div>
19
+
20
+ <nav class="crumbs" aria-label="Panel">
21
+ <span aria-current="page">Cache</span>
22
+ </nav>
23
+
24
+ <span class="spacer"></span>
25
+
14
26
  <span class="chip" id="env">—</span>
15
27
  <span class="chip" id="pid">—</span>
16
28
  <span class="chip" id="uptime">—</span>
17
29
  <span class="chip" id="memory">—</span>
18
- <span class="spacer"></span>
30
+
19
31
  <label class="check">
20
32
  <input type="checkbox" id="auto" checked />
21
33
  live
@@ -53,6 +65,149 @@
53
65
  </div>
54
66
  </div>
55
67
 
68
+ <section>
69
+ <h2>Shared tier <span class="count" id="redis-heading">—</span></h2>
70
+ <div class="body">
71
+ <dl class="kv" id="redis-kv"></dl>
72
+
73
+ <div class="row" id="redis-actions" hidden>
74
+ <button id="redis-inspect">Count keys in Redis</button>
75
+ <button class="danger" id="redis-html">Drop shared HTML keys</button>
76
+ <button class="danger" id="redis-data">Drop shared data keys</button>
77
+ </div>
78
+
79
+ <div class="suggest" id="redis-suggest" hidden>
80
+ <p class="m0">
81
+ <strong>No shared tier.</strong> Every entry above lives in this
82
+ process only, so each replica warms up on its own and an
83
+ invalidation reaches whichever replica received the request.
84
+ Adding Redis keeps the in-process cache primary and only does what
85
+ a single process cannot: serve HTML another replica already
86
+ rendered, and broadcast purges to all of them.
87
+ </p>
88
+ <pre><code>npm install ioredis</code></pre>
89
+ <pre><code>// jskelet.config.mjs
90
+ cache() {
91
+ return {
92
+ redis: { enabled: true, url: process.env.REDIS_URL },
93
+ };
94
+ }</code></pre>
95
+ <p class="hint m0">
96
+ Worth it from the second replica onwards. On a single instance the
97
+ gain is close to zero, which is why it is off by default.
98
+ </p>
99
+ </div>
100
+ </div>
101
+ </section>
102
+
103
+ <section>
104
+ <h2>
105
+ Cloudflare <span class="count" id="cf-heading">—</span>
106
+ <span class="tabs">
107
+ <button id="cf-refresh">Refresh</button>
108
+ </span>
109
+ </h2>
110
+ <div class="body">
111
+ <dl class="kv" id="cf-kv"></dl>
112
+
113
+ <div id="cf-tools" hidden>
114
+ <div class="row">
115
+ <button class="danger" id="cf-purge-all">Purge everything</button>
116
+ <button id="cf-purge-cached">Purge URLs cached here</button>
117
+ <label class="check">
118
+ <input type="checkbox" id="cf-dev" />
119
+ development mode (bypass cache for 3h)
120
+ </label>
121
+ </div>
122
+
123
+ <div class="row">
124
+ <select id="cf-kind">
125
+ <option value="prefixes">prefixes</option>
126
+ <option value="hosts">hosts</option>
127
+ <option value="tags">cache tags</option>
128
+ </select>
129
+ <input
130
+ class="grow"
131
+ type="text"
132
+ id="cf-values"
133
+ spellcheck="false"
134
+ placeholder="example.com/news · space or comma separated, 100 per request"
135
+ />
136
+ <button class="primary" id="cf-purge-keys">Purge</button>
137
+ </div>
138
+
139
+ <div class="row">
140
+ <button id="cf-tiered">Toggle Tiered Cache</button>
141
+ <button id="cf-reserve">Toggle Cache Reserve</button>
142
+ <button class="danger" id="cf-reserve-clear">Clear Cache Reserve</button>
143
+ </div>
144
+
145
+ <div class="row">
146
+ <input
147
+ class="grow"
148
+ type="text"
149
+ id="cf-path"
150
+ spellcheck="false"
151
+ placeholder="/news/some-post — which edges served this path (blank = whole zone)"
152
+ />
153
+ <button id="cf-analytics">Query analytics</button>
154
+ </div>
155
+
156
+ <div id="cf-report" class="report" hidden></div>
157
+
158
+ <p class="hint">
159
+ Cloudflare has no endpoint that lists which edges currently hold a
160
+ copy of a URL, and no way to warm a chosen edge from the origin —
161
+ an object only enters an edge cache through a real request routed
162
+ there. What you get above is observation: which colos served the
163
+ path from cache and which went to the origin. Warming is our
164
+ prewarm pass plus Tiered Cache or Cache Reserve behind it.
165
+ </p>
166
+ </div>
167
+
168
+ <div class="suggest" id="cf-suggest" hidden>
169
+ <p class="m0">
170
+ <strong>Cloudflare is not connected.</strong> The cache above is
171
+ the origin cache; the copy your visitors actually get is at the
172
+ edge. Connecting a zone lets a purge here reach both, and shows
173
+ the cache hit ratio that decides whether the origin cache is even
174
+ being asked.
175
+ </p>
176
+ <pre><code>JSKELET_CLOUDFLARE_KEY=your_api_token
177
+ JSKELET_CLOUDFLARE_ZONE_ID=your_zone_id</code></pre>
178
+ <p class="hint m0">
179
+ Token permissions: <code>Zone.Cache Purge</code> to purge,
180
+ <code>Zone.Zone Settings</code> to change settings,
181
+ <code>Zone.Analytics</code> (read) for the hit ratio. The token is
182
+ read from the environment and never leaves the server.
183
+ </p>
184
+ </div>
185
+ </div>
186
+ </section>
187
+
188
+ <section>
189
+ <h2>Host <span class="count" id="host-heading">—</span></h2>
190
+ <div class="body">
191
+ <div class="meter">
192
+ <div class="meter-head">
193
+ <span>Memory</span>
194
+ <span class="mono" id="ram-text">—</span>
195
+ </div>
196
+ <div class="bar"><span id="ram-bar"></span></div>
197
+ <p class="hint m0" id="ram-note">—</p>
198
+ </div>
199
+
200
+ <div class="meter">
201
+ <div class="meter-head">
202
+ <span>Disk</span>
203
+ <span class="mono" id="disk-text">—</span>
204
+ </div>
205
+ <div class="bar"><span id="disk-bar"></span></div>
206
+ <p class="hint m0" id="disk-note">—</p>
207
+ </div>
208
+ </div>
209
+ </section>
210
+
56
211
  <section>
57
212
  <h2>Actions</h2>
58
213
  <div class="body">
@@ -85,8 +240,6 @@
85
240
 
86
241
  <div class="row">
87
242
  <button id="prewarm">Prewarm all paths</button>
88
- <button id="redis-html">Drop shared HTML keys</button>
89
- <button id="redis-data">Drop shared data keys</button>
90
243
  </div>
91
244
 
92
245
  <p class="hint">
@@ -127,6 +280,27 @@
127
280
  </section>
128
281
  </main>
129
282
 
283
+ <footer>
284
+ <div class="foot-brand">
285
+ <img src="logo.png" alt="" width="24" height="24" />
286
+ <span class="wordmark">JSkelet</span>
287
+ <span class="mono" id="foot-release">—</span>
288
+ </div>
289
+
290
+ <div class="foot-links">
291
+ <a id="foot-repo" href="https://github.com/ayberkenis/jskelet" rel="noreferrer noopener">
292
+ GitHub
293
+ </a>
294
+ <span class="dot" aria-hidden="true">·</span>
295
+ <span>Cache panel</span>
296
+ <span class="dot" aria-hidden="true">·</span>
297
+ <span class="live">
298
+ <span class="pulse"></span>
299
+ Password rotates on restart
300
+ </span>
301
+ </div>
302
+ </footer>
303
+
130
304
  <div id="toast"></div>
131
305
  <script type="module" src="panel.js"></script>
132
306
  </body>