Add WebDav server, fully functional!

Some more code cleanup.
This commit is contained in:
Bruno Bernardino
2024-04-06 19:43:34 +01:00
parent 541df3fb77
commit 265c52a7e5
11 changed files with 424 additions and 149 deletions

View File

@@ -24,7 +24,7 @@ export const actionWords = new Map<Action, string>([
['change-email', 'change email'],
['verify-change-email', 'change email'],
['change-password', 'change password'],
['change-dav-password', 'change Sync password'],
['change-dav-password', 'change WebDav password'],
['delete-account', 'delete account'],
]);
@@ -83,11 +83,11 @@ function formFields(action: Action, formData: FormData) {
} else if (action === 'change-dav-password') {
fields.push({
name: 'new-dav-password',
label: 'New Sync Password',
label: 'New WebDav Password',
type: 'password',
placeholder: 'super-SECRET-passphrase',
required: true,
description: 'Alternative password used for Sync access and/or HTTP Basic Auth.',
description: 'Alternative password used for WebDav access and/or HTTP Basic Auth.',
});
} else if (action === 'delete-account') {
fields.push({
@@ -148,12 +148,12 @@ export default function Settings({ formData: formDataObject, error, notice }: Se
</section>
</form>
<h2 class='text-2xl mb-4 text-left px-4 max-w-screen-md mx-auto lg:min-w-96'>Change your Sync password</h2>
<h2 class='text-2xl mb-4 text-left px-4 max-w-screen-md mx-auto lg:min-w-96'>Change your WebDav password</h2>
<form method='POST' class='mb-12'>
{formFields('change-dav-password', formData).map((field) => generateFieldHtml(field, formData))}
<section class='flex justify-end mt-8 mb-4'>
<button class='button-secondary' type='submit'>Change Sync password</button>
<button class='button-secondary' type='submit'>Change WebDav password</button>
</section>
</form>