Skip to content

Commit

Permalink
Rename label of server field, and handle paths without suffix slashes…
Browse files Browse the repository at this point in the history
… on s3
  • Loading branch information
sp90 committed Nov 15, 2024
1 parent 7fdf34e commit 9dcb69c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/app/backup/destination/destination.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ export const DESTINATION_CONFIG: DestinationConfig = {
},
},
dynamicFields: [
'use-ssl',
{
name: 's3-server-name',
shortDescription: 'Server',
type: 'NonValidatedSelectableString', // Convert to string before submitting
loadOptions: (injector: Injector) => injector.get(WebModulesService).s3Providers,
},
'use-ssl',
'auth-username',
'auth-password',
],
Expand Down
2 changes: 1 addition & 1 deletion src/app/backup/destination/destination.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const mappings = {
to: (fields: any): string => {
const urlParams = toSearchParams([...Object.entries(fields.advanced), ...Object.entries(fields.dynamic)]);

return `${fields.destinationType}://${fields.custom.bucket}${fields.custom.path}${urlParams}`;
return `${fields.destinationType}://${fields.custom.bucket}${fields.custom.path.startsWith('/') ? fields.custom.path : '/' + fields.custom.path}${urlParams}`;
},
from: (destinationType: string, urlObj: URL, plainPath: string) => {
return <ValueOfDestinationFormGroup>{
Expand Down

0 comments on commit 9dcb69c

Please sign in to comment.