mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
fix(edge/templates): fix issues [EE-6328] (#10656)
This commit is contained in:
parent
140ac5d17c
commit
76bcdfa2b8
12 changed files with 181 additions and 91 deletions
|
@ -15,17 +15,20 @@ export function useParseRegistries() {
|
|||
});
|
||||
}
|
||||
|
||||
export async function parseRegistries(props: {
|
||||
export async function parseRegistries({
|
||||
file,
|
||||
fileContent,
|
||||
}: {
|
||||
file?: File;
|
||||
fileContent?: string;
|
||||
}) {
|
||||
if (!props.file && !props.fileContent) {
|
||||
if (!file && !fileContent) {
|
||||
throw new Error('File or fileContent must be provided');
|
||||
}
|
||||
|
||||
let currentFile = props.file;
|
||||
if (!props.file && props.fileContent) {
|
||||
currentFile = new File([props.fileContent], 'registries.yml');
|
||||
let currentFile = file;
|
||||
if (!file && fileContent) {
|
||||
currentFile = new File([fileContent], 'registries.yml');
|
||||
}
|
||||
try {
|
||||
const { data } = await axios.post<Array<RegistryId>>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue