refactor web project structure

This commit is contained in:
Oliver Kieselbach
2026-04-14 09:49:02 +02:00
parent 665a9a14cc
commit 91ba78c19b
5 changed files with 36 additions and 63 deletions
@@ -4,33 +4,10 @@ import { createContext, useCallback, useContext, useEffect, useState } from "rea
import { useAuth } from "../../contexts/AuthContext";
import { api } from "@/lib/api";
import { authenticatedFetch, TokenExpiredError } from "@/lib/authenticatedFetch";
import type { AdminConfiguration, OpsAlertRule } from "@/types/adminConfig";
// Re-export for section components
export interface AdminConfiguration {
partitionKey: string;
rowKey: string;
lastUpdated: string;
updatedBy: string;
globalRateLimitRequestsPerMinute: number;
platformStatsBlobSasUrl?: string;
collectorIdleTimeoutMinutes?: number;
maxSessionWindowHours?: number;
maintenanceBlockDurationHours?: number;
opsEventRetentionDays?: number;
diagnosticsGlobalLogPathsJson?: string;
customSettings?: string;
nvdApiKey?: string;
vulnerabilityCorrelationEnabled?: boolean;
vulnerabilityDataLastSyncUtc?: string;
// Ops Alert settings
opsAlertRulesJson?: string;
opsAlertTelegramEnabled?: boolean;
opsAlertTelegramChatId?: string;
opsAlertTeamsEnabled?: boolean;
opsAlertTeamsWebhookUrl?: string;
opsAlertSlackEnabled?: boolean;
opsAlertSlackWebhookUrl?: string;
}
// Re-export so existing `import { AdminConfiguration } from "../AdminConfigContext"` consumers keep working
export type { AdminConfiguration, OpsAlertRule };
interface AdminConfigContextValue {
// Admin config
@@ -103,12 +80,6 @@ interface AdminConfigContextValue {
import { type DiagnosticsLogPath } from "./components/DiagnosticsLogPathsSection";
import { type TenantConfiguration } from "./components/TenantManagementSection";
export interface OpsAlertRule {
eventType: string;
minSeverity: string;
enabled: boolean;
}
const AdminConfigContext = createContext<AdminConfigContextValue | null>(null);
export function useAdminConfig() {
@@ -1,19 +1,6 @@
"use client";
interface AdminConfiguration {
partitionKey: string;
rowKey: string;
lastUpdated: string;
updatedBy: string;
globalRateLimitRequestsPerMinute: number;
platformStatsBlobSasUrl?: string;
collectorIdleTimeoutMinutes?: number;
maxSessionWindowHours?: number;
maintenanceBlockDurationHours?: number;
opsEventRetentionDays?: number;
diagnosticsGlobalLogPathsJson?: string;
customSettings?: string;
}
import type { AdminConfiguration } from "@/types/adminConfig";
interface AdminConfigSettingsSectionProps {
loadingConfig: boolean;
@@ -4,23 +4,7 @@ import { useCallback, useState } from "react";
import { api } from "@/lib/api";
import { authenticatedFetch, TokenExpiredError } from "@/lib/authenticatedFetch";
import SaveResetBar from "../../settings/components/SaveResetBar";
interface AdminConfiguration {
partitionKey: string;
rowKey: string;
lastUpdated: string;
updatedBy: string;
globalRateLimitRequestsPerMinute: number;
platformStatsBlobSasUrl?: string;
collectorIdleTimeoutMinutes?: number;
maxSessionWindowHours?: number;
maintenanceBlockDurationHours?: number;
diagnosticsGlobalLogPathsJson?: string;
customSettings?: string;
nvdApiKey?: string;
vulnerabilityCorrelationEnabled?: boolean;
vulnerabilityDataLastSyncUtc?: string;
}
import type { AdminConfiguration } from "@/types/adminConfig";
interface VulnerabilityDataSectionProps {
adminConfig: AdminConfiguration | null;
@@ -0,0 +1,30 @@
export interface AdminConfiguration {
partitionKey: string;
rowKey: string;
lastUpdated: string;
updatedBy: string;
globalRateLimitRequestsPerMinute: number;
platformStatsBlobSasUrl?: string;
collectorIdleTimeoutMinutes?: number;
maxSessionWindowHours?: number;
maintenanceBlockDurationHours?: number;
opsEventRetentionDays?: number;
diagnosticsGlobalLogPathsJson?: string;
customSettings?: string;
nvdApiKey?: string;
vulnerabilityCorrelationEnabled?: boolean;
vulnerabilityDataLastSyncUtc?: string;
opsAlertRulesJson?: string;
opsAlertTelegramEnabled?: boolean;
opsAlertTelegramChatId?: string;
opsAlertTeamsEnabled?: boolean;
opsAlertTeamsWebhookUrl?: string;
opsAlertSlackEnabled?: boolean;
opsAlertSlackWebhookUrl?: string;
}
export interface OpsAlertRule {
eventType: string;
minSeverity: string;
enabled: boolean;
}
@@ -1,2 +1,3 @@
export type { Session } from "./session";
export type { EnrollmentEvent, RuleResult } from "./enrollment";
export type { AdminConfiguration, OpsAlertRule } from "./adminConfig";