mirror of
https://github.com/community-scripts/ProxmoxVE-Local.git
synced 2026-03-31 06:23:54 -04:00
fix: add missing script parameter (#521)
This commit is contained in:
committed by
GitHub
parent
4da8840d78
commit
7d1169a5ee
@@ -41,6 +41,7 @@ function pbToScript(pb: PBScript): Script {
|
|||||||
script: m.script,
|
script: m.script,
|
||||||
resources: m.resources,
|
resources: m.resources,
|
||||||
config_path: m.config_path,
|
config_path: m.config_path,
|
||||||
|
script: scriptDownloaderService.deriveScriptPath(pb.type, m.type, pb.slug) ?? undefined,
|
||||||
})),
|
})),
|
||||||
default_credentials: {
|
default_credentials: {
|
||||||
username: pb.default_user,
|
username: pb.default_user,
|
||||||
|
|||||||
@@ -392,6 +392,7 @@ export class AutoSyncService {
|
|||||||
type: m.type,
|
type: m.type,
|
||||||
resources: m.resources,
|
resources: m.resources,
|
||||||
config_path: m.config_path,
|
config_path: m.config_path,
|
||||||
|
script: sds.deriveScriptPath(pb.type, m.type, pb.slug) ?? undefined,
|
||||||
})),
|
})),
|
||||||
default_credentials: { username: pb.default_user, password: pb.default_passwd },
|
default_credentials: { username: pb.default_user, password: pb.default_passwd },
|
||||||
notes: pb.notes_json,
|
notes: pb.notes_json,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { readFile, readdir, writeFile, mkdir } from 'fs/promises';
|
import { readFile, readdir, writeFile, mkdir } from 'fs/promises';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import type { Script, ScriptCard } from '~/types/script';
|
import type { Script, ScriptCard } from '~/types/script';
|
||||||
|
import { scriptDownloaderService } from './scriptDownloader.js';
|
||||||
|
|
||||||
export class LocalScriptsService {
|
export class LocalScriptsService {
|
||||||
private scriptsDirectory: string;
|
private scriptsDirectory: string;
|
||||||
@@ -58,6 +59,7 @@ export class LocalScriptsService {
|
|||||||
type: m.type,
|
type: m.type,
|
||||||
resources: m.resources,
|
resources: m.resources,
|
||||||
config_path: m.config_path,
|
config_path: m.config_path,
|
||||||
|
script: scriptDownloaderService.deriveScriptPath(pb.type, m.type, pb.slug) ?? undefined,
|
||||||
})),
|
})),
|
||||||
notes: pb.notes_json.map(n => ({ text: n.text, type: n.type })),
|
notes: pb.notes_json.map(n => ({ text: n.text, type: n.type })),
|
||||||
}));
|
}));
|
||||||
@@ -135,6 +137,7 @@ export class LocalScriptsService {
|
|||||||
type: m.type,
|
type: m.type,
|
||||||
resources: m.resources,
|
resources: m.resources,
|
||||||
config_path: m.config_path,
|
config_path: m.config_path,
|
||||||
|
script: scriptDownloaderService.deriveScriptPath(pb.type, m.type, pb.slug) ?? undefined,
|
||||||
})),
|
})),
|
||||||
notes: pb.notes_json.map(n => ({ text: n.text, type: n.type })),
|
notes: pb.notes_json.map(n => ({ text: n.text, type: n.type })),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,10 +12,8 @@ export interface ScriptInstallMethod {
|
|||||||
resources: ScriptResources;
|
resources: ScriptResources;
|
||||||
config_path?: string;
|
config_path?: string;
|
||||||
/**
|
/**
|
||||||
* Optional install script file path (e.g. "ct/adguard.sh").
|
* Install script file path (e.g. "ct/adguard.sh").
|
||||||
* Present in user-defined local JSON scripts.
|
* For PocketBase-sourced scripts, this is derived by the backend.
|
||||||
* For PocketBase-sourced scripts this field is absent; the downloader derives
|
|
||||||
* the path from the script type and slug via `deriveScriptPath()`.
|
|
||||||
*/
|
*/
|
||||||
script?: string;
|
script?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user