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.

17.1 KB
Raw Blame
// VS Code-style global chrome. Ambient controls live on one persistent bottom
// edge; their detail surfaces open directly above it instead of floating over
// unrelated page controls.

.global-statusbar {
    position: fixed;
    inset-inline: $sidebar-width 0;
    inset-block-end: 0;
    z-index: $z-shell-statusbar;
    display: flex;
    align-items: center;
    height: var(--sk-statusbar-height);
    gap: $space-hair;
    padding-inline: $space-tight;
    // Same chrome surface and edge as the sidebar and top bar.
    border-block-start: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-faint);
    font-family: $font-main;
    font-size: $text-xs;

    &__segment,
    .statusbar-select {
        display: inline-flex;
        align-items: center;
        height: 22px; // geometry: fixed 22px status-bar segment (chrome)
        min-width: 0;
        gap: $space-2;
        padding-inline: $space-2;
        border: 0;
        border-radius: $radius-control;
        background: transparent;
        color: var(--text-faint);
        font: inherit;
        white-space: nowrap;
        transition: color 120ms ease, background-color 120ms ease;
    }

    &__segment {
        cursor: pointer;
        @include focus-ring();

        &:hover { color: var(--text-dim); background: var(--surface-3); }
        &.is-active { color: var(--accent-bright); background: var(--accent-bg); }
    }

    &__separator {
        width: 1px;
        height: 12px;
        flex: 0 0 auto;
        background: var(--border-soft);
    }

    &__spacer {
        flex: 1;
        min-width: $space-2;
    }

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

    &__segment.is-active &__muted {
        color: var(--accent-bright);
        opacity: 0.76;
    }

    &__dot,
    &__pip {
        display: inline-block;
        flex: 0 0 auto;
        border-radius: 50%;
    }

    &__dot {
        width: 6px;
        height: 6px;

        &.is-online { background: var(--green); }
        &.is-idle { background: var(--amber); }
        &.is-down { background: var(--red); }
    }

    &__pip {
        width: 5px;
        height: 5px;

        &.is-warning { background: var(--amber); }
        &.is-critical { background: var(--red); }
    }

    &__setup {
        progress {
            width: 34px;
            height: 3px;
            overflow: hidden;
            border: 0;
            border-radius: $radius-full;
            background: var(--surface-3);
            appearance: none;

            &::-webkit-progress-bar { background: var(--surface-3); }
            &::-webkit-progress-value { background: var(--amber); }
            &::-moz-progress-bar { background: var(--amber); }
        }

        svg { color: var(--amber); }
    }

    &__command { padding-inline: 7px; }
    &__mobile-icon { display: none; }
}

.statusbar-select {
    cursor: pointer;
    @include focus-ring();

    &:hover { color: var(--text-dim); background: var(--surface-3); }

    &.is-open { color: var(--text); background: var(--surface-3); }

    &--workspace { color: var(--text-dim); }

    &__value {
        max-width: 170px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    > svg:last-of-type { opacity: 0.58; }
}

// Anchor wrapper: the trigger stays in the bar's flex row, the menu floats
// above it. Both scope menus share the anchor class so one outside-click
// listener can tell "inside a popover" from "anywhere else".
.statusbar-popover {
    position: relative;
    display: inline-flex;
    min-width: 0;
}

// Prototype env-menu, themed: dark card, dot · name · meta rows, check on the
// current row. Replaces the native select popup that ignored the theme.
.statusbar-menu {
    position: absolute;
    inset-block-end: calc(100% + 8px);
    inset-inline-start: 0;
    z-index: 2;
    min-width: 280px;
    max-height: min(46vh, 380px);
    overflow-y: auto;
    padding: $space-tight;
    border: 1px solid var(--border-strong);
    border-radius: $radius-overlay;
    background: var(--surface-2);
    box-shadow: $shadow-raised;
    animation: statusbar-menu-enter 140ms ease-out;

    &--wide { min-width: 308px; }

    &__head {
        padding: $space-2 $space-3 $space-tight;
        color: var(--text-ghost);
        font-size: $text-xs;
        font-weight: $font-weight-medium;
    }

    &__option {
        display: flex;
        align-items: center;
        width: 100%;
        gap: $space-3;
        padding: $space-2 $space-3;
        border: 0;
        border-radius: $radius-card;
        background: transparent;
        color: var(--text);
        font: inherit;
        text-align: start;
        cursor: pointer;
        transition: background-color 100ms ease;
        @include focus-ring();

        &:hover { background: var(--surface-3); }
    }

    &__swatch {
        width: 9px;
        height: 9px;
        flex: 0 0 auto;
        border-radius: 50%;
        background: var(--accent);

        &.is-ghost { background: var(--text-ghost); }
        &.is-online { background: var(--green); }
        &.is-idle { background: var(--amber); }
        &.is-down { background: var(--red); }
    }

    &__copy {
        display: flex;
        min-width: 0;
        flex: 1;
        flex-direction: column;
    }

    &__name {
        overflow: hidden;
        font-size: $text-sm;
        font-weight: $font-weight-semibold;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    &__meta {
        margin-block-start: 1px;
        color: var(--text-faint);
        font-size: $text-xs;
    }

    &__check {
        flex: 0 0 auto;
        color: var(--accent-bright);
    }
}

@keyframes statusbar-menu-enter {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
}

// Shared bottom panel shell (Alerts; Operations and Recipes receive matching
// geometry through their statusbar-mode overrides below).
.shell-panel {
    position: fixed;
    inset-inline: $sidebar-width 0;
    inset-block-end: var(--sk-statusbar-height);
    z-index: $z-shell-panel;
    display: flex;
    height: min(320px, 56vh);
    min-height: 220px;
    flex-direction: column;
    overflow: hidden;
    border-block-start: 1px solid var(--border-strong);
    background: var(--surface);
    box-shadow: $shadow-overlay;
    animation: shell-panel-enter 160ms ease-out;

    &.is-expanded { height: min(62vh, 720px); }

    &__head,
    &__footer,
    &__filters {
        display: flex;
        align-items: center;
    }

    &__head {
        min-height: 38px; // geometry: dock header strip (chrome), holds 28px controls
        flex: 0 0 auto;
        gap: $space-2;
        padding-inline: $space-2 $space-2;
        border-block-end: 1px solid var(--border-soft);
    }

    // Secondary row under the shared tab strip: per-panel view filters plus
    // panel-scoped actions (prototype cp-filters).
    &__filters {
        flex: 0 0 auto;
        gap: $space-hair;
        padding: $space-tight $space-2;
        border-block-end: 1px solid var(--border-soft);
    }

    &__filters button,
    &__action {
        min-height: $control-sm;
        border: 0;
        border-radius: $radius-badge;
        background: transparent;
        color: var(--text-ghost);
        font-size: $text-xs;
        white-space: nowrap;
        cursor: pointer;
        @include focus-ring();

        &:hover { color: var(--text-dim); background: var(--surface-2); }
    }

    &__filters button {
        padding-inline: $space-2;
        &.is-active { color: var(--text-dim); background: var(--surface-3); }
    }

    &__action {
        display: inline-flex;
        align-items: center;
        gap: $space-1;
        padding-inline: $space-2;
        color: var(--text-faint);
    }

    &__spacer { flex: 1; }

    &__empty {
        display: grid;
        flex: 1;
        place-items: center;
        color: var(--text-faint);
        font-size: $text-xs;
    }

    &__footer {
        min-height: 34px; // geometry: dock footer strip (chrome)
        justify-content: space-between;
        gap: $space-3;
        padding-inline: $space-4;
        border-block-start: 1px solid var(--border-soft);
        color: var(--text-ghost);
        font-size: $text-xs;

        button {
            border: 0;
            background: transparent;
            color: var(--accent-bright);
            font: inherit;
            cursor: pointer;
        }
    }
}

// The console's shared header strip: the four surface tabs plus the
// expand/close controls. Rendered by every panel so switching consoles feels
// like flipping tabs on one panel (prototype cp-head/cp-tabs).
.shell-dock-tabs {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: $space-hair;

    &__tab {
        display: inline-flex;
        align-items: center;
        gap: $space-2;
        height: $control-sm;
        padding: 0 $space-3;
        border: 0;
        border-radius: $radius-control;
        background: transparent;
        color: var(--text-faint);
        font-size: $text-sm;
        white-space: nowrap;
        cursor: pointer;
        transition: color 120ms ease, background-color 120ms ease;
        @include focus-ring();

        &:hover { color: var(--text-dim); background: var(--surface-2); }
        &.is-active { color: var(--text); background: var(--surface-3); }
    }

    &__badge {
        padding: 1px $space-tight;
        border-radius: $radius-badge;
        font-size: $text-xs;
        @include status-variant(var(--accent-bright), var(--accent-bg));
    }

    &__spacer { flex: 1; min-width: $space-2; }

    &__control {
        display: grid;
        width: $control-sm;
        height: $control-sm;
        flex: 0 0 auto;
        place-items: center;
        border: 0;
        border-radius: $radius-control;
        background: transparent;
        color: var(--text-faint);
        cursor: pointer;
        @include focus-ring();

        &:hover { color: var(--text); background: var(--surface-3); }
    }

    // The refresh IconButton passed in as a control matches the square look.
    .icon-button {
        width: $control-sm;
        height: $control-sm;
        border: 0;
        background: transparent;
    }
}

.shell-alerts {
    &__list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    &__row {
        display: flex;
        min-width: 0;
        border-block-end: 1px solid var(--border-soft);

        &.is-read { opacity: 0.5; }
    }

    &__hit {
        display: grid;
        grid-template-columns: 7px minmax(0, 1fr) auto;
        align-items: center;
        width: 100%;
        min-width: 0;
        gap: $space-3;
        padding: $space-2 $space-3;
        border: 0;
        background: transparent;
        color: var(--text);
        text-align: start;
        cursor: pointer;

        &:hover { background: var(--surface-2); }
    }

    &__dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--text-faint);

        .is-critical & { background: var(--red); }
        .is-warning & { background: var(--amber); }
        .is-success & { background: var(--green); }
        .is-info & { background: var(--cyan); }
    }

    &__copy {
        display: flex;
        min-width: 0;
        flex-direction: column;

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

        strong { font-size: $text-sm; font-weight: $font-weight-medium; }
        span { margin-block-start: 1px; color: var(--text-ghost); font-size: $text-xs; }
    }

    &__meta {
        color: var(--text-ghost);
        font-size: $text-xs;
        white-space: nowrap;
    }

    &__dismiss {
        display: grid;
        width: 34px;
        flex: 0 0 auto;
        place-items: center;
        border: 0;
        background: transparent;
        color: var(--text-ghost);
        cursor: pointer;

        &:hover { color: var(--text); background: var(--surface-2); }
    }
}

// Existing real operation UI, reflowed into the same bottom console geometry.
.operations-dock.operations-dock--statusbar {
    inset-inline: $sidebar-width 0;
    inset-block-end: var(--sk-statusbar-height);
    z-index: $z-shell-panel;

    &.is-collapsed { display: none; }

    .operations-dock__panel {
        grid-template-areas:
            'header header'
            'tabs detail'
            'list detail';
        grid-template-columns: 344px minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr);
        width: 100%;
        height: min(320px, 56vh);
        border: 0;
        border-block-start: 1px solid var(--border-strong);
        border-radius: 0;
        box-shadow: $shadow-overlay;
        animation: shell-panel-enter 160ms ease-out;
    }

    .operations-dock__panel.is-expanded { height: min(62vh, 720px); }

    .operations-dock__header {
        grid-area: header;
        min-height: 38px; // geometry: dock header strip (chrome), holds 28px controls
        padding: 0 $space-2;
        border-block-end: 1px solid var(--border-soft);
    }
    .operations-dock__tabs { grid-area: tabs; }
    .operations-dock__list { grid-area: list; border-inline-end: 1px solid var(--border-soft); border-block-end: 0; }
    .operations-dock__detail { grid-area: detail; }
}

// Leave the shared shell edge visible while the assistant is docked right.
.dashboard-layout .sk-ai-drawer {
    inset-block-end: var(--sk-statusbar-height);
}

// The status bar spans only the content column (inset-inline starts at the
// sidebar edge), so the sidebar keeps its full 100vh height — shortening it
// here left a dead 30px hole under the user card. Mobile is different: the
// bar goes full-width there, so the drawer override below still applies.
.dashboard-layout .main-content {
    padding-block-end: calc(#{$space-10} + var(--sk-statusbar-height));

    &--full-page,
    &:has(.workflow-page.fullscreen),
    &:has(.page-container--full-bleed) {
        height: calc(100vh - var(--sk-statusbar-height));
        padding-block-end: 0;
    }
}

@media (min-width: ($breakpoint-md + 1)) {
    [data-layout='rail'] {
        .global-statusbar,
        .shell-panel,
        .operations-dock.operations-dock--statusbar {
            inset-inline-start: $sidebar-rail-width;
            transition: inset-inline-start 0.18s $ease-out-quint;
        }

        .sidebar:hover,
        .sidebar:focus-within {
            ~ .global-statusbar,
            ~ .shell-panel,
            ~ .operations-dock.operations-dock--statusbar {
                inset-inline-start: $sidebar-width;
            }
        }
    }

    [data-layout='topbar'] {
        .global-statusbar,
        .shell-panel,
        .operations-dock.operations-dock--statusbar {
            inset-inline-start: 0;
        }

        .main-content--full-page,
        .main-content:has(.workflow-page.fullscreen),
        .main-content:has(.page-container--full-bleed) {
            height: calc(100vh - #{$header-height} - var(--sk-statusbar-height));
        }
    }
}

@media (max-width: $breakpoint-md) {
    .dashboard-layout { --sk-statusbar-height: 36px; }

    .global-statusbar,
    .shell-panel,
    .operations-dock.operations-dock--statusbar {
        inset-inline: 0;
    }

    .global-statusbar {
        justify-content: space-around;
        padding-inline: max($space-1, env(safe-area-inset-left)) max($space-1, env(safe-area-inset-right));

        &__segment,
        .statusbar-select { justify-content: center; min-width: 32px; padding-inline: 7px; }

        &__segment > span:not(.global-statusbar__pip),
        .statusbar-select__value,
        .statusbar-select > svg:last-of-type,
        &__setup,
        &__command { display: none; }

        &__spacer { display: none; }
        &__mobile-icon { display: block; }
    }

    .operations-dock.operations-dock--statusbar .operations-dock__panel {
        grid-template-areas:
            'header'
            'tabs'
            'list'
            'detail';
        grid-template-columns: 1fr;
        grid-template-rows: auto auto minmax(80px, 0.7fr) minmax(0, 1.3fr);
        height: min(68vh, 620px);
    }

    .operations-dock.operations-dock--statusbar .operations-dock__list {
        border-inline-end: 0;
        border-block-end: 1px solid var(--border-soft);
    }

    .shell-panel { height: min(68vh, 620px); }

    .dashboard-layout .sidebar { height: calc(100dvh - var(--sk-statusbar-height)); }

    .dashboard-layout .main-content {
        padding-block-end: calc(#{$space-5} + var(--sk-statusbar-height));

        &--full-page,
        &:has(.workflow-page.fullscreen),
        &:has(.page-container--full-bleed) {
            height: calc(100dvh - #{$mobile-header-height} - env(safe-area-inset-top) - var(--sk-statusbar-height));
        }
    }
}

@keyframes shell-panel-enter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .shell-panel,
    .operations-dock.operations-dock--statusbar .operations-dock__panel { animation: none; }

    [data-layout='rail'] {
        .global-statusbar,
        .shell-panel,
        .operations-dock.operations-dock--statusbar { transition: none; }
    }
}