- Add normalizeId helper to compare local filenames with script slugs/names - Include install_basenames from install_methods for robust matching - Fix false 'Not Downloaded' status for PVE Host scripts like 'PVE LXC Execute Command' - Update DownloadedScriptsTab and ScriptsGrid to use normalized comparisons - Resolves issue where scripts with underscores in filenames (e.g., pbs_microcode.sh) weren't matching JSON slugs with hyphens (e.g., pbs-microcode)
80 lines
1.6 KiB
TypeScript
80 lines
1.6 KiB
TypeScript
export interface ScriptResources {
|
|
cpu: number;
|
|
ram: number;
|
|
hdd: number;
|
|
os: string;
|
|
version: string;
|
|
}
|
|
|
|
export interface ScriptInstallMethod {
|
|
type: string;
|
|
script: string;
|
|
resources: ScriptResources;
|
|
}
|
|
|
|
export interface ScriptCredentials {
|
|
username: string | null;
|
|
password: string | null;
|
|
}
|
|
|
|
export interface ScriptNote {
|
|
text: string;
|
|
type: string;
|
|
}
|
|
|
|
export interface Script {
|
|
name: string;
|
|
slug: string;
|
|
categories: number[];
|
|
date_created: string;
|
|
type: string;
|
|
updateable: boolean;
|
|
privileged: boolean;
|
|
interface_port: number | null;
|
|
documentation: string | null;
|
|
website: string | null;
|
|
logo: string | null;
|
|
config_path: string;
|
|
description: string;
|
|
install_methods: ScriptInstallMethod[];
|
|
default_credentials: ScriptCredentials;
|
|
notes: (ScriptNote | string)[];
|
|
}
|
|
|
|
export interface ScriptCard {
|
|
name: string;
|
|
slug: string;
|
|
description: string;
|
|
logo: string | null;
|
|
type: string;
|
|
updateable: boolean;
|
|
website: string | null;
|
|
source?: 'github' | 'local';
|
|
isDownloaded?: boolean;
|
|
isUpToDate?: boolean;
|
|
localPath?: string;
|
|
// Additional properties added by API
|
|
categories?: number[];
|
|
categoryNames?: string[];
|
|
date_created?: string;
|
|
os?: string;
|
|
version?: string;
|
|
interface_port?: number | null;
|
|
// Optional: basenames of install scripts (without extension)
|
|
install_basenames?: string[];
|
|
}
|
|
|
|
export interface GitHubFile {
|
|
name: string;
|
|
path: string;
|
|
sha: string;
|
|
size: number;
|
|
url: string;
|
|
html_url: string;
|
|
git_url: string;
|
|
download_url: string;
|
|
type: string;
|
|
content?: string;
|
|
encoding?: string;
|
|
}
|