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.

9.5 KB
Raw Blame
// ============================================
// API Settings Styles
// ============================================

.api-settings {
    display: flex;
    flex-direction: column;
    gap: $space-6;

    .settings-card__header { align-items: center; flex-wrap: wrap; }
    .api-settings__revoke { color: $danger; }
    .stat-strip__item { background: $bg-body; }
}

// ─── Tables ────────────────────────────────────────────

// The tables are .sk-dtable; only inline code in cells is styled here.
.api-settings__table code {
    font-family: $font-mono;
    font-size: $text-xs;
    padding: $space-hair $space-tight;
    background: $bg-elevated;
    border-radius: $radius-badge;
}

.api-settings__key-name {
    font-weight: $font-weight-medium;
}

.api-settings__key-prefix {
    font-family: $font-mono;
}

.api-settings__muted {
    color: $text-tertiary;
    font-size: $text-xs;
}

.api-settings__actions {
    display: flex;
    gap: $space-1;
}

.api-settings__error-count {
    color: $danger;
    font-weight: $font-weight-semibold;
}

// ─── Rate Limits ───────────────────────────────────────

.api-settings__rate-limits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: $space-4;
    padding: $space-4;

    .form-group--inline {
        display: flex;
        flex-direction: column;
        gap: $space-1;

        label {
            font-size: $text-xs;
            font-weight: $font-weight-medium;
            color: $text-secondary;
        }
    }
}

// ─── Webhook Cards ─────────────────────────────────────

.api-settings__webhooks {
    display: flex;
    flex-direction: column;
    gap: $space-2;
    padding: $space-2;
}

.api-settings__webhook-card {
    border: 1px solid $border-subtle;
    border-radius: $radius-control;
    overflow: hidden;
}

.api-settings__webhook-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: $space-3 $space-4;
    cursor: pointer;
    transition: background 0.15s;

    &:hover {
        background: $bg-hover;
    }
}

.api-settings__webhook-info {
    display: flex;
    flex-direction: column;
    gap: $space-1;
    min-width: 0;
}

.api-settings__webhook-name {
    font-weight: $font-weight-semibold;
    color: $text-primary;
}

.api-settings__webhook-url {
    font-family: $font-mono;
    font-size: $text-xs;
    color: $text-tertiary;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.api-settings__webhook-events {
    display: flex;
    flex-wrap: wrap;
    gap: $space-1;
    margin-top: $space-1;
}

.api-settings__webhook-controls {
    display: flex;
    align-items: center;
    gap: $space-2;
    flex-shrink: 0;
}

.api-settings__webhook-details {
    border-top: 1px solid $border-subtle;
    padding: $space-3 $space-4;
}

.api-settings__webhook-actions {
    display: flex;
    gap: $space-2;
    margin-bottom: $space-3;
}

.api-settings__deliveries {
    h4 {
        font-size: $text-xs;
        color: $text-secondary;
        margin-bottom: $space-2;
    }
}

// ─── Analytics ─────────────────────────────────────────

.api-settings__period-select {
    display: flex;
    gap: $space-1;
}

.api-settings__chart {
    padding: $space-4;

    h4 {
        font-size: $text-xs;
        color: $text-secondary;
        margin-bottom: $space-3;
    }
}

.api-settings__bar-chart {
    display: flex;
    align-items: flex-end;
    gap: $space-hair;
    height: 120px;
    padding: $space-2 0;
}

.api-settings__bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    height: 100%;
    min-width: 4px;
}

.api-settings__bar {
    background: $accent-primary;
    border-radius: $radius-badge $radius-badge 0 0;
    min-height: 2px;
    transition: height 0.3s ease;

    &--error {
        background: $danger;
        border-radius: 0;
    }
}

.api-settings__top-endpoints {
    padding: $space-4;

    h4 {
        font-size: $text-xs;
        color: $text-secondary;
        margin-bottom: $space-2;
    }
}

// ─── Method Badges ─────────────────────────────────────

.badge--method {
    font-size: $text-xs;
    font-weight: $font-weight-semibold;
    padding: 1px $space-tight;
    border-radius: $radius-badge;
}

.badge--get {
    @include status-variant($success, $success-bg);
}

.badge--post {
    @include status-variant($info, $info-bg);
}

.badge--put {
    @include status-variant($warning, $warning-bg);
}

.badge--delete {
    @include status-variant($danger, $danger-bg);
}

.badge--patch {
    @include status-variant($info, $info-bg);
}

// ─── Tier Badges ───────────────────────────────────────

.badge--standard {
    background: $bg-elevated;
    color: $text-secondary;
}

.badge--elevated {
    @include status-variant($info, $info-bg);
}

.badge--unlimited {
    @include status-variant($warning, $warning-bg);
}

.badge--subtle {
    background: $bg-elevated;
    color: $text-secondary;
    font-size: $text-xs;
    padding: 1px $space-tight;
    border-radius: $radius-badge;
}

// ─── API Key Modal ─────────────────────────────────────

.api-key-modal {
    max-width: 520px;

    .api-key-modal__warning {
        display: flex;
        align-items: center;
        gap: $space-2;
        padding: $space-3;
        background: $warning-bg;
        border: 1px solid $warning-border;
        border-radius: $radius-control;
        color: $warning;
        font-size: $text-xs;
        margin-bottom: $space-4;
    }

    .api-key-modal__tiers {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: $space-2;
    }

    .api-key-modal__tier-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: $space-1;
        padding: $space-3;
        border: 1px solid $border-subtle;
        border-radius: $radius-control;
        background: transparent;
        color: $text-secondary;
        cursor: pointer;
        transition: all 0.15s;

        &:hover {
            border-color: $border-default;
            background: $bg-hover;
        }

        &.active {
            border-color: $accent-primary;
            background: fade($accent-primary-raw, 8%);
            color: $accent-primary;
        }
    }

    .api-key-modal__tier-label {
        font-weight: $font-weight-semibold;
        font-size: $text-xs;
    }

    .api-key-modal__tier-desc {
        font-size: $text-xs;
        opacity: 0.7;
    }

    .api-key-modal__scopes {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: $space-1;
        max-height: 200px;
        overflow-y: auto;
        padding: $space-2;
        border: 1px solid $border-subtle;
        border-radius: $radius-control;
    }

    .api-key-modal__scope-item {
        display: flex;
        align-items: center;
        gap: $space-2;
        font-size: $text-xs;
        padding: $space-1;
        cursor: pointer;

        &:hover {
            background: $bg-hover;
            border-radius: $radius-badge;
        }

        input[type="checkbox"] {
            accent-color: $accent-primary;
        }
    }
}

// ─── Webhook Modal ─────────────────────────────────────

.webhook-modal {
    max-width: 600px;

    .webhook-modal__events {
        max-height: 300px;
        overflow-y: auto;
        border: 1px solid $border-subtle;
        border-radius: $radius-control;
        padding: $space-2;
    }

    .webhook-modal__event-group {
        margin-bottom: $space-2;

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

    .webhook-modal__category {
        display: flex;
        align-items: center;
        gap: $space-2;
        padding: $space-1;
        cursor: pointer;
        font-size: $text-xs;

        input[type="checkbox"] {
            accent-color: $accent-primary;
        }
    }

    .webhook-modal__event-list {
        padding-left: $space-6;
    }

    .webhook-modal__event-item {
        display: flex;
        align-items: center;
        gap: $space-2;
        padding: $space-1;
        cursor: pointer;
        font-size: $text-xs;

        &:hover {
            background: $bg-hover;
            border-radius: $radius-badge;
        }

        input[type="checkbox"] {
            accent-color: $accent-primary;
        }
    }

    .webhook-modal__event-type {
        font-family: $font-mono;
        font-size: $text-xs;
        color: $text-primary;
    }

    .webhook-modal__event-desc {
        color: $text-tertiary;
        font-size: $text-xs;
    }

    .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: $space-4;
    }
}

// ─── Responsive ────────────────────────────────────────

@media (max-width: $breakpoint-md) {
    .api-settings__rate-limits {
        grid-template-columns: 1fr;
    }

    .api-key-modal__tiers {
        grid-template-columns: 1fr;
    }

    .api-key-modal__scopes {
        grid-template-columns: 1fr;
    }
}