Plugins base (#613)

* wip

* wip

* cleanup

* notification channels

* phpstan

* services

* remove server types

* refactoring

* refactoring
This commit is contained in:
Saeed Vaziry
2025-06-14 14:35:18 +02:00
committed by GitHub
parent adc0653d15
commit 131b828807
311 changed files with 3976 additions and 2660 deletions

View File

@ -1,5 +1,5 @@
export interface DynamicFieldConfig {
type: 'text' | 'select' | 'checkbox' | 'component';
type: 'text' | 'select' | 'checkbox' | 'component' | 'alert';
name: string;
options?: string[];
placeholder?: string;

View File

@ -3,7 +3,7 @@ import type { Config } from 'ziggy-js';
import type { Server } from '@/types/server';
import { Project } from '@/types/project';
import { User } from '@/types/user';
import { Site } from '@/types/site';
import { Site, SiteType } from '@/types/site';
import { DynamicFieldConfig } from './dynamic-field-config';
export interface Auth {
@ -34,42 +34,69 @@ export interface NavItem {
}
export interface Configs {
server_providers: string[];
server_providers_custom_fields: {
[provider: string]: string[];
};
source_control_providers: string[];
source_control_providers_custom_fields: {
[provider: string]: string[];
};
storage_providers: string[];
storage_providers_custom_fields: {
[provider: string]: string[];
};
notification_channels_providers: string[];
notification_channels_providers_custom_fields: {
[provider: string]: string[];
};
operating_systems: string[];
service_versions: {
[service: string]: string[];
};
service_types: {
[service: string]: string;
};
colors: string[];
webservers: string[];
databases: string[];
php_versions: string[];
site_types: string[];
site_types_custom_fields: {
[type: string]: DynamicFieldConfig[];
};
cronjob_intervals: {
[key: string]: string;
};
metrics_periods: string[];
php_extensions: string[];
server_provider: {
providers: {
[provider: string]: {
label: string;
handler: string;
form?: DynamicFieldConfig[];
};
};
};
storage_provider: {
providers: {
[provider: string]: {
label: string;
handler: string;
form?: DynamicFieldConfig[];
};
};
};
source_control: {
providers: {
[provider: string]: {
label: string;
handler: string;
form?: DynamicFieldConfig[];
};
};
};
notification_channel: {
providers: {
[channel: string]: {
label: string;
handler: string;
form?: DynamicFieldConfig[];
};
};
};
service: {
services: {
[name: string]: {
label: string;
type: string;
handler: string;
form?: DynamicFieldConfig[];
versions: string[];
data?: {
extensions?: string[];
};
};
};
};
site: {
types: {
[type: string]: SiteType;
};
};
[key: string]: unknown;
}
@ -79,13 +106,12 @@ export interface SharedData {
quote: { message: string; author: string };
auth: Auth;
ziggy: Config & { location: string };
sidebarOpen: boolean;
configs: Configs;
projectServers: Server[];
serverSites?: Site[];
project_servers: Server[];
server_sites?: Site[];
server?: Server;
site?: Site;
publicKeyText: string;
public_key_text: string;
flash?: {
success: string;
error: string;

View File

@ -1,4 +1,5 @@
import { Server } from '@/types/server';
import { DynamicFieldConfig } from '@/types/dynamic-field-config';
export interface Site {
id: number;
@ -10,7 +11,6 @@ export interface Site {
method?: 'round-robin' | 'least-connections' | 'ip-hash';
[key: string]: unknown;
};
features: string[];
domain: string;
aliases?: string[];
web_directory: string;
@ -32,3 +32,25 @@ export interface Site {
[key: string]: unknown;
}
export interface SiteType {
label: string;
handler: string;
form?: DynamicFieldConfig[];
features?: SiteFeature[];
}
export interface SiteFeature {
label: string;
description?: string;
actions?: {
[key: string]: SiteFeatureAction;
};
}
export interface SiteFeatureAction {
label: string;
handler: string;
form?: DynamicFieldConfig[];
active?: boolean;
}

View File

@ -1,6 +1,7 @@
export interface Worker {
id: number;
server_id: number;
name: string;
command: string;
user: string;
auto_start: boolean;