claude-codex-proxy 1.0.5-beta.4 → 1.0.5-beta.5
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/package.json +1 -1
- package/public/css/style.css +127 -0
- package/public/views/client-api-keys.html +54 -39
package/package.json
CHANGED
package/public/css/style.css
CHANGED
|
@@ -396,6 +396,133 @@ table .btn-outline:hover {
|
|
|
396
396
|
color: white;
|
|
397
397
|
}
|
|
398
398
|
|
|
399
|
+
.client-keys-panel {
|
|
400
|
+
overflow: hidden;
|
|
401
|
+
border: 1px solid rgba(42, 42, 62, 0.72);
|
|
402
|
+
border-radius: 0.875rem;
|
|
403
|
+
background: rgba(12, 12, 20, 0.72);
|
|
404
|
+
box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.client-keys-toolbar {
|
|
408
|
+
display: flex;
|
|
409
|
+
align-items: center;
|
|
410
|
+
justify-content: space-between;
|
|
411
|
+
gap: 1.5rem;
|
|
412
|
+
padding: 1.25rem 1.5rem;
|
|
413
|
+
border-bottom: 1px solid rgba(42, 42, 62, 0.55);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.client-keys-toolbar h2 { color: #f8fafc; font-size: 0.9375rem; font-weight: 600; }
|
|
417
|
+
.client-keys-toolbar p { margin-top: 0.25rem; color: #64748b; font-size: 0.75rem; }
|
|
418
|
+
.client-keys-toolbar-actions { display: flex; align-items: center; gap: 1rem; }
|
|
419
|
+
|
|
420
|
+
.client-keys-reset { display: flex; align-items: center; gap: 0.625rem; color: #64748b; }
|
|
421
|
+
.client-keys-reset svg { width: 1rem; height: 1rem; color: #8b5cf6; }
|
|
422
|
+
.client-keys-reset div { display: flex; flex-direction: column; gap: 0.125rem; }
|
|
423
|
+
.client-keys-reset span { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
|
|
424
|
+
.client-keys-reset strong { color: #a1a1aa; font-family: 'JetBrains Mono', monospace; font-size: 0.6875rem; font-weight: 500; }
|
|
425
|
+
|
|
426
|
+
.client-keys-new {
|
|
427
|
+
display: inline-flex;
|
|
428
|
+
align-items: center;
|
|
429
|
+
gap: 0.5rem;
|
|
430
|
+
padding: 0.55rem 0.9rem;
|
|
431
|
+
border: 1px solid rgba(168, 85, 247, 0.65);
|
|
432
|
+
border-radius: 0.5rem;
|
|
433
|
+
background: linear-gradient(135deg, #9333ea, #7c3aed);
|
|
434
|
+
box-shadow: 0 8px 20px rgba(126, 34, 206, 0.22);
|
|
435
|
+
color: #fff;
|
|
436
|
+
font-size: 0.75rem;
|
|
437
|
+
font-weight: 600;
|
|
438
|
+
cursor: pointer;
|
|
439
|
+
}
|
|
440
|
+
.client-keys-new:hover { background: linear-gradient(135deg, #a855f7, #8b5cf6); }
|
|
441
|
+
.client-keys-new span { font-size: 1rem; font-weight: 400; line-height: 1; }
|
|
442
|
+
|
|
443
|
+
.client-keys-list { padding: 0.75rem; }
|
|
444
|
+
.client-key-card {
|
|
445
|
+
display: grid;
|
|
446
|
+
grid-template-columns: minmax(270px, 1.45fr) minmax(230px, 1.15fr) 130px 110px auto;
|
|
447
|
+
align-items: center;
|
|
448
|
+
gap: 1.5rem;
|
|
449
|
+
padding: 1.1rem 1rem;
|
|
450
|
+
border: 1px solid transparent;
|
|
451
|
+
border-radius: 0.7rem;
|
|
452
|
+
transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
|
|
453
|
+
}
|
|
454
|
+
.client-key-card + .client-key-card { margin-top: 0.375rem; }
|
|
455
|
+
.client-key-card:hover {
|
|
456
|
+
border-color: rgba(42, 42, 62, 0.72);
|
|
457
|
+
background: rgba(26, 26, 40, 0.48);
|
|
458
|
+
box-shadow: inset 3px 0 0 rgba(168, 85, 247, 0.72);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.client-key-identity { display: flex; align-items: center; gap: 0.875rem; min-width: 0; }
|
|
462
|
+
.client-key-icon { display: grid; width: 2.4rem; height: 2.4rem; flex: 0 0 auto; place-items: center; border: 1px solid rgba(168, 85, 247, 0.2); border-radius: 0.65rem; background: rgba(168, 85, 247, 0.08); color: #c084fc; }
|
|
463
|
+
.client-key-icon svg { width: 1.15rem; height: 1.15rem; }
|
|
464
|
+
.client-key-fields { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(100px, 0.85fr); gap: 0.625rem; min-width: 0; }
|
|
465
|
+
.client-key-fields label, .client-key-limit { display: block; min-width: 0; }
|
|
466
|
+
.client-key-fields label > span, .client-key-limit > span, .client-key-meta > span, .client-key-quota-heading > span { display: block; margin-bottom: 0.35rem; color: #64748b; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }
|
|
467
|
+
.client-key-fields input, .client-key-limit input {
|
|
468
|
+
width: 100%;
|
|
469
|
+
height: 2.15rem;
|
|
470
|
+
border: 1px solid rgba(42, 42, 62, 0.75);
|
|
471
|
+
border-radius: 0.45rem;
|
|
472
|
+
outline: none;
|
|
473
|
+
background: rgba(15, 15, 26, 0.62);
|
|
474
|
+
color: #e5e7eb;
|
|
475
|
+
font-size: 0.75rem;
|
|
476
|
+
transition: border-color 150ms ease, background-color 150ms ease;
|
|
477
|
+
}
|
|
478
|
+
.client-key-fields input { padding: 0 0.7rem; }
|
|
479
|
+
.client-key-fields input:focus, .client-key-limit input:focus { border-color: rgba(168, 85, 247, 0.72); background: rgba(26, 26, 40, 0.9); }
|
|
480
|
+
|
|
481
|
+
.client-key-quota-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
|
|
482
|
+
.client-key-quota-heading strong { color: #f8fafc; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
|
|
483
|
+
.client-key-quota-heading small { color: #64748b; font-size: 0.6875rem; font-weight: 400; }
|
|
484
|
+
.client-key-progress { overflow: hidden; height: 0.35rem; border-radius: 999px; background: rgba(42, 42, 62, 0.72); }
|
|
485
|
+
.client-key-progress i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, #22d3ee); box-shadow: 0 0 10px rgba(34, 211, 238, 0.25); }
|
|
486
|
+
.client-key-quota-foot { display: flex; justify-content: space-between; margin-top: 0.4rem; color: #64748b; font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; }
|
|
487
|
+
|
|
488
|
+
.client-key-limit > div { display: flex; height: 2.15rem; border: 1px solid rgba(42, 42, 62, 0.75); border-radius: 0.45rem; background: rgba(15, 15, 26, 0.62); }
|
|
489
|
+
.client-key-limit b { display: grid; width: 1.9rem; place-items: center; border-right: 1px solid rgba(42, 42, 62, 0.75); color: #64748b; font-size: 0.75rem; font-weight: 500; }
|
|
490
|
+
.client-key-limit input { height: auto; padding: 0 0.55rem; border: 0; background: transparent; font-family: 'JetBrains Mono', monospace; }
|
|
491
|
+
|
|
492
|
+
.client-key-meta strong, .client-key-meta small { display: block; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
|
|
493
|
+
.client-key-meta strong { color: #a1a1aa; font-size: 0.6875rem; font-weight: 500; }
|
|
494
|
+
.client-key-meta small { margin-top: 0.2rem; color: #52525b; font-size: 0.625rem; }
|
|
495
|
+
.client-key-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.45rem; }
|
|
496
|
+
.client-key-save, .client-key-delete { height: 2.15rem; border-radius: 0.45rem; cursor: pointer; transition: all 150ms ease; }
|
|
497
|
+
.client-key-save { padding: 0 0.75rem; border: 1px solid rgba(168, 85, 247, 0.35); background: rgba(168, 85, 247, 0.1); color: #d8b4fe; font-size: 0.6875rem; font-weight: 600; white-space: nowrap; }
|
|
498
|
+
.client-key-save:hover { border-color: rgba(168, 85, 247, 0.65); background: rgba(168, 85, 247, 0.2); color: #fff; }
|
|
499
|
+
.client-key-delete { display: grid; width: 2.15rem; place-items: center; border: 1px solid transparent; background: transparent; color: #52525b; }
|
|
500
|
+
.client-key-delete svg { width: 1rem; height: 1rem; }
|
|
501
|
+
.client-key-delete:hover { border-color: rgba(239, 68, 68, 0.2); background: rgba(239, 68, 68, 0.08); color: #f87171; }
|
|
502
|
+
.client-key-save:disabled, .client-key-delete:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
503
|
+
.client-keys-empty { padding: 4rem 1.5rem; color: #64748b; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; text-align: center; }
|
|
504
|
+
|
|
505
|
+
@media (max-width: 1100px) {
|
|
506
|
+
.client-key-card { grid-template-columns: minmax(260px, 1.3fr) minmax(220px, 1fr) 120px auto; }
|
|
507
|
+
.client-key-meta { display: none; }
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
@media (max-width: 800px) {
|
|
511
|
+
.client-keys-toolbar { align-items: flex-start; }
|
|
512
|
+
.client-keys-toolbar-actions { align-items: flex-end; flex-direction: column-reverse; }
|
|
513
|
+
.client-key-card { grid-template-columns: 1fr; gap: 1rem; }
|
|
514
|
+
.client-key-fields { width: 100%; }
|
|
515
|
+
.client-key-actions { justify-content: flex-start; }
|
|
516
|
+
.client-key-save { flex: 1; }
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
@media (max-width: 560px) {
|
|
520
|
+
.client-keys-toolbar { flex-direction: column; }
|
|
521
|
+
.client-keys-toolbar-actions { width: 100%; align-items: stretch; }
|
|
522
|
+
.client-keys-new { justify-content: center; }
|
|
523
|
+
.client-key-fields { grid-template-columns: 1fr; }
|
|
524
|
+
}
|
|
525
|
+
|
|
399
526
|
.animate-spin {
|
|
400
527
|
animation: spin 1s linear infinite;
|
|
401
528
|
}
|
|
@@ -8,47 +8,62 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
|
-
<div class="
|
|
12
|
-
<div class="
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</
|
|
11
|
+
<div class="client-keys-panel">
|
|
12
|
+
<div class="client-keys-toolbar">
|
|
13
|
+
<div>
|
|
14
|
+
<h2>Access keys</h2>
|
|
15
|
+
<p>Edit a key, then save its changes.</p>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="client-keys-toolbar-actions">
|
|
18
|
+
<div x-show="clientApiKeys.length" class="client-keys-reset">
|
|
19
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M12 8v4l2.5 2.5M21 12a9 9 0 11-2.64-6.36M21 4v5h-5"/></svg>
|
|
20
|
+
<div><span>Next weekly reset</span><strong x-text="clientApiKeys[0]?.quota?.nextPeriodStart ? new Date(clientApiKeys[0].quota.nextPeriodStart).toLocaleString() : '-'"></strong></div>
|
|
21
|
+
</div>
|
|
22
|
+
<button class="client-keys-new" @click="revealedClientApiKey = ''; clientProxyConfig = null; showCreateClientApiKeyModal = true">
|
|
23
|
+
<span>+</span> New API Key
|
|
24
|
+
</button>
|
|
25
|
+
</div>
|
|
17
26
|
</div>
|
|
27
|
+
|
|
18
28
|
<template x-if="clientApiKeysLoading">
|
|
19
|
-
<div class="
|
|
29
|
+
<div class="client-keys-empty">Loading client API keys...</div>
|
|
20
30
|
</template>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
31
|
+
|
|
32
|
+
<div class="client-keys-list" x-show="!clientApiKeysLoading && clientApiKeys.length">
|
|
33
|
+
<template x-for="clientApiKey in clientApiKeys" :key="clientApiKey.id">
|
|
34
|
+
<article class="client-key-card">
|
|
35
|
+
<div class="client-key-identity">
|
|
36
|
+
<div class="client-key-icon">
|
|
37
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M15 7a5 5 0 11-9.6 2H3v4h3v3h3v-3h2.4A5 5 0 0115 7z"/></svg>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="client-key-fields">
|
|
40
|
+
<label><span>Client name</span><input type="text" x-model="clientApiKey.name" placeholder="Unnamed"></label>
|
|
41
|
+
<label><span>Remark</span><input type="text" x-model="clientApiKey.remark" placeholder="No remark"></label>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div class="client-key-quota">
|
|
46
|
+
<div class="client-key-quota-heading">
|
|
47
|
+
<span>Weekly usage</span>
|
|
48
|
+
<strong><span x-text="`$${(clientApiKey.quota?.consumedUsd ?? 0).toFixed(2)}`"></span><small x-text="` / $${Number(clientApiKey.weeklyLimitUsd || 0).toFixed(2)}`"></small></strong>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="client-key-progress"><i :style="`width: ${Math.min(100, Math.max(0, ((clientApiKey.quota?.consumedUsd ?? 0) / Math.max(Number(clientApiKey.weeklyLimitUsd) || 0, 0.000001)) * 100))}%`"></i></div>
|
|
51
|
+
<div class="client-key-quota-foot"><span x-text="`$${(clientApiKey.quota?.remainingUsd ?? (Number(clientApiKey.weeklyLimitUsd) || 0)).toFixed(2)} remaining`"></span><span x-text="`${Math.min(100, Math.max(0, ((clientApiKey.quota?.consumedUsd ?? 0) / Math.max(Number(clientApiKey.weeklyLimitUsd) || 0, 0.000001)) * 100)).toFixed(1)}% used`"></span></div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<label class="client-key-limit"><span>Weekly limit</span><div><b>$</b><input type="number" min="0" step="0.01" x-model="clientApiKey.weeklyLimitUsd"></div></label>
|
|
55
|
+
|
|
56
|
+
<div class="client-key-meta"><span>Created</span><strong x-text="new Date(clientApiKey.createdAt).toLocaleDateString()"></strong><small x-text="new Date(clientApiKey.createdAt).toLocaleTimeString()"></small></div>
|
|
57
|
+
|
|
58
|
+
<div class="client-key-actions">
|
|
59
|
+
<button class="client-key-save" @click="updateClientApiKey(clientApiKey)" :disabled="clientApiKeySaving">Save changes</button>
|
|
60
|
+
<button class="client-key-delete" @click="deleteClientApiKey(clientApiKey)" :disabled="clientApiKeySaving" aria-label="Delete API key" title="Delete">
|
|
61
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M4 7h16M9 7V4h6v3m-8 0 1 13h8l1-13M10 11v5m4-5v5"/></svg>
|
|
62
|
+
</button>
|
|
63
|
+
</div>
|
|
64
|
+
</article>
|
|
65
|
+
</template>
|
|
66
|
+
</div>
|
|
67
|
+
<div x-show="!clientApiKeysLoading && !clientApiKeys.length" class="client-keys-empty">No client API keys. Create one to connect Claude Code clients.</div>
|
|
53
68
|
</div>
|
|
54
69
|
</div>
|