Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

16.7 KB
Raw Blame
// ============================================
// STATUS PAGES (redesign — infra console look)
// Sibling of _monitoring.scss: mono eyebrows, quiet surface panels,
// .comp-dots component strip + .inc-state incident chips (prototype
// view_monitoring.jsx status/incidents tabs).
// ============================================

.status-pages-page {
    .status-layout {
        display: grid;
        grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
        gap: $space-5;
        margin-top: $space-4;
        align-items: start;

        @media (max-width: 960px) {
            grid-template-columns: 1fr;
        }
    }

    // ── pages rail ──────────────────────────────────────────
    .status-pages-list {
        display: flex;
        flex-direction: column;
        gap: $space-2;
        min-width: 0;
    }

    .status-page-item {
        width: 100%;
        padding: $space-3 $space-4;
        background: var(--surface);
        border: 1px solid var(--border-soft);
        border-radius: var(--radius);
        color: var(--text);
        cursor: pointer;
        display: grid;
        gap: $space-tight;
        text-align: left;
        transition: border-color $transition-fast, background $transition-fast;

        &:hover {
            background: var(--surface-hover);
            border-color: var(--border-strong);
        }

        &.active {
            background: var(--accent-bg-soft);
            border-color: var(--accent-dim);
        }

        &__top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: $space-2;
            min-width: 0;
        }

        &__name {
            font-size: $text-sm;
            font-weight: $font-weight-semibold;
            @include truncate();
        }

        .sk-pill {
            padding: 1px $space-2;
            font-size: $text-xs;
        }

        &__slug {
            color: var(--text-faint);
            font-family: var(--mono);
            font-size: $text-xs;
            @include truncate();
        }

        &__meta {
            display: inline-flex;
            align-items: center;
            gap: $space-tight;
            color: var(--text-faint);
            font-size: $text-xs;

            svg {
                color: var(--text-ghost);
                flex-shrink: 0;
            }
        }
    }

    .status-pages-list .empty-state {
        min-height: 160px;
    }

    // ── detail panel ────────────────────────────────────────
    .status-detail-panel {
        min-width: 0;
        background: var(--surface);
        border: 1px solid var(--border-soft);
        border-radius: var(--radius);
        padding: $space-5;

        &--empty {
            min-height: 320px;
            display: grid;
            place-items: center;
            align-content: center;
            gap: $space-3;
            color: var(--text-faint);
        }
    }

    .status-detail-panel__hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
        gap: $space-5;
        align-items: stretch;
        margin-bottom: $space-5;

        h2 {
            margin: $space-3 0 $space-1;
            font-size: $text-lg;
            font-weight: $font-weight-semibold;
            letter-spacing: -0.01em;
            line-height: 1.15;
        }

        p {
            margin: 0;
            color: var(--text-dim);
            font-size: $text-sm;
            max-width: 760px;
        }

        @media (max-width: 1100px) {
            grid-template-columns: 1fr;
        }
    }

    .status-overall-pill {
        font-size: $text-xs;
        padding: $space-1 $space-3;
    }

    // Component status dot strip (prototype .comp-dots)
    .comp-dots {
        display: flex;
        gap: $space-1;
        flex-wrap: wrap;
        margin-top: $space-3;

        i {
            width: 8px;
            height: 8px;
            border-radius: $radius-badge;
            background: var(--green);

            &.degraded { background: var(--amber); }
            &.down { background: var(--red); }
            &.maintenance { background: var(--cyan); }
        }
    }

    .status-url-card {
        display: grid;
        gap: $space-3;
        align-content: start;
        padding: $space-4;
        border: 1px solid var(--border-soft);
        border-radius: var(--radius);
        background: var(--surface-2);

        > div:not(.sk-copy-field) {
            display: flex;
            flex-wrap: wrap;
            gap: $space-2;
        }
    }

    // KPI trio (sk-spec-card; surface-2 so the tiles read inside the panel)
    .status-detail-metrics {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: $space-3;
        margin-bottom: $space-4;

        .sk-spec-card {
            background: var(--surface-2);
        }

        .sk-spec-card__value {
            font-size: $text-lg;
            letter-spacing: -0.01em;
        }

        @media (max-width: 720px) {
            grid-template-columns: 1fr;
        }
    }

    .status-actions-bar {
        display: flex;
        justify-content: flex-end;
        margin: $space-4 0;
    }

    .components-list,
    .incidents-list {
        display: grid;
        gap: $space-4;
    }

    // ── component groups (mono eyebrow + joined dense rows) ─
    .component-group {
        min-width: 0;
        padding: $space-4;
        border: 1px solid var(--border-soft);
        border-radius: var(--radius);
        background: var(--surface-2);

        h3 {
            margin: 0 0 $space-2;
            font-size: $text-xs;
            font-weight: $font-weight-semibold;
            color: var(--text-faint);
        }
    }

    .component-row {
        display: grid;
        grid-template-columns: minmax(220px, 1fr) minmax(260px, auto) auto;
        gap: $space-4;
        align-items: center;
        padding: $space-3 0;

        &:last-child {
            padding-bottom: 0;
        }

        & + & {
            border-top: 1px solid var(--border-soft);
        }

        &__info {
            min-width: 0;
            display: flex;
            align-items: center;
            gap: $space-3;

            > div {
                min-width: 0;
                display: grid;
                gap: $space-1;
            }

            strong {
                font-size: $text-sm;
                font-weight: $font-weight-semibold;
                @include truncate();
            }

            span {
                font-size: $text-xs;
                color: var(--text-faint);
                @include truncate();
            }
        }

        &__stats {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: flex-end;
            gap: $space-3;

            > span {
                font-size: $text-xs;
                color: var(--text-faint);
                white-space: nowrap;
            }
        }

        &__actions {
            display: flex;
            justify-content: flex-end;
            gap: $space-2;
        }

        @media (max-width: 1180px) {
            grid-template-columns: 1fr;

            &__stats,
            &__actions {
                justify-content: flex-start;
            }
        }
    }

    // Component status dot (mon-sev style rounded square)
    .status-dot {
        width: 9px;
        height: 9px;
        border-radius: $radius-badge;
        flex: 0 0 auto;

        &--success {
            background: var(--green);
            box-shadow: none;
        }

        &--warning {
            background: var(--amber);
            box-shadow: none;
        }

        &--danger {
            background: var(--red);
        }

        &--info {
            background: var(--cyan);
        }
    }

    // ── incidents ───────────────────────────────────────────
    .incident-row {
        display: grid;
        gap: $space-3;
        padding: $space-4;
        border: 1px solid var(--border-soft);
        border-radius: var(--radius);
        background: var(--surface-2);

        &--investigating { border-color: rgba(251, 111, 111, 0.3); }
        &--identified { border-color: rgba(245, 185, 69, 0.3); }
        &--monitoring { border-color: rgba(73, 199, 240, 0.3); }
        &--resolved { border-color: var(--border-soft); }

        &__header {
            display: flex;
            justify-content: space-between;
            gap: $space-3;

            > div:first-child {
                min-width: 0;

                strong {
                    display: block;
                    margin-bottom: $space-1;
                    font-size: $text-sm;
                    font-weight: $font-weight-semibold;
                }

                span {
                    color: var(--text-faint);
                    font-size: $text-xs;
                }
            }
        }

        &__badges {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            align-items: flex-start;
            gap: $space-2;
        }

        p {
            margin: 0;
            color: var(--text-dim);
            font-size: $text-sm;
            line-height: 1.5;
        }

        &__actions {
            display: flex;
            flex-wrap: wrap;
            gap: $space-2;
        }
    }

    // Incident state + impact chips (prototype .inc-state) — shape from
    // the shared %sk-state primitive (_design-system.scss)
    .inc-state,
    .inc-impact {
        @extend %sk-state;
    }

    .inc-state {
        &--investigating { color: var(--red); background: var(--red-bg); }
        &--identified { color: var(--amber); background: var(--amber-bg); }
        &--monitoring { color: var(--cyan); background: var(--cyan-bg); }
        &--resolved { color: var(--green); background: var(--green-bg); }
    }

    .inc-impact {
        color: var(--text-faint);
        background: var(--surface-3);

        &--minor { color: var(--cyan); background: var(--cyan-bg); }
        &--major { color: var(--amber); background: var(--amber-bg); }
        &--critical { color: var(--red); background: var(--red-bg); }
    }

    .incident-timeline {
        display: grid;
        gap: $space-3;
        padding-left: $space-3;
        border-left: 1px solid var(--border);

        > div {
            display: grid;
            gap: $space-hair;
        }

        span {
            color: var(--text-faint);
            font-size: $text-xs;
        }

        strong {
            color: var(--text-dim);
            font-size: $text-xs;
            font-weight: $font-weight-semibold;
        }

        p {
            font-size: $text-sm;
        }
    }

    // ── page settings tab ───────────────────────────────────
    .status-page-settings {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
        gap: $space-3;
        align-items: center;
        margin-top: $space-4;

        > div {
            min-height: 72px;
            padding: $space-4 $space-4;
            border: 1px solid var(--border-soft);
            border-radius: var(--radius);
            background: var(--surface-2);
        }

        > div > span:first-child {
            display: block;
            color: var(--text-faint);
            font-size: $text-xs;
            font-weight: $font-weight-semibold;
        }

        > div > strong {
            display: block;
            margin-top: $space-2;
            font-size: $text-sm;
            overflow-wrap: anywhere;
        }

        > div > .sk-pill {
            margin-top: $space-2;
        }

        @media (max-width: 960px) {
            grid-template-columns: 1fr;
        }
    }

}

// Status-page modal chrome. Hoisted OUT of .status-pages-page: the shared Modal
// renders through a portal on <body>, so page-scoped rules would never reach it.
// Surface chrome comes from .sk-modal; these only add the eyebrow form labels
// and the two-column grid.
.status-modal {
    .form-group label {
        font-size: $text-xs;
        font-weight: $font-weight-semibold;
        color: var(--text-faint);
    }

    .form-help {
        font-size: $text-xs;
        color: var(--text-faint);
    }
}

.status-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: $space-4;

    @media (max-width: 640px) {
        grid-template-columns: 1fr;
    }
}

.public-status-page {
    min-height: 100vh;
    padding: clamp($space-6, 4vw, $space-16);
    background: $bg-body;
    color: $text-primary;

    .public-status-hero,
    .public-status-summary,
    .public-status-section,
    .public-status-shell {
        width: min(1040px, 100%);
        margin: 0 auto;
    }

    .public-status-hero {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: $space-5;
        padding: $space-6;
        border: 1px solid $border-subtle;
        border-radius: $radius-card;
        background: $bg-card;

        h1 {
            margin: 0;
            font-size: clamp(2rem, 5vw, 3.5rem);
            line-height: 1;
        }

        p {
            margin: $space-3 0 0;
            color: $text-secondary;
            max-width: 720px;
        }

        @media (max-width: 700px) {
            flex-direction: column;
        }
    }

    .public-status-badge {
        min-height: 34px; // geometry: public status summary banner, not a chip
        padding: $space-2 $space-3;
    }

    .public-status-summary {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: $space-3;
        margin-top: $space-4;

        > div {
            padding: $space-4;
            border: 1px solid $border-subtle;
            border-radius: $radius-control;
            background: $bg-card;
        }

        span {
            display: block;
            color: $text-tertiary;
            font-size: $text-xs;
            font-weight: $font-weight-semibold;
        }

        strong {
            display: block;
            margin-top: $space-2;
            font-size: $text-lg;
        }

        @media (max-width: 700px) {
            grid-template-columns: 1fr;
        }
    }

    .public-status-section {
        margin-top: $space-5;

        > header {
            margin-bottom: $space-3;
        }

        h2,
        h3 {
            margin: 0;
        }
    }

    .public-component-groups,
    .public-component-list,
    .public-incident-list {
        display: grid;
        gap: $space-3;
    }

    .public-component-group {
        display: grid;
        gap: $space-2;

        > h3 {
            color: $text-secondary;
            font-size: $text-xs;
        }
    }

    .public-component-row,
    .public-incident,
    .public-status-empty,
    .public-status-shell {
        padding: $space-4;
        border: 1px solid $border-subtle;
        border-radius: $radius-control;
        background: $bg-card;
    }

    .public-component-row {
        display: flex;
        justify-content: space-between;
        gap: $space-4;
        align-items: center;

        > div:first-child {
            display: flex;
            align-items: center;
            gap: $space-3;
            min-width: 0;

            span {
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }
        }

        &__meta {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: $space-2;
            color: $text-secondary;
            font-size: $text-xs;
        }

        @media (max-width: 760px) {
            align-items: flex-start;
            flex-direction: column;

            &__meta {
                justify-content: flex-start;
            }
        }
    }

    .public-incident {
        display: grid;
        gap: $space-3;

        &--active {
            border-color: fade($warning-raw, 45%);
        }

        > div {
            display: flex;
            justify-content: space-between;
            gap: $space-3;
        }

        h3 {
            font-size: $text-base;
        }

        span {
            display: block;
            margin-top: $space-1;
            color: $text-tertiary;
            font-size: $text-xs;
        }

        p {
            margin: 0;
            color: $text-secondary;
        }
    }

    .public-status-empty,
    .public-status-shell--empty {
        display: grid;
        place-items: center;
        gap: $space-2;
        min-height: 180px;
        color: $text-tertiary;
        text-align: center;
    }
}