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.

7.5 KB
Raw Blame
// ============================================
// MIGRATION WIZARD (Database Update)
// ============================================

.migration-wizard {
    // Extends .setup-wizard — same full-screen centered layout
}

// --------------------------------------------
// Status panel (version info)
// --------------------------------------------
.migration-status-panel {
    background: $bg-elevated;
    border: 1px solid $border-default;
    border-radius: $radius-overlay;
    padding: $space-4;
    margin-bottom: $space-4;
}

.migration-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: $space-1 0;

    &:not(:last-child) {
        border-bottom: 1px solid $border-subtle;
    }
}

.migration-status-label {
    color: $text-secondary;
    font-size: $text-xs;
}

.migration-status-value {
    font-weight: $font-weight-semibold;
    font-size: $text-xs;

    @at-root code#{&} {
        background: $bg-secondary;
        padding: $space-hair $space-2;
        border-radius: $radius-control;
        font-family: $font-family-mono;
    }
}

// Orphaned-revision warning: the database is stamped at a revision this build
// doesn't contain, so there is nothing to upgrade *to* and Continue is disabled.
.wizard-info-banner--warn {
    background: $warning-bg;
    border: 1px solid $warning-border;

    .wizard-info-icon { color: $warning; }

    code {
        font-family: $font-family-mono;
        font-size: $text-xs;
        background: $bg-secondary;
        padding: 1px $space-tight;
        border-radius: $radius-badge;
        white-space: nowrap;
    }
}

// --------------------------------------------
// Migration list (pending changes)
// --------------------------------------------
.migration-list {
    margin-bottom: $space-4;
}

// Title on the left, the show-all toggle on the right.
.migration-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: $space-3;
    margin-bottom: $space-2;
}

.migration-list-title {
    font-size: $text-xs;
    font-weight: $font-weight-semibold;
    color: $text-secondary;
}

.migration-list-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: $text-xs;
    font-weight: $font-weight-medium;
    color: $accent-primary;

    &:hover { text-decoration: underline; }
}

// Expanded, the list scrolls inside itself: an install 80 migrations behind
// must never push the Continue button off the page.
.migration-list-items {
    &.is-expanded {
        max-height: 260px;
        overflow-y: auto;
        padding-right: $space-2;
    }
}

.migration-list-more {
    margin-top: $space-2;
    font-size: $text-xs;
    color: $text-tertiary;
}

.migration-list-item {
    display: flex;
    align-items: center;
    gap: $space-3;
    padding: $space-2 $space-3;
    background: $bg-elevated;
    border: 1px solid $border-subtle;
    border-radius: $radius-card;
    font-size: $text-xs;

    &:not(:last-child) {
        margin-bottom: $space-2;
    }

    svg {
        flex-shrink: 0;
        color: $accent-primary;
    }

    code {
        font-family: $font-family-mono;
        color: $text-secondary;
        font-size: $text-xs;
    }

    span {
        color: $text-primary;
    }
}

// --------------------------------------------
// Login section (inline login for wizard)
// --------------------------------------------
.migration-login-section {
    margin-top: $space-6;
    padding-top: $space-6;
    border-top: 1px solid $border-default;
}

.migration-login-form {
    display: flex;
    flex-direction: column;
    gap: $space-3;
    max-width: 400px;

    input {
        width: 100%;
        padding: $space-3 $space-4;
        background: $bg-elevated;
        border: 1px solid $border-default;
        border-radius: $radius-card;
        font-size: $text-base;
        color: $text-primary;
        @include transition(border-color);

        &::placeholder {
            color: $text-tertiary;
        }

        &:focus {
            outline: none;
            border-color: $accent-primary;
        }
    }

    .btn-wizard-next {
        align-self: flex-start;
    }
}

.migration-error-inline {
    padding: $space-3;
    background: $danger-bg;
    border: 1px solid $danger-border;
    border-radius: $radius-card;
    color: $danger;
    font-size: $text-xs;
}

// --------------------------------------------
// Backup status
// --------------------------------------------
.migration-backup-actions {
    margin-bottom: $space-6;
}

.backup-status {
    display: flex;
    align-items: flex-start;
    gap: $space-3;
    padding: $space-4;
    border-radius: $radius-card;
    margin-bottom: $space-6;

    &--success {
        background: $success-bg;
        border: 1px solid $success-border;
        color: $success;
    }

    &--error {
        background: $danger-bg;
        border: 1px solid $danger-border;
        color: $danger;
    }

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

    strong {
        display: block;
        margin-bottom: $space-1;
    }

    code {
        display: block;
        font-size: $text-xs;
        color: $text-secondary;
        word-break: break-all;
        font-family: $font-family-mono;
    }

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

// --------------------------------------------
// Apply / progress
// --------------------------------------------
.migration-apply-actions {
    text-align: center;
    padding: $space-6 0;
}

.migration-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: $space-4;
    padding: $space-8 0;
    color: $text-secondary;

    svg {
        color: $accent-primary;
    }

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

// --------------------------------------------
// Result states
// --------------------------------------------
.migration-success {
    text-align: center;
    padding: $space-8 0;

    svg {
        color: $success;
        margin-bottom: $space-4;
    }

    h2 {
        font-size: $text-lg;
        font-weight: $font-weight-semibold;
        margin-bottom: $space-2;
    }

    p {
        color: $text-secondary;
        font-size: $text-base;
    }

    code {
        background: $bg-secondary;
        padding: $space-hair $space-2;
        border-radius: $radius-control;
        font-family: $font-family-mono;
        font-size: $text-xs;
    }
}

.migration-error {
    display: flex;
    align-items: flex-start;
    gap: $space-3;
    padding: $space-4;
    background: $danger-bg;
    border: 1px solid $danger-border;
    border-radius: $radius-card;
    margin-bottom: $space-6;

    > svg {
        flex-shrink: 0;
        color: $danger;
        margin-top: $space-hair;
    }

    strong {
        display: block;
        color: $danger;
        margin-bottom: $space-1;
    }

    span {
        display: block;
        font-size: $text-xs;
        color: $text-secondary;
    }

    .btn-wizard-prev {
        margin-left: auto;
        flex-shrink: 0;
        align-self: center;
    }
}

// --------------------------------------------
// Nav helpers
// --------------------------------------------
.migration-nav-right {
    display: flex;
    align-items: center;
    gap: $space-4;
}

.btn-text-link {
    background: none;
    border: none;
    color: $text-tertiary;
    font-size: $text-xs;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    @include transition(color);

    &:hover {
        color: $text-secondary;
    }
}

// Spin animation for loader