#591 - sites [wip]

This commit is contained in:
Saeed Vaziry
2025-05-25 22:17:19 +02:00
parent ff11fb44e0
commit f5fdbae4ac
77 changed files with 2156 additions and 414 deletions

View File

@ -1,6 +1,9 @@
import { Backup } from '@/types/backup';
export interface BackupFile {
id: number;
backup_id: number;
backup: Backup;
server_id: number;
name: string;
size: number;

View File

@ -0,0 +1,9 @@
export interface DynamicFieldConfig {
type: 'text' | 'select' | 'checkbox' | 'component';
name: string;
options?: string[];
placeholder?: string;
description?: string;
label?: string;
default?: string | number | boolean;
}

View File

@ -3,6 +3,8 @@ 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 { DynamicFieldConfig } from './dynamic-field-config';
export interface Auth {
user: User;
@ -54,6 +56,10 @@ export interface Configs {
webservers: string[];
databases: string[];
php_versions: string[];
site_types: string[];
site_types_custom_fields: {
[type: string]: DynamicFieldConfig[];
};
cronjob_intervals: {
[key: string]: string;
};
@ -69,7 +75,9 @@ export interface SharedData {
sidebarOpen: boolean;
configs: Configs;
projectServers: Server[];
serverSites?: Site[];
server?: Server;
site?: Site;
publicKeyText: string;
flash?: {
success: string;
@ -81,3 +89,27 @@ export interface SharedData {
[key: string]: unknown;
}
export interface PaginatedData<TData> {
data: TData[];
links: PaginationLinks;
meta: PaginationMeta;
}
export interface PaginationLinks {
first: string | null;
last: string | null;
prev: string | null;
next: string | null;
}
export interface PaginationMeta {
current_page: number;
current_page_url: string;
from: number | null;
path: string;
per_page: number;
to: number | null;
total?: number;
last_page?: number;
}

26
resources/js/types/site.d.ts vendored Normal file
View File

@ -0,0 +1,26 @@
import { Server } from '@/types/server';
export interface Site {
id: number;
server_id: number;
server?: Server;
source_control_id: string;
type: string;
type_data: unknown;
domain: string;
aliases?: string[];
web_directory: string;
path: string;
php_version: string;
repository: string;
branch: string;
status: string;
status_color: 'gray' | 'success' | 'info' | 'warning' | 'danger';
port: number;
user: string;
url: string;
progress: number;
created_at: string;
updated_at: string;
[key: string]: unknown;
}