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.0 KB
Raw Blame
// ============================================
// CRON JOBS PAGE (redesign — infra console look)
// ============================================

.cron-page {
    .cron-servicenote {
        font-size: $text-xs;
        color: var(--amber);
    }

    .cron-tznote {
        display: flex;
        align-items: center;
        gap: $space-2;
        margin-top: $space-3;
        font-size: $text-xs;
        color: var(--text-faint);

        svg { flex-shrink: 0; }
    }

    // ── jobs table ──────────────────────────────────────────
    .cron-empty {
        padding: $space-10;
        text-align: center;
        color: var(--text-faint);
        font-size: $text-sm;
        background: var(--surface);
        border: 1px solid var(--border-soft);
        border-radius: var(--radius);
    }

    // `.cron-table` is the DataTable wrap; column widths live on the column
    // definitions in CronJobs.jsx.
    .cron-table {
        .is-disabled {
            opacity: 0.55;

            .cron-ico {
                background: var(--surface-3);
                color: var(--text-faint);
            }
        }
    }

    .cron-cell-mono {
        font-family: var(--mono);
        font-size: $text-xs;
        color: var(--text-dim);
        white-space: nowrap;
    }

    .cron-cell-actions { text-align: right; white-space: nowrap; }

    .cron-switch { display: inline-flex; }

    // job cell: accent icon tile + name / description / mono command
    .cron-ico {
        width: 30px;
        height: 30px; // geometry: icon tile
        border-radius: $radius-card;
        display: grid;
        place-items: center;
        flex-shrink: 0;
        @include status-variant(var(--accent-bright), var(--accent-bg));
    }

    .cron-jobcell {
        min-width: 0;

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

        &__desc {
            margin-top: $space-hair;
            font-size: $text-xs;
            font-weight: $font-weight-normal;
            color: var(--text-dim);
        }

        &__cmd {
            max-width: 460px;
            font-weight: $font-weight-normal;
            @include truncate();
        }
    }

    // schedule expression chip + readable hint
    .cron-sched {
        display: inline-flex;
        align-items: center;
        gap: $space-tight;
        padding: $space-hair $space-2;
        font-family: var(--mono);
        font-size: $text-xs;
        color: var(--text-dim);
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: $radius-control;
        white-space: nowrap;

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

    .cron-sched-readable {
        margin-top: $space-1;
        font-size: $text-xs;
        color: var(--text-faint);
    }

    @media (max-width: $breakpoint-md) {
        .cron-table .sk-dtable { min-width: 860px; }
    }
}

// ── Portalled surfaces ──────────────────────────────────────
// The modals (Radix Dialog) and the job drawer (Radix Sheet) both render into
// <body>, NOT inside .cron-page — so every rule below has to stay top-level or
// it silently matches nothing.

// create/edit modal (field labels → mono eyebrows)

.run-output {
    display: flex;
    flex-direction: column;
    gap: $space-4;
}

.run-output-exit {
    display: flex;
    align-items: center;
    gap: $space-3;
}

.run-output-label {
    font-size: $text-xs;
    font-weight: $font-weight-semibold;
    color: var(--text-faint);
}

.run-output-section {
    display: flex;
    flex-direction: column;
    gap: $space-2;
}

.run-output-pre {
    margin: 0;
    padding: $space-3 $space-4;
    font-family: var(--mono);
    font-size: $text-xs;
    line-height: 1.62;
    background: var(--bg-code);
    color: var(--text-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    @include custom-scrollbar();

    &--error {
        color: var(--red);
        border-color: rgba(251, 111, 111, 0.28);
    }
}

// spinner inside the run-now button (list row + drawer header)

// ── Job drawer (row click) ──────────────────────────────────
.cron-drawer__headeractions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: $space-2;
    padding-right: $space-8;    // clear the sheet's close button
}

.cron-drawer {
    // Inset comes from .sk-drawer__body (padded by default).
    display: flex;
    flex-direction: column;
    gap: $space-5;

    &__section {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: $space-3;
    }

    &__sectiontitle {
        margin: 0;
        font-size: $text-base;
        font-weight: $font-weight-semibold;
        color: var(--text);
    }

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

    &__info {
        background: var(--surface);
        border: 1px solid var(--border-soft);
        border-radius: var(--radius);
        padding: $space-2 $space-4;
    }

    &__tracking {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: $space-3;
    }

    &__table {
        background: var(--surface);
        border: 1px solid var(--border-soft);
        border-radius: var(--radius);
        overflow: hidden;
    }

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

    &__danger {
        padding-top: $space-4;
        border-top: 1px solid var(--border-soft);
    }
}

.cron-inforow {
    display: flex;
    align-items: baseline;
    gap: $space-4;
    padding: $space-2 0;
    border-top: 1px solid var(--border-soft);

    &:first-child { border-top: 0; }

    .k {
        flex: 0 0 118px;
        font-size: $text-xs;
        font-weight: $font-weight-semibold;
        color: var(--text-faint);
    }

    .v {
        flex: 1;
        min-width: 0;
        font-size: $text-sm;
        color: var(--text);
        word-break: break-word;
    }

    &__cmd {
        font-family: var(--mono);
        font-size: $text-xs;
    }
}

.cron-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: $space-3;

    @media (max-width: $breakpoint-sm) { grid-template-columns: 1fr; }
}

.cron-spec {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: $space-3 $space-4;

    .l {
        font-size: $text-xs;
        font-weight: $font-weight-semibold;
        color: var(--text-faint);
    }

    .v {
        margin-top: $space-1;
        font-size: $text-base;
        font-weight: $font-weight-semibold;
        color: var(--text);

        // Success-rate tone (mirrors .dom-expiry--<tone> on /domains).
        &--good { color: var(--green); }
        &--warn { color: var(--amber); }
        &--bad { color: var(--red); }
    }

    .s {
        margin-top: $space-2;
        font-size: $text-xs;
        color: var(--text-faint);
    }
}

.cron-exit--bad { color: var(--red); }

// ============================================
// SCHEDULED TASKS CARD (read-only cron summary
// on the service + WordPress detail Overview tabs)
// ============================================
.scheduled-tasks-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: $space-4;

    &__header {
        display: flex;
        align-items: center;
        gap: $space-2;
        margin-bottom: $space-3;
        font-size: $text-sm;
        font-weight: $font-weight-semibold;
        color: var(--text);

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

    &__loading,
    &__empty {
        padding: $space-2 0;
        font-size: $text-sm;
        color: var(--text-faint);
    }

    &__list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    &__row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: $space-3;
        padding: $space-3 0;
        border-top: 1px solid var(--border-soft);

        &:first-child { border-top: 0; }
    }

    &__main {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: $space-hair;
    }

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

    &__sched {
        font-size: $text-xs;
        color: var(--text-dim);
    }

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

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

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

    &__status {
        flex-shrink: 0;

        &--ok { color: var(--green); }
        &--bad { color: var(--red); }
    }

    &__status-hint {
        font-size: $text-xs;
        color: var(--text-faint);
        white-space: nowrap;
    }

    &__runs-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: $space-1;
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-sm, $radius-control);
        background: transparent;
        color: var(--text-faint);
        cursor: pointer;
        flex-shrink: 0;

        &:hover {
            color: var(--text);
            border-color: var(--border);
        }
    }
}

.scheduled-tasks-runs {
    display: flex;
    flex-direction: column;
    gap: $space-3;

    &__empty {
        font-size: $text-sm;
        color: var(--text-faint);
    }

    &__rate {
        font-size: $text-sm;
        color: var(--text-dim);
    }

    &__count { color: var(--text-faint); }

    &__list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    &__item {
        display: flex;
        align-items: center;
        gap: $space-2;
        padding: $space-2 0;
        border-top: 1px solid var(--border-soft);
        font-size: $text-xs;
        color: var(--text-dim);

        &:first-child { border-top: 0; }
    }

    &__when { white-space: nowrap; }
    &__dur,
    &__exit {
        font-size: $text-xs;
        color: var(--text-faint);
    }
    &__exit { font-family: var(--mono); }
}

// ============================================
// CRON CREATE / EDIT DRAWER
// The form fields around the shared <SchedulePicker/>; the picker brings its
// own styling (components/_schedule-picker.scss).
// ============================================
.cron-form {
    display: flex;
    flex-direction: column;
    gap: $space-5;
    // `.sk-drawer__body` is the scroll region and carries no padding of its own
    // (some drawers are edge-to-edge), so every drawer body pads itself. Same
    // inset as .cron-drawer so the two cron drawers line up.
    padding: $space-5 $space-5 $space-8;

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

        > label {
            font-size: $text-xs;
            font-weight: $font-weight-medium;
            color: var(--text-dim);
        }
    }

    &__input {
        width: 100%;
        padding: $space-2 $space-3;
        font-size: $text-sm;
        color: var(--text);
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: $radius-control;
        outline: none;

        &:not(textarea) {
            height: $control-md;
            padding-block: 0;
        }

        &::placeholder { color: var(--text-ghost); }

        &:focus {
            border-color: var(--accent);
            box-shadow: $focus-ring;
        }

        &--mono {
            font-family: var(--mono);
            font-size: $text-sm;
        }
    }

    &__textarea {
        resize: vertical;
        min-height: 56px;
    }

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

    &__entry {
        margin: 0;
        padding: $space-3 $space-3;
        overflow-x: auto;
        font-family: var(--mono);
        font-size: $text-xs;
        line-height: 1.5;
        color: var(--text-dim);
        white-space: pre;
        background: var(--bg-terminal, var(--surface-3));
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
    }

    &__actions {
        display: flex;
        align-items: center;
        gap: $space-3;
        padding-top: $space-2;

        // Cancel sits left, the commit button right — same footer shape as the
        // rest of the drawers.
        > :last-child { margin-left: auto; }
    }
}