feat(ui): polish scm agent views
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
32e65b8b43
commit
5a561690be
7 changed files with 2127 additions and 905 deletions
1620
pkg/api/ui/dist/core-scm.js
vendored
1620
pkg/api/ui/dist/core-scm.js
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -12,15 +12,23 @@
|
|||
}
|
||||
|
||||
body {
|
||||
font-family: system-ui, -apple-system, sans-serif;
|
||||
background: #f3f4f6;
|
||||
font-family:
|
||||
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
||||
sans-serif;
|
||||
background:
|
||||
radial-gradient(circle at top left, rgba(99, 102, 241, 0.15), transparent 24%),
|
||||
linear-gradient(180deg, #eef2ff 0%, #f8fafc 30%, #f3f4f6 100%);
|
||||
padding: 2rem;
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
colour: #111827;
|
||||
font-size: 1.65rem;
|
||||
margin: 0 auto 1.5rem;
|
||||
max-width: 960px;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.03em;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.demo-panel {
|
||||
|
|
@ -28,25 +36,31 @@
|
|||
max-width: 960px;
|
||||
margin: 0 auto;
|
||||
height: 80vh;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid rgba(226, 232, 240, 0.95);
|
||||
border-radius: 1rem;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
|
||||
background: rgba(255, 255, 255, 0.82);
|
||||
backdrop-filter: blur(18px);
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.125rem;
|
||||
margin: 2rem auto 1rem;
|
||||
max-width: 960px;
|
||||
colour: #374151;
|
||||
color: #374151;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.standalone {
|
||||
max-width: 960px;
|
||||
margin: 0 auto 2rem;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid rgba(226, 232, 240, 0.95);
|
||||
border-radius: 1rem;
|
||||
padding: 1rem;
|
||||
background: #fff;
|
||||
background: rgba(255, 255, 255, 0.82);
|
||||
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
|
||||
backdrop-filter: blur(18px);
|
||||
}
|
||||
</style>
|
||||
<script type="module" src="./src/index.ts"></script>
|
||||
|
|
|
|||
|
|
@ -29,28 +29,74 @@ export class ScmInstalled extends LitElement {
|
|||
static styles = css`
|
||||
:host {
|
||||
display: block;
|
||||
font-family: system-ui, -apple-system, sans-serif;
|
||||
font-family:
|
||||
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
||||
sans-serif;
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.shell {
|
||||
background: rgba(255, 255, 255, 0.84);
|
||||
border: 1px solid rgba(226, 232, 240, 0.95);
|
||||
border-radius: 1rem;
|
||||
padding: 1rem;
|
||||
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
.summary {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.75rem;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.summary-copy {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.summary-title {
|
||||
font-size: 1rem;
|
||||
font-weight: 800;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.summary-subtitle {
|
||||
font-size: 0.8125rem;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.item {
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 1rem;
|
||||
padding: 1rem;
|
||||
background: #fff;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
transition: box-shadow 0.15s;
|
||||
gap: 1rem;
|
||||
transition:
|
||||
transform 0.15s ease,
|
||||
box-shadow 0.15s ease,
|
||||
border-color 0.15s ease;
|
||||
}
|
||||
|
||||
.item:hover {
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
|
||||
border-color: #c7d2fe;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.item-info {
|
||||
|
|
@ -58,20 +104,58 @@ export class ScmInstalled extends LitElement {
|
|||
}
|
||||
|
||||
.item-name {
|
||||
font-weight: 600;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 800;
|
||||
font-size: 0.95rem;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.item-meta {
|
||||
font-size: 0.75rem;
|
||||
colour: #6b7280;
|
||||
margin-top: 0.25rem;
|
||||
color: #64748b;
|
||||
margin-top: 0.35rem;
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.item-code {
|
||||
font-family: monospace;
|
||||
color: #334155;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.item-repo,
|
||||
.item-entry {
|
||||
font-family: monospace;
|
||||
color: #475569;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.3rem;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
color: #166534;
|
||||
}
|
||||
|
||||
.badge::before {
|
||||
content: '';
|
||||
width: 0.45rem;
|
||||
height: 0.45rem;
|
||||
border-radius: 999px;
|
||||
background: #22c55e;
|
||||
}
|
||||
|
||||
.badge.unsigned {
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.badge.unsigned::before {
|
||||
background: #f59e0b;
|
||||
}
|
||||
|
||||
.item-actions {
|
||||
|
|
@ -80,21 +164,26 @@ export class ScmInstalled extends LitElement {
|
|||
}
|
||||
|
||||
button {
|
||||
padding: 0.375rem 0.75rem;
|
||||
border-radius: 0.375rem;
|
||||
padding: 0.45rem 0.85rem;
|
||||
border-radius: 0.75rem;
|
||||
font-size: 0.8125rem;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
font-weight: 700;
|
||||
transition:
|
||||
background 0.15s ease,
|
||||
transform 0.15s ease,
|
||||
box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
button.update {
|
||||
background: #fff;
|
||||
colour: #6366f1;
|
||||
color: #4338ca;
|
||||
border: 1px solid #6366f1;
|
||||
}
|
||||
|
||||
button.update:hover {
|
||||
background: #eef2ff;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
button.update:disabled {
|
||||
|
|
@ -104,35 +193,57 @@ export class ScmInstalled extends LitElement {
|
|||
|
||||
button.remove {
|
||||
background: #fff;
|
||||
colour: #dc2626;
|
||||
color: #dc2626;
|
||||
border: 1px solid #dc2626;
|
||||
}
|
||||
|
||||
button.remove:hover {
|
||||
background: #fef2f2;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.empty {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
colour: #9ca3af;
|
||||
color: #64748b;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.loading {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
colour: #6b7280;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.error {
|
||||
colour: #dc2626;
|
||||
color: #dc2626;
|
||||
padding: 0.75rem;
|
||||
background: #fef2f2;
|
||||
border-radius: 0.375rem;
|
||||
border: 1px solid #fecaca;
|
||||
border-radius: 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.shell {
|
||||
padding: 0.875rem;
|
||||
}
|
||||
|
||||
.summary,
|
||||
.item {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.item-actions {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
button {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@property({ attribute: 'api-url' }) apiUrl = '';
|
||||
|
|
@ -210,6 +321,20 @@ export class ScmInstalled extends LitElement {
|
|||
}
|
||||
|
||||
return html`
|
||||
<div class="shell">
|
||||
<div class="summary">
|
||||
<div class="summary-copy">
|
||||
<span class="summary-title">Installed providers</span>
|
||||
<span class="summary-subtitle">
|
||||
Review local modules, update them, or remove stale installs.
|
||||
</span>
|
||||
</div>
|
||||
<div class="summary-copy" style="text-align:right">
|
||||
<span class="summary-title">${this.modules.length}</span>
|
||||
<span class="summary-subtitle">Installed</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${this.error ? html`<div class="error">${this.error}</div>` : nothing}
|
||||
${this.modules.length === 0
|
||||
? html`<div class="empty">No providers installed.</div>`
|
||||
|
|
@ -225,6 +350,13 @@ export class ScmInstalled extends LitElement {
|
|||
<span>v${mod.version}</span>
|
||||
<span>Installed ${this.formatDate(mod.installed_at)}</span>
|
||||
</div>
|
||||
<div class="item-meta">
|
||||
<span class="item-repo">${mod.repo}</span>
|
||||
<span class="item-entry">entry: ${mod.entry_point}</span>
|
||||
</div>
|
||||
<div class="badge ${mod.sign_key ? '' : 'unsigned'}">
|
||||
${mod.sign_key ? 'Signed manifest' : 'Unsigned manifest'}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-actions">
|
||||
<button
|
||||
|
|
@ -243,6 +375,7 @@ export class ScmInstalled extends LitElement {
|
|||
)}
|
||||
</div>
|
||||
`}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,45 +29,82 @@ export class ScmManifest extends LitElement {
|
|||
static styles = css`
|
||||
:host {
|
||||
display: block;
|
||||
font-family: system-ui, -apple-system, sans-serif;
|
||||
font-family:
|
||||
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
||||
sans-serif;
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.manifest {
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid rgba(226, 232, 240, 0.95);
|
||||
border-radius: 1rem;
|
||||
padding: 1.25rem;
|
||||
background: #fff;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
|
||||
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.9rem;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.header-copy {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 0;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
font-size: 1.2rem;
|
||||
font-weight: 800;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.version {
|
||||
font-size: 0.75rem;
|
||||
padding: 0.125rem 0.5rem;
|
||||
background: #f3f4f6;
|
||||
border-radius: 1rem;
|
||||
colour: #6b7280;
|
||||
padding: 0.25rem 0.625rem;
|
||||
background: #eef2ff;
|
||||
border-radius: 999px;
|
||||
color: #4338ca;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.meta-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.meta-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
padding: 0.25rem 0.6rem;
|
||||
border-radius: 999px;
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 700;
|
||||
color: #475569;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.field {
|
||||
margin-bottom: 0.75rem;
|
||||
margin-bottom: 0.875rem;
|
||||
}
|
||||
|
||||
.field-label {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
colour: #6b7280;
|
||||
font-weight: 800;
|
||||
color: #64748b;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.025em;
|
||||
margin-bottom: 0.25rem;
|
||||
|
|
@ -75,14 +112,17 @@ export class ScmManifest extends LitElement {
|
|||
|
||||
.field-value {
|
||||
font-size: 0.875rem;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.code {
|
||||
font-family: monospace;
|
||||
font-size: 0.8125rem;
|
||||
background: #f9fafb;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 0.25rem;
|
||||
background: #f8fafc;
|
||||
padding: 0.35rem 0.55rem;
|
||||
border-radius: 0.45rem;
|
||||
border: 1px solid #e2e8f0;
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
.slots {
|
||||
|
|
@ -90,16 +130,20 @@ export class ScmManifest extends LitElement {
|
|||
grid-template-columns: auto 1fr;
|
||||
gap: 0.25rem 1rem;
|
||||
font-size: 0.8125rem;
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 0.75rem;
|
||||
padding: 0.75rem;
|
||||
}
|
||||
|
||||
.slot-key {
|
||||
font-weight: 600;
|
||||
colour: #374151;
|
||||
font-weight: 700;
|
||||
color: #334155;
|
||||
}
|
||||
|
||||
.slot-value {
|
||||
font-family: monospace;
|
||||
colour: #6b7280;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.permissions-grid {
|
||||
|
|
@ -109,15 +153,16 @@ export class ScmManifest extends LitElement {
|
|||
}
|
||||
|
||||
.perm-group {
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 0.375rem;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 0.75rem;
|
||||
padding: 0.5rem;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.perm-group-label {
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 700;
|
||||
colour: #6b7280;
|
||||
font-weight: 800;
|
||||
color: #64748b;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
|
@ -125,7 +170,8 @@ export class ScmManifest extends LitElement {
|
|||
.perm-item {
|
||||
font-size: 0.8125rem;
|
||||
font-family: monospace;
|
||||
colour: #374151;
|
||||
color: #374151;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.signature {
|
||||
|
|
@ -134,8 +180,9 @@ export class ScmManifest extends LitElement {
|
|||
gap: 0.75rem;
|
||||
margin-top: 1rem;
|
||||
padding: 0.75rem;
|
||||
border-radius: 0.375rem;
|
||||
border-radius: 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.signature.signed {
|
||||
|
|
@ -155,84 +202,142 @@ export class ScmManifest extends LitElement {
|
|||
|
||||
.badge {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
padding: 0.125rem 0.5rem;
|
||||
border-radius: 1rem;
|
||||
font-weight: 800;
|
||||
padding: 0.25rem 0.55rem;
|
||||
border-radius: 999px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.badge.verified {
|
||||
background: #dcfce7;
|
||||
colour: #166534;
|
||||
color: #166534;
|
||||
}
|
||||
|
||||
.badge.signed {
|
||||
background: #e0e7ff;
|
||||
color: #4338ca;
|
||||
}
|
||||
|
||||
.badge.unsigned {
|
||||
background: #fef3c7;
|
||||
colour: #92400e;
|
||||
color: #92400e;
|
||||
}
|
||||
|
||||
.badge.invalid {
|
||||
background: #fee2e2;
|
||||
colour: #991b1b;
|
||||
color: #991b1b;
|
||||
}
|
||||
|
||||
.actions {
|
||||
margin-top: 1rem;
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.verify-input {
|
||||
flex: 1;
|
||||
padding: 0.375rem 0.75rem;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 0.375rem;
|
||||
min-width: 14rem;
|
||||
padding: 0.6rem 0.85rem;
|
||||
border: 1px solid #cbd5e1;
|
||||
border-radius: 0.75rem;
|
||||
font-size: 0.8125rem;
|
||||
font-family: monospace;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 0.375rem 1rem;
|
||||
border-radius: 0.375rem;
|
||||
padding: 0.6rem 1rem;
|
||||
border-radius: 0.75rem;
|
||||
font-size: 0.8125rem;
|
||||
cursor: pointer;
|
||||
border: 1px solid #d1d5db;
|
||||
background: #fff;
|
||||
transition: background 0.15s;
|
||||
transition:
|
||||
background 0.15s ease,
|
||||
transform 0.15s ease;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background: #f3f4f6;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
button.primary {
|
||||
background: #6366f1;
|
||||
colour: #fff;
|
||||
border-colour: #6366f1;
|
||||
background: linear-gradient(180deg, #6366f1, #4f46e5);
|
||||
color: #fff;
|
||||
border-color: #6366f1;
|
||||
}
|
||||
|
||||
button.primary:hover {
|
||||
background: #4f46e5;
|
||||
background: linear-gradient(180deg, #4f46e5, #4338ca);
|
||||
}
|
||||
|
||||
.empty {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
colour: #9ca3af;
|
||||
color: #64748b;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.error {
|
||||
colour: #dc2626;
|
||||
color: #dc2626;
|
||||
padding: 0.75rem;
|
||||
background: #fef2f2;
|
||||
border-radius: 0.375rem;
|
||||
border: 1px solid #fecaca;
|
||||
border-radius: 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.loading {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
colour: #6b7280;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 0.5rem;
|
||||
height: 0.5rem;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.status-dot.verified {
|
||||
background: #22c55e;
|
||||
}
|
||||
|
||||
.status-dot.signed {
|
||||
background: #6366f1;
|
||||
}
|
||||
|
||||
.status-dot.unsigned {
|
||||
background: #f59e0b;
|
||||
}
|
||||
|
||||
.status-dot.invalid {
|
||||
background: #ef4444;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.manifest {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.header {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
|
|
@ -332,14 +437,39 @@ export class ScmManifest extends LitElement {
|
|||
|
||||
const m = this.manifest;
|
||||
const hasSig = !!m.sign;
|
||||
const status = hasSig
|
||||
? this.verifyResult
|
||||
? this.verifyResult.valid
|
||||
? 'verified'
|
||||
: 'invalid'
|
||||
: 'signed'
|
||||
: 'unsigned';
|
||||
const statusLabel = hasSig
|
||||
? this.verifyResult
|
||||
? this.verifyResult.valid
|
||||
? 'Verified'
|
||||
: 'Invalid'
|
||||
: 'Signed'
|
||||
: 'Unsigned';
|
||||
const permissionCount =
|
||||
(m.permissions?.read?.length ?? 0) +
|
||||
(m.permissions?.write?.length ?? 0) +
|
||||
(m.permissions?.net?.length ?? 0) +
|
||||
(m.permissions?.run?.length ?? 0);
|
||||
|
||||
return html`
|
||||
${this.error ? html`<div class="error">${this.error}</div>` : nothing}
|
||||
<div class="manifest">
|
||||
<div class="header">
|
||||
<div>
|
||||
<div class="header-copy">
|
||||
<h3>${m.name}</h3>
|
||||
<span class="code">${m.code}</span>
|
||||
<div class="meta-row">
|
||||
<span class="meta-chip">${m.code}</span>
|
||||
<span class="meta-chip">${permissionCount} permissions</span>
|
||||
${m.modules?.length
|
||||
? html`<span class="meta-chip">${m.modules.length} modules</span>`
|
||||
: nothing}
|
||||
</div>
|
||||
</div>
|
||||
<span class="version">v${m.version}</span>
|
||||
</div>
|
||||
|
|
@ -381,16 +511,17 @@ export class ScmManifest extends LitElement {
|
|||
? html`
|
||||
<div class="field">
|
||||
<div class="field-label">Modules</div>
|
||||
${m.modules.map((mod) => html`<div class="code" style="margin-bottom:0.25rem">${mod}</div>`)}
|
||||
${m.modules.map((mod) => html`<div class="code" style="margin-bottom:0.35rem">${mod}</div>`)}
|
||||
</div>
|
||||
`
|
||||
: nothing}
|
||||
|
||||
<div class="signature ${hasSig ? (this.verifyResult ? (this.verifyResult.valid ? 'signed' : 'invalid') : 'signed') : 'unsigned'}">
|
||||
<span class="badge ${hasSig ? (this.verifyResult ? (this.verifyResult.valid ? 'verified' : 'invalid') : 'unsigned') : 'unsigned'}">
|
||||
${hasSig ? (this.verifyResult ? (this.verifyResult.valid ? 'Verified' : 'Invalid') : 'Signed') : 'Unsigned'}
|
||||
</span>
|
||||
<div class="signature ${status}">
|
||||
<span class="badge ${status}">${statusLabel}</span>
|
||||
<span class="status">
|
||||
<span class="status-dot ${status}"></span>
|
||||
${hasSig ? html`<span>Signature present</span>` : html`<span>No signature</span>`}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
|
|
|
|||
|
|
@ -21,7 +21,79 @@ export class ScmMarketplace extends LitElement {
|
|||
static styles = css`
|
||||
:host {
|
||||
display: block;
|
||||
font-family: system-ui, -apple-system, sans-serif;
|
||||
font-family:
|
||||
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
||||
sans-serif;
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.shell {
|
||||
background: rgba(255, 255, 255, 0.84);
|
||||
border: 1px solid rgba(226, 232, 240, 0.95);
|
||||
border-radius: 1rem;
|
||||
padding: 1rem;
|
||||
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
.summary {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.75rem;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.summary-copy {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.summary-title {
|
||||
font-size: 1rem;
|
||||
font-weight: 800;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.summary-subtitle {
|
||||
font-size: 0.8125rem;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.summary-stats {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.stat {
|
||||
min-width: 4.5rem;
|
||||
padding: 0.55rem 0.75rem;
|
||||
border-radius: 0.85rem;
|
||||
background: linear-gradient(180deg, #f8fafc, #eef2ff);
|
||||
border: 1px solid #e2e8f0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
display: block;
|
||||
font-size: 1rem;
|
||||
font-weight: 800;
|
||||
color: #312e81;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
display: block;
|
||||
margin-top: 0.25rem;
|
||||
font-size: 0.6875rem;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
|
|
@ -29,20 +101,26 @@ export class ScmMarketplace extends LitElement {
|
|||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
margin-bottom: 1rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.search {
|
||||
flex: 1;
|
||||
padding: 0.5rem 0.75rem;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 0.375rem;
|
||||
min-width: 14rem;
|
||||
padding: 0.7rem 0.9rem;
|
||||
border: 1px solid #cbd5e1;
|
||||
border-radius: 0.85rem;
|
||||
font-size: 0.875rem;
|
||||
outline: none;
|
||||
background: #fff;
|
||||
transition:
|
||||
border-color 0.15s ease,
|
||||
box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
.search:focus {
|
||||
border-colour: #6366f1;
|
||||
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
|
||||
border-color: #6366f1;
|
||||
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
|
||||
}
|
||||
|
||||
.categories {
|
||||
|
|
@ -52,68 +130,128 @@ export class ScmMarketplace extends LitElement {
|
|||
}
|
||||
|
||||
.category-btn {
|
||||
padding: 0.25rem 0.75rem;
|
||||
border: 1px solid #e5e7eb;
|
||||
padding: 0.35rem 0.8rem;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 1rem;
|
||||
background: #fff;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
color: #475569;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s;
|
||||
transition:
|
||||
background 0.15s ease,
|
||||
color 0.15s ease,
|
||||
border-color 0.15s ease,
|
||||
transform 0.15s ease;
|
||||
}
|
||||
|
||||
.category-btn:hover {
|
||||
background: #f3f4f6;
|
||||
background: #f8fafc;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.category-btn.active {
|
||||
background: #6366f1;
|
||||
colour: #fff;
|
||||
border-colour: #6366f1;
|
||||
background: linear-gradient(180deg, #6366f1, #4f46e5);
|
||||
color: #fff;
|
||||
border-color: #4f46e5;
|
||||
box-shadow: 0 6px 16px rgba(99, 102, 241, 0.22);
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 1rem;
|
||||
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
||||
gap: 0.875rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 1rem;
|
||||
padding: 1rem;
|
||||
background: #fff;
|
||||
transition: box-shadow 0.15s;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
|
||||
transition:
|
||||
transform 0.15s ease,
|
||||
box-shadow 0.15s ease,
|
||||
border-color 0.15s ease;
|
||||
min-height: 10rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
||||
box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
|
||||
border-color: #c7d2fe;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 0.5rem;
|
||||
gap: 0.75rem;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.card-name {
|
||||
font-weight: 600;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 800;
|
||||
font-size: 0.95rem;
|
||||
color: #0f172a;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.card-code {
|
||||
font-size: 0.75rem;
|
||||
colour: #6b7280;
|
||||
margin-top: 0.15rem;
|
||||
font-size: 0.775rem;
|
||||
color: #64748b;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.card-category {
|
||||
font-size: 0.6875rem;
|
||||
padding: 0.125rem 0.5rem;
|
||||
background: #f3f4f6;
|
||||
border-radius: 1rem;
|
||||
colour: #6b7280;
|
||||
padding: 0.2rem 0.5rem;
|
||||
background: #e0e7ff;
|
||||
border-radius: 999px;
|
||||
color: #4338ca;
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.card-repo {
|
||||
font-size: 0.7875rem;
|
||||
color: #475569;
|
||||
font-family: monospace;
|
||||
word-break: break-word;
|
||||
margin-bottom: 0.4rem;
|
||||
}
|
||||
|
||||
.card-sign {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
color: #166534;
|
||||
margin-bottom: 0.4rem;
|
||||
}
|
||||
|
||||
.card-sign::before {
|
||||
content: '';
|
||||
width: 0.45rem;
|
||||
height: 0.45rem;
|
||||
border-radius: 999px;
|
||||
background: #22c55e;
|
||||
}
|
||||
|
||||
.card-sign.unsigned {
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.card-sign.unsigned::before {
|
||||
background: #f59e0b;
|
||||
}
|
||||
|
||||
.card-actions {
|
||||
|
|
@ -123,18 +261,24 @@ export class ScmMarketplace extends LitElement {
|
|||
}
|
||||
|
||||
button.install {
|
||||
padding: 0.375rem 1rem;
|
||||
background: #6366f1;
|
||||
colour: #fff;
|
||||
padding: 0.45rem 1rem;
|
||||
background: linear-gradient(180deg, #6366f1, #4f46e5);
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 0.375rem;
|
||||
border-radius: 0.75rem;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
transition:
|
||||
transform 0.15s ease,
|
||||
box-shadow 0.15s ease,
|
||||
background 0.15s ease;
|
||||
box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
|
||||
}
|
||||
|
||||
button.install:hover {
|
||||
background: #4f46e5;
|
||||
background: linear-gradient(180deg, #4f46e5, #4338ca);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
button.install:disabled {
|
||||
|
|
@ -143,39 +287,66 @@ export class ScmMarketplace extends LitElement {
|
|||
}
|
||||
|
||||
button.remove {
|
||||
padding: 0.375rem 1rem;
|
||||
padding: 0.45rem 1rem;
|
||||
background: #fff;
|
||||
colour: #dc2626;
|
||||
color: #dc2626;
|
||||
border: 1px solid #dc2626;
|
||||
border-radius: 0.375rem;
|
||||
border-radius: 0.75rem;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
background 0.15s ease,
|
||||
transform 0.15s ease;
|
||||
}
|
||||
|
||||
button.remove:hover {
|
||||
background: #fef2f2;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.empty {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
colour: #9ca3af;
|
||||
color: #64748b;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.loading {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
colour: #6b7280;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.error {
|
||||
colour: #dc2626;
|
||||
color: #dc2626;
|
||||
padding: 0.75rem;
|
||||
background: #fef2f2;
|
||||
border-radius: 0.375rem;
|
||||
border: 1px solid #fecaca;
|
||||
border-radius: 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.shell {
|
||||
padding: 0.875rem;
|
||||
border-radius: 0.875rem;
|
||||
}
|
||||
|
||||
.summary {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.summary-stats {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@property({ attribute: 'api-url' }) apiUrl = '';
|
||||
|
|
@ -262,6 +433,26 @@ export class ScmMarketplace extends LitElement {
|
|||
|
||||
render() {
|
||||
return html`
|
||||
<div class="shell">
|
||||
<div class="summary">
|
||||
<div class="summary-copy">
|
||||
<span class="summary-title">Marketplace</span>
|
||||
<span class="summary-subtitle">
|
||||
Browse, filter, and install providers from the current index.
|
||||
</span>
|
||||
</div>
|
||||
<div class="summary-stats">
|
||||
<div class="stat">
|
||||
<span class="stat-value">${this.modules.length}</span>
|
||||
<span class="stat-label">Results</span>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<span class="stat-value">${this.categories.length}</span>
|
||||
<span class="stat-label">Categories</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="toolbar">
|
||||
<input
|
||||
type="text"
|
||||
|
|
@ -270,8 +461,6 @@ export class ScmMarketplace extends LitElement {
|
|||
.value=${this.searchQuery}
|
||||
@input=${this.handleSearch}
|
||||
/>
|
||||
</div>
|
||||
|
||||
${this.categories.length > 0
|
||||
? html`
|
||||
<div class="categories">
|
||||
|
|
@ -288,6 +477,8 @@ export class ScmMarketplace extends LitElement {
|
|||
</div>
|
||||
`
|
||||
: nothing}
|
||||
</div>
|
||||
|
||||
${this.error ? html`<div class="error">${this.error}</div>` : nothing}
|
||||
${this.loading
|
||||
? html`<div class="loading">Loading marketplace\u2026</div>`
|
||||
|
|
@ -298,6 +489,7 @@ export class ScmMarketplace extends LitElement {
|
|||
${this.modules.map(
|
||||
(mod) => html`
|
||||
<div class="card">
|
||||
<div>
|
||||
<div class="card-header">
|
||||
<div>
|
||||
<div class="card-name">${mod.name}</div>
|
||||
|
|
@ -307,6 +499,11 @@ export class ScmMarketplace extends LitElement {
|
|||
? html`<span class="card-category">${mod.category}</span>`
|
||||
: nothing}
|
||||
</div>
|
||||
<div class="card-repo">${mod.repo}</div>
|
||||
<div class="card-sign ${mod.sign_key ? '' : 'unsigned'}">
|
||||
${mod.sign_key ? 'Signed module' : 'Unsigned module'}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-actions">
|
||||
<button
|
||||
class="install"
|
||||
|
|
@ -324,6 +521,7 @@ export class ScmMarketplace extends LitElement {
|
|||
)}
|
||||
</div>
|
||||
`}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,14 @@ export class ScmPanel extends LitElement {
|
|||
:host {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-family: system-ui, -apple-system, sans-serif;
|
||||
font-family:
|
||||
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
||||
sans-serif;
|
||||
height: 100%;
|
||||
background: #fafafa;
|
||||
background:
|
||||
radial-gradient(circle at top left, rgba(99, 102, 241, 0.12), transparent 30%),
|
||||
linear-gradient(180deg, #eef2ff 0%, #f8fafc 28%, #f3f4f6 100%);
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
/* H — Header */
|
||||
|
|
@ -41,68 +46,107 @@ export class ScmPanel extends LitElement {
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0.75rem 1rem;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
gap: 1rem;
|
||||
padding: 1rem 1.25rem;
|
||||
background: rgba(255, 255, 255, 0.86);
|
||||
backdrop-filter: blur(18px);
|
||||
border-bottom: 1px solid rgba(226, 232, 240, 0.9);
|
||||
}
|
||||
|
||||
.title-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.125rem;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: 700;
|
||||
font-size: 1rem;
|
||||
colour: #111827;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 0.8125rem;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.refresh-btn {
|
||||
padding: 0.375rem 0.75rem;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 0.375rem;
|
||||
background: #fff;
|
||||
padding: 0.5rem 0.875rem;
|
||||
border: 1px solid rgba(99, 102, 241, 0.25);
|
||||
border-radius: 999px;
|
||||
background: linear-gradient(180deg, #ffffff, #eef2ff);
|
||||
color: #4338ca;
|
||||
font-weight: 600;
|
||||
font-size: 0.8125rem;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
transition:
|
||||
transform 0.15s ease,
|
||||
box-shadow 0.15s ease,
|
||||
background 0.15s ease;
|
||||
box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
|
||||
}
|
||||
|
||||
.refresh-btn:hover {
|
||||
background: #f3f4f6;
|
||||
background: linear-gradient(180deg, #ffffff, #e0e7ff);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 8px 20px rgba(99, 102, 241, 0.12);
|
||||
}
|
||||
|
||||
/* H-L — Tabs */
|
||||
.tabs {
|
||||
display: flex;
|
||||
gap: 0;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
padding: 0 1rem;
|
||||
gap: 0.375rem;
|
||||
padding: 0.75rem 1rem 0;
|
||||
background: rgba(255, 255, 255, 0.72);
|
||||
backdrop-filter: blur(18px);
|
||||
border-bottom: 1px solid rgba(226, 232, 240, 0.9);
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.tab {
|
||||
padding: 0.625rem 1rem;
|
||||
padding: 0.7rem 1rem;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
colour: #6b7280;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.01em;
|
||||
color: #64748b;
|
||||
cursor: pointer;
|
||||
border-bottom: 2px solid transparent;
|
||||
transition: all 0.15s;
|
||||
background: none;
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 999px 999px 0 0;
|
||||
transition:
|
||||
color 0.15s ease,
|
||||
background 0.15s ease,
|
||||
border-color 0.15s ease,
|
||||
transform 0.15s ease;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.tab:hover {
|
||||
colour: #374151;
|
||||
color: #334155;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.tab.active {
|
||||
colour: #6366f1;
|
||||
border-bottom-colour: #6366f1;
|
||||
color: #4338ca;
|
||||
background: rgba(255, 255, 255, 0.96);
|
||||
border-color: rgba(226, 232, 240, 0.9);
|
||||
border-bottom-color: rgba(255, 255, 255, 0.96);
|
||||
box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.6), 0 -8px 24px rgba(15, 23, 42, 0.04);
|
||||
}
|
||||
|
||||
/* C — Content */
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 1rem;
|
||||
padding: 1.25rem;
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.content > * {
|
||||
width: min(100%, 1120px);
|
||||
}
|
||||
|
||||
/* F — Footer / Status bar */
|
||||
|
|
@ -110,17 +154,20 @@ export class ScmPanel extends LitElement {
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0.5rem 1rem;
|
||||
background: #fff;
|
||||
border-top: 1px solid #e5e7eb;
|
||||
gap: 1rem;
|
||||
padding: 0.75rem 1.25rem;
|
||||
background: rgba(255, 255, 255, 0.84);
|
||||
backdrop-filter: blur(18px);
|
||||
border-top: 1px solid rgba(226, 232, 240, 0.9);
|
||||
font-size: 0.75rem;
|
||||
colour: #9ca3af;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.ws-status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.ws-dot {
|
||||
|
|
@ -131,15 +178,33 @@ export class ScmPanel extends LitElement {
|
|||
|
||||
.ws-dot.connected {
|
||||
background: #22c55e;
|
||||
box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
|
||||
}
|
||||
|
||||
.ws-dot.disconnected {
|
||||
background: #ef4444;
|
||||
box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
|
||||
}
|
||||
|
||||
.ws-dot.idle {
|
||||
background: #d1d5db;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.header,
|
||||
.footer {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
padding-inline: 0.75rem;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0.875rem;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@property({ attribute: 'api-url' }) apiUrl = '';
|
||||
|
|
@ -269,7 +334,10 @@ export class ScmPanel extends LitElement {
|
|||
|
||||
return html`
|
||||
<div class="header">
|
||||
<div class="title-wrap">
|
||||
<span class="title">SCM</span>
|
||||
<span class="subtitle">Marketplace, manifests, installed modules, and registry status</span>
|
||||
</div>
|
||||
<button class="refresh-btn" @click=${this.handleRefresh}>Refresh</button>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,23 +22,64 @@ export class ScmRegistry extends LitElement {
|
|||
static styles = css`
|
||||
:host {
|
||||
display: block;
|
||||
font-family: system-ui, -apple-system, sans-serif;
|
||||
font-family:
|
||||
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
||||
sans-serif;
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.shell {
|
||||
background: rgba(255, 255, 255, 0.84);
|
||||
border: 1px solid rgba(226, 232, 240, 0.95);
|
||||
border-radius: 1rem;
|
||||
padding: 1rem;
|
||||
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
.summary {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.75rem;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.summary-copy {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.summary-title {
|
||||
font-size: 1rem;
|
||||
font-weight: 800;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.summary-subtitle {
|
||||
font-size: 0.8125rem;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.375rem;
|
||||
gap: 0.625rem;
|
||||
}
|
||||
|
||||
.repo {
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 1rem;
|
||||
padding: 0.75rem 1rem;
|
||||
background: #fff;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.repo-info {
|
||||
|
|
@ -46,14 +87,15 @@ export class ScmRegistry extends LitElement {
|
|||
}
|
||||
|
||||
.repo-name {
|
||||
font-weight: 600;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 800;
|
||||
font-size: 0.95rem;
|
||||
font-family: monospace;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.repo-desc {
|
||||
font-size: 0.8125rem;
|
||||
colour: #6b7280;
|
||||
color: #64748b;
|
||||
margin-top: 0.125rem;
|
||||
}
|
||||
|
||||
|
|
@ -62,38 +104,48 @@ export class ScmRegistry extends LitElement {
|
|||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
margin-top: 0.25rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.type-badge {
|
||||
font-size: 0.6875rem;
|
||||
padding: 0.0625rem 0.5rem;
|
||||
border-radius: 1rem;
|
||||
font-weight: 600;
|
||||
padding: 0.2rem 0.5rem;
|
||||
border-radius: 999px;
|
||||
font-weight: 800;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.type-badge.foundation {
|
||||
background: #dbeafe;
|
||||
colour: #1e40af;
|
||||
color: #1e40af;
|
||||
}
|
||||
|
||||
.type-badge.module {
|
||||
background: #f3e8ff;
|
||||
colour: #6b21a8;
|
||||
color: #6b21a8;
|
||||
}
|
||||
|
||||
.type-badge.product {
|
||||
background: #dcfce7;
|
||||
colour: #166534;
|
||||
color: #166534;
|
||||
}
|
||||
|
||||
.type-badge.template {
|
||||
background: #fef3c7;
|
||||
colour: #92400e;
|
||||
color: #92400e;
|
||||
}
|
||||
|
||||
.deps {
|
||||
font-size: 0.75rem;
|
||||
colour: #9ca3af;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.path {
|
||||
font-size: 0.75rem;
|
||||
font-family: monospace;
|
||||
color: #475569;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.status {
|
||||
|
|
@ -110,38 +162,54 @@ export class ScmRegistry extends LitElement {
|
|||
|
||||
.status-dot.present {
|
||||
background: #22c55e;
|
||||
box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
|
||||
}
|
||||
|
||||
.status-dot.missing {
|
||||
background: #ef4444;
|
||||
box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
|
||||
}
|
||||
|
||||
.status-label {
|
||||
font-size: 0.75rem;
|
||||
colour: #6b7280;
|
||||
color: #64748b;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.empty {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
colour: #9ca3af;
|
||||
color: #64748b;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.loading {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
colour: #6b7280;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.error {
|
||||
colour: #dc2626;
|
||||
color: #dc2626;
|
||||
padding: 0.75rem;
|
||||
background: #fef2f2;
|
||||
border-radius: 0.375rem;
|
||||
border: 1px solid #fecaca;
|
||||
border-radius: 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.shell {
|
||||
padding: 0.875rem;
|
||||
}
|
||||
|
||||
.summary,
|
||||
.repo {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@property({ attribute: 'api-url' }) apiUrl = '';
|
||||
|
|
@ -180,6 +248,20 @@ export class ScmRegistry extends LitElement {
|
|||
}
|
||||
|
||||
return html`
|
||||
<div class="shell">
|
||||
<div class="summary">
|
||||
<div class="summary-copy">
|
||||
<span class="summary-title">Registry</span>
|
||||
<span class="summary-subtitle">
|
||||
Workspace repositories and dependency order from repos.yaml.
|
||||
</span>
|
||||
</div>
|
||||
<div class="summary-copy" style="text-align:right">
|
||||
<span class="summary-title">${this.repos.length}</span>
|
||||
<span class="summary-subtitle">Entries</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${this.error ? html`<div class="error">${this.error}</div>` : nothing}
|
||||
${this.repos.length === 0
|
||||
? html`<div class="empty">No repositories in registry.</div>`
|
||||
|
|
@ -199,6 +281,7 @@ export class ScmRegistry extends LitElement {
|
|||
? html`<span class="deps">depends: ${repo.depends_on.join(', ')}</span>`
|
||||
: nothing}
|
||||
</div>
|
||||
${repo.path ? html`<div class="path">${repo.path}</div>` : nothing}
|
||||
</div>
|
||||
<div class="status">
|
||||
<span class="status-dot ${repo.exists ? 'present' : 'missing'}"></span>
|
||||
|
|
@ -209,6 +292,7 @@ export class ScmRegistry extends LitElement {
|
|||
)}
|
||||
</div>
|
||||
`}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue