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.

13.1 KB
Raw Blame
// ============================================
// DEPLOYMENT TIMELINE + CONFIG DIFF
// ============================================
// Vertical snapshot timeline and the config diff modal in an app's Deploy tab.
// Themed via design-system tokens (no inline styles).

// ---------------------------------------------------------------- Timeline
.deploy-timeline {
    display: flex;
    flex-direction: column;
    gap: $space-4;

    &--empty {
        align-items: center;
        gap: $space-2;
        padding: $space-8;
        color: $text-secondary;
        text-align: center;
        background: $bg-card;
        border: 1px dashed $border-subtle;
        border-radius: $radius-card;

        svg {
            color: $text-tertiary;
        }
    }

    &__loading {
        color: $text-secondary;
        padding: $space-4 0;
    }

    &__list {
        list-style: none;
        margin: 0;
        padding: 0;
        position: relative;
    }

    // The vertical spine that connects markers.
    &__item {
        position: relative;
        padding-inline-start: $space-8;
        padding-bottom: $space-4;

        &::before {
            content: '';
            position: absolute;
            inset-inline-start: $space-2;
            top: 0;
            bottom: 0;
            width: 2px;
            background: $border-subtle;
        }

        &:last-child::before {
            bottom: auto;
            height: 16px;
        }
    }

    &__marker {
        position: absolute;
        inset-inline-start: 0;
        top: 4px;
        width: 16px;
        height: 16px;
        border-radius: $radius-full;
        background: $bg-elevated;
        border: 2px solid $border-subtle;
        z-index: 1;

        &--current {
            background: $success;
            border-color: $success;
            box-shadow: none;
        }
    }

    &__card {
        background: $bg-card;
        border: 1px solid $border-subtle;
        border-radius: $radius-card;
        padding: $space-4;
        display: flex;
        flex-direction: column;
        gap: $space-3;
    }

    &__row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: $space-3;
        flex-wrap: wrap;
    }

    &__meta {
        display: flex;
        align-items: center;
        gap: $space-2;
        flex-wrap: wrap;
    }

    &__time {
        display: inline-flex;
        align-items: center;
        gap: $space-1;
        color: $text-tertiary;
        font-size: $text-sm;
    }

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

    &__chip {
        display: inline-flex;
        align-items: center;
        gap: $space-1;
        padding: $space-hair $space-2;
        background: $bg-elevated;
        border: 1px solid $border-subtle;
        border-radius: $radius-control;
        color: $text-secondary;
        font-size: $text-sm;
    }

    &__summary {
        margin: 0;
        color: $text-secondary;
        font-size: $text-sm;
    }

    &--server {
        gap: $space-5;

        .sk-listhead {
            margin: 0;
        }

        .deploy-timeline__item {
            padding-inline-start: $space-12;

            &::before {
                inset-inline-start: $space-3;
            }
        }

        .deploy-timeline__marker {
            inset-inline-start: 0;
            width: 28px;
            height: 28px; // geometry: timeline marker icon disc
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: $text-secondary;
            background: $bg-elevated;

            &--restore_point {
                color: $violet;
                border-color: $violet;
                background: $violet-bg;
            }

            &--deployment_snapshot {
                color: $cyan;
                border-color: $cyan;
                background: $cyan-bg;
            }

            &--audit {
                color: $text-secondary;
                border-color: $border-active;
            }
        }
    }

    &__count {
        color: $text-tertiary;
        font-size: $text-xs;
        white-space: nowrap;
    }

    &__event-heading {
        display: flex;
        align-items: baseline;
        gap: $space-2;
        flex-wrap: wrap;

        h3 {
            margin: 0;
            color: $text-primary;
            font-size: $text-base;
            font-weight: $font-weight-semibold;
        }

        span {
            color: $text-tertiary;
            font-size: $text-xs;
        }
    }

    &__coverage-note {
        margin: 0;
        color: $warning;
        font-size: $text-xs;
    }

    &__error,
    &__footer {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: $space-3;
    }
}

// -------------------------------------------------------- Server restore tab
.server-restore-points {
    display: flex;
    flex-direction: column;
    gap: $space-5;

    &__header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: $space-4;

        h2 {
            margin: 0;
            color: $text-primary;
            font-size: $text-lg;
        }

        p {
            margin: $space-1 0 0;
            color: $text-secondary;
            max-width: 70ch;
        }
    }

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

    &__scope-note {
        display: flex;
        align-items: flex-start;
        gap: $space-3;
        padding: $space-3 $space-4;
        @include status-variant($info, $info-bg, $info-border);
        border: 1px solid $info-border;
        border-radius: $radius-card;

        svg {
            flex-shrink: 0;
            margin-block-start: $space-hair;
        }

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

    &__apps-status {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: $space-3;
        color: $text-secondary;
        font-size: $text-xs;

        &--empty {
            justify-content: flex-start;
            align-items: flex-start;
            padding: $space-3 $space-4;
            background: $bg-elevated;
            border: 1px solid $border-subtle;
            border-radius: $radius-card;

            > svg {
                flex-shrink: 0;
                margin-block-start: $space-hair;
                color: $text-tertiary;
            }

            div {
                display: flex;
                flex-direction: column;
                gap: $space-1;
            }

            strong {
                color: $text-primary;
                font-weight: $font-weight-semibold;
            }

            span {
                color: $text-secondary;
            }
        }
    }

    &__form {
        display: flex;
        flex-direction: column;
        gap: $space-4;
    }

    &__form-intro {
        margin: 0;
        color: $text-secondary;
        line-height: $line-height-normal;
    }
}

// ---------------------------------------------------------------- Timeline card
.deploy-timeline-card {
    &__hint {
        margin: 0 0 $space-4;
        color: $text-secondary;
        font-size: $text-sm;
        max-width: 70ch;
    }
}

// ---------------------------------------------------------------- Config diff
.config-diff {
    max-width: 640px;
    width: 100%;

    &__body {
        display: flex;
        flex-direction: column;
        gap: $space-4;
        max-height: 60vh;
        overflow-y: auto;
        padding: $space-2 0;
    }

    &__loading {
        color: $text-secondary;
    }

    // Plain-language summary, shown prominently above the technical diff so a
    // less-technical user knows what they're looking at / rolling back.
    &__summary-banner {
        display: flex;
        align-items: flex-start;
        gap: $space-2;
        padding: $space-3;
        background: $info-bg;
        border: 1px solid $info-border;
        border-radius: $radius-control;
    }

    &__summary-icon {
        flex-shrink: 0;
        margin-top: 1px;
        color: $info;
    }

    &__summary-text {
        display: flex;
        flex-direction: column;
        gap: $space-hair;
    }

    &__summary-label {
        font-size: $text-xs;
        font-weight: $font-weight-semibold;
        color: $text-tertiary;
    }

    &__summary {
        margin: 0;
        color: $text-primary;
        font-size: $text-base;
        line-height: 1.4;
    }

    &__section {
        display: flex;
        flex-direction: column;
        gap: $space-2;
    }

    &__section-title {
        margin: 0;
        font-size: $text-sm;
        font-weight: $font-weight-semibold;
        color: $text-secondary;
    }

    &__none {
        margin: 0;
        color: $text-tertiary;
        font-size: $text-sm;
    }

    &__lines {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: $space-hair;
    }

    &__line {
        display: flex;
        align-items: center;
        gap: $space-2;
        padding: $space-hair $space-2;
        border-radius: $radius-badge;
        font-family: $font-mono;
        font-size: $text-sm;
        min-width: 0;

        &--add {
            @include status-variant($success, $success-bg);
        }

        &--remove {
            @include status-variant($danger, $danger-bg);
        }

        &--change {
            @include status-variant($warning, $warning-bg);
        }
    }

    &__sign {
        font-weight: $font-weight-semibold;
        width: 12px;
        display: inline-block;
        text-align: center;
    }

    &__path {
        flex-shrink: 0;
        font-weight: $font-weight-semibold;
    }

    &__value {
        margin-inline-start: auto;
        min-width: 0;
        color: $text-secondary;
        overflow-wrap: anywhere;
        text-align: end;
    }

    &__scalar {
        display: flex;
        align-items: center;
        gap: $space-2;
        flex-wrap: wrap;
        font-family: $font-mono;
        font-size: $text-sm;
    }

    &__old {
        color: $danger;
        text-decoration: line-through;
    }

    &__new {
        color: $success;
    }

    &__arrow {
        color: $text-tertiary;
    }

    &__confirm-text {
        margin-right: auto;
        color: $text-secondary;
        font-size: $text-base;
    }

    &__point-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: $space-3;
        padding-block-end: $space-3;
        border-bottom: 1px solid $border-subtle;
    }

    &__group {
        display: flex;
        flex-direction: column;
        gap: $space-3;
    }

    &__group-heading,
    &__coverage-heading {
        h3 {
            margin: 0;
            color: $text-primary;
            font-size: $text-base;
        }

        p {
            margin: $space-1 0 0;
            color: $text-secondary;
            font-size: $text-xs;
            line-height: $line-height-normal;
        }
    }

    &__coverage {
        display: flex;
        flex-direction: column;
        gap: $space-3;
        padding: $space-4;
        background: $warning-bg;
        border: 1px solid $warning-border;
        border-radius: $radius-card;

        > ul {
            margin: 0;
            padding-inline-start: $space-5;
            color: $text-secondary;
            font-size: $text-xs;
        }
    }

    &__coverage-heading {
        display: flex;
        align-items: flex-start;
        gap: $space-2;

        > svg {
            flex-shrink: 0;
            margin-block-start: 1px;
            color: $warning;
        }
    }

    &__refusals {
        display: flex;
        align-items: flex-start;
        gap: $space-2;
        padding: $space-4;
        background: $danger-bg;
        border: 1px solid $danger-border;
        border-radius: $radius-card;
        color: $danger;

        > svg {
            flex-shrink: 0;
            margin-block-start: 1px;
        }

        h3 {
            margin: 0 0 $space-2;
            color: $text-primary;
            font-size: $text-base;
        }

        ul {
            margin: 0;
            padding-inline-start: $space-5;
            color: $text-secondary;
            font-size: $text-xs;
        }
    }
}

@media (max-width: $breakpoint-md) {
    .server-restore-points {
        &__header {
            flex-direction: column;
        }

        &__actions {
            width: 100%;

            .btn {
                flex: 1;
            }
        }
    }

    .deploy-timeline--server {
        .sk-listhead {
            align-items: stretch;
        }

        .sk-seg {
            width: 100%;
            overflow-x: auto;
        }
    }

    .config-diff {
        &__point-meta {
            align-items: flex-start;
            flex-direction: column;
        }

        &__line {
            align-items: flex-start;
            flex-wrap: wrap;
        }

        &__value {
            width: 100%;
            margin-inline-start: $space-5;
            text-align: start;
        }
    }
}