mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 22:39:46 +00:00
fix file type
This commit is contained in:
@@ -117,10 +117,31 @@ export default class ProxiesComponent {
|
|||||||
public: 'Public',
|
public: 'Public',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
config: ISB.Value.file({
|
config: ISB.Value.union({
|
||||||
name: 'Wiregaurd Config',
|
name: 'Config',
|
||||||
required: true,
|
default: 'upload',
|
||||||
extensions: ['.conf'],
|
variants: ISB.Variants.of({
|
||||||
|
upload: {
|
||||||
|
name: 'File',
|
||||||
|
spec: ISB.InputSpec.of({
|
||||||
|
file: ISB.Value.file({
|
||||||
|
name: 'Wiregaurd Config',
|
||||||
|
required: true,
|
||||||
|
extensions: ['.conf'],
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
paste: {
|
||||||
|
name: 'Copy/Paste',
|
||||||
|
spec: ISB.InputSpec.of({
|
||||||
|
file: ISB.Value.textarea({
|
||||||
|
name: 'Paste File Contents',
|
||||||
|
default: null,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -140,17 +161,13 @@ export default class ProxiesComponent {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private async save(
|
private async save(input: typeof this.wireguardSpec._TYPE): Promise<boolean> {
|
||||||
input: typeof this.wireguardSpec._TYPE & {
|
|
||||||
config: { hash: string; file: File }
|
|
||||||
},
|
|
||||||
): Promise<boolean> {
|
|
||||||
const loader = this.loader.open('Saving').subscribe()
|
const loader = this.loader.open('Saving').subscribe()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.api.addProxy({
|
await this.api.addProxy({
|
||||||
label: input.label,
|
label: input.label,
|
||||||
config: input.config,
|
config: input.config.value.file as string, // @TODO alex this is the file represented as a string
|
||||||
public: input.type === 'public',
|
public: input.type === 'public',
|
||||||
})
|
})
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user