changed copypassword fields in databases

This commit is contained in:
Shivam Deepak Chaudhary 2023-02-09 07:51:33 +00:00
parent 23bfc119d9
commit ce70252a69
8 changed files with 123 additions and 2493 deletions

View File

@ -2,6 +2,8 @@
export let database: any; export let database: any;
import CopyPasswordField from '$lib/components/CopyPasswordField.svelte'; import CopyPasswordField from '$lib/components/CopyPasswordField.svelte';
import { t } from '$lib/translations'; import { t } from '$lib/translations';
import { status } from '$lib/store';
import Explainer from '$lib/components/Explainer.svelte';
</script> </script>
<div class="flex space-x-1 py-5 font-bold"> <div class="flex space-x-1 py-5 font-bold">
@ -9,11 +11,13 @@
</div> </div>
<div class="space-y-2 lg:px-10 px-2"> <div class="space-y-2 lg:px-10 px-2">
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="defaultDatabase">{$t('database.default_database')}</label> <label for="defaultDatabase">{$t('database.default_database')}
<Explainer explanation="Can only be modified when the database is not active."/>
</label>
<CopyPasswordField <CopyPasswordField
required required
readonly={database.defaultDatabase} readonly={$status.database.isRunning}
disabled={database.defaultDatabase} disabled={$status.database.isRunning}
placeholder="{$t('forms.eg')}: mydb" placeholder="{$t('forms.eg')}: mydb"
id="defaultDatabase" id="defaultDatabase"
name="defaultDatabase" name="defaultDatabase"
@ -21,49 +25,57 @@
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="dbUser">{$t('forms.user')}</label> <label for="dbUser">{$t('forms.user')}
<Explainer explanation="Can only be modified when the database is not active."/>
</label>
<CopyPasswordField <CopyPasswordField
readonly readonly={$status.database.isRunning}
disabled disabled={$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
id="dbUser" id="dbUser"
name="dbUser" name="dbUser"
value={database.dbUser} bind:value={database.dbUser}
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="dbUserPassword">{$t('forms.password')}</label> <label for="dbUserPassword">{$t('forms.password')}
<Explainer explanation="Can be modified even when the database is active." />
</label>
<CopyPasswordField <CopyPasswordField
readonly readonly={false}
disabled disabled={false}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField isPasswordField
id="dbUserPassword" id="dbUserPassword"
name="dbUserPassword" name="dbUserPassword"
value={database.dbUserPassword} bind:value={database.dbUserPassword}
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="rootUser">{$t('forms.root_user')}</label> <label for="rootUser">{$t('forms.root_user')}
<Explainer explanation="Can only be modified when the database is not active."/>
</label>
<CopyPasswordField <CopyPasswordField
readonly readonly={$status.database.isRunning}
disabled disabled={$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
id="rootUser" id="rootUser"
name="rootUser" name="rootUser"
value={database.rootUser} bind:value={database.rootUser}
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="rootUserPassword">{$t('forms.roots_password')}</label> <label for="rootUserPassword">{$t('forms.roots_password')}
<Explainer explanation="Can be modified even when the database is active." />
</label>
<CopyPasswordField <CopyPasswordField
readonly readonly={false}
disabled disabled={false}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField isPasswordField
id="rootUserPassword" id="rootUserPassword"
name="rootUserPassword" name="rootUserPassword"
value={database.rootUserPassword} bind:value={database.rootUserPassword}
/> />
</div> </div>
</div> </div>

View File

@ -11,11 +11,12 @@
</div> </div>
<div class="space-y-2 lg:px-10 px-2"> <div class="space-y-2 lg:px-10 px-2">
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="defaultDatabase">{$t('database.default_database')}</label> <label for="defaultDatabase">{$t('database.default_database')}
<Explainer explanation="Can only be modified when the database is not active."/></label>
<CopyPasswordField <CopyPasswordField
required required
readonly={database.defaultDatabase} readonly={$status.database.isRunning}
disabled={database.defaultDatabase} disabled={$status.database.isRunning}
placeholder="{$t('forms.eg')}: edgedb" placeholder="{$t('forms.eg')}: edgedb"
id="defaultDatabase" id="defaultDatabase"
name="defaultDatabase" name="defaultDatabase"
@ -23,10 +24,11 @@
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="rootUser">{$t('forms.root_user')}</label> <label for="rootUser">{$t('forms.root_user')}
<Explainer explanation="Can only be modified when the database is not active."/></label>
<CopyPasswordField <CopyPasswordField
readonly readonly={$status.database.isRunning}
disabled disabled={$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
id="rootUser" id="rootUser"
name="rootUser" name="rootUser"
@ -35,18 +37,16 @@
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="rootUser" <label for="rootUser"
>Root Password <Explainer >Root Password <Explainer explanation="Can be modified even when the database is active." /></label
explanation="Could be changed while the database is running."
/></label
> >
<CopyPasswordField <CopyPasswordField
readonly readonly={false}
disabled disabled={false}
placeholder="Generated automatically after start" placeholder="Generated automatically after start"
isPasswordField isPasswordField
id="rootUserPassword" id="rootUserPassword"
name="rootUserPassword" name="rootUserPassword"
value={database.rootUserPassword} bind:value={database.rootUserPassword}
/> />
</div> </div>
</div> </div>

View File

@ -12,12 +12,12 @@
<div class="space-y-2 lg:px-10 px-2"> <div class="space-y-2 lg:px-10 px-2">
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="defaultDatabase" <label for="defaultDatabase"
>{$t('database.default_database')}</label >{$t('database.default_database')}<Explainer explanation="Can only be modified when the database is not active."/></label
> >
<CopyPasswordField <CopyPasswordField
required required
readonly={database.defaultDatabase} readonly={$status.database.isRunning}
disabled={database.defaultDatabase} disabled={$status.database.isRunning}
placeholder="{$t('forms.eg')}: mydb" placeholder="{$t('forms.eg')}: mydb"
id="defaultDatabase" id="defaultDatabase"
name="defaultDatabase" name="defaultDatabase"
@ -25,24 +25,24 @@
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="dbUser" >{$t('forms.user')}</label> <label for="dbUser" >{$t('forms.user')}<Explainer explanation="Can only be modified when the database is not active."/></label>
<CopyPasswordField <CopyPasswordField
readonly readonly={$status.database.isRunning}
disabled disabled={$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
id="dbUser" id="dbUser"
name="dbUser" name="dbUser"
value={database.dbUser} bind:value={database.dbUser}
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="dbUserPassword" <label for="dbUserPassword"
>{$t('forms.password')} >{$t('forms.password')}
<Explainer explanation="Could be changed while the database is running." /></label <Explainer explanation="Can be modified even when the database is active." /></label
> >
<CopyPasswordField <CopyPasswordField
disabled={!$status.database.isRunning} readonly={false}
readonly={!$status.database.isRunning} disabled={false}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField isPasswordField
id="dbUserPassword" id="dbUserPassword"
@ -51,24 +51,24 @@
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="rootUser" >{$t('forms.root_user')}</label> <label for="rootUser" >{$t('forms.root_user')}<Explainer explanation="Can only be modified when the database is not active."/></label>
<CopyPasswordField <CopyPasswordField
readonly readonly={$status.database.isRunning}
disabled disabled={$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
id="rootUser" id="rootUser"
name="rootUser" name="rootUser"
value={database.rootUser} bind:value={database.rootUser}
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="rootUserPassword" <label for="rootUserPassword"
>{$t('forms.roots_password')} >{$t('forms.roots_password')}
<Explainer explanation="Could be changed while the database is running." /></label <Explainer explanation="Can be modified even when the database is active." /></label
> >
<CopyPasswordField <CopyPasswordField
disabled={!$status.database.isRunning} readonly={false}
readonly={!$status.database.isRunning} disabled={false}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField isPasswordField
id="rootUserPassword" id="rootUserPassword"

View File

@ -11,24 +11,26 @@
</div> </div>
<div class="space-y-2 lg:px-10 px-2"> <div class="space-y-2 lg:px-10 px-2">
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="rootUser">{$t('forms.root_user')}</label> <label for="rootUser">{$t('forms.root_user')}
<Explainer explanation="Can only be modified when the database is not active." /></label
>
<CopyPasswordField <CopyPasswordField
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
id="rootUser" id="rootUser"
readonly readonly={$status.database.isRunning}
disabled disabled={$status.database.isRunning}
name="rootUser" name="rootUser"
value={database.rootUser} bind:value={database.rootUser}
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="rootUserPassword" <label for="rootUserPassword"
>{$t('forms.roots_password')} >{$t('forms.roots_password')}
<Explainer explanation="Could be changed while the database is running." /></label <Explainer explanation="Can be modified even when the database is active." /></label
> >
<CopyPasswordField <CopyPasswordField
disabled={!$status.database.isRunning} disabled={false}
readonly={!$status.database.isRunning} readonly={false}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField={true} isPasswordField={true}
id="rootUserPassword" id="rootUserPassword"

View File

@ -11,11 +11,11 @@
</div> </div>
<div class="space-y-2 lg:px-10 px-2"> <div class="space-y-2 lg:px-10 px-2">
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="defaultDatabase">{$t('database.default_database')}</label> <label for="defaultDatabase">{$t('database.default_database')}<Explainer explanation="Can only be modified when the database is not active."/></label>
<CopyPasswordField <CopyPasswordField
required required
readonly={database.defaultDatabase} readonly={$status.database.isRunning}
disabled={database.defaultDatabase} disabled={$status.database.isRunning}
placeholder="{$t('forms.eg')}: mydb" placeholder="{$t('forms.eg')}: mydb"
id="defaultDatabase" id="defaultDatabase"
name="defaultDatabase" name="defaultDatabase"
@ -23,24 +23,24 @@
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="dbUser">{$t('forms.user')}</label> <label for="dbUser">{$t('forms.user')}<Explainer explanation="Can only be modified when the database is not active."/></label>
<CopyPasswordField <CopyPasswordField
readonly readonly={$status.database.isRunning}
disabled disabled={$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
id="dbUser" id="dbUser"
name="dbUser" name="dbUser"
value={database.dbUser} bind:value={database.dbUser}
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="dbUserPassword" <label for="dbUserPassword"
>{$t('forms.password')} >{$t('forms.password')}
<Explainer explanation="Could be changed while the database is running." /></label <Explainer explanation="Can be modified even when the database is active." /></label
> >
<CopyPasswordField <CopyPasswordField
disabled={!$status.database.isRunning} disabled={false}
readonly={!$status.database.isRunning} readonly={false}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField isPasswordField
id="dbUserPassword" id="dbUserPassword"
@ -49,24 +49,26 @@
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="rootUser">{$t('forms.root_user')}</label> <label for="rootUser">{$t('forms.root_user')}
<Explainer explanation="Can only be modified when the database is not active."/>
</label>
<CopyPasswordField <CopyPasswordField
readonly readonly={$status.database.isRunning}
disabled disabled={$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
id="rootUser" id="rootUser"
name="rootUser" name="rootUser"
value={$appSession.isARM ? 'root' : database.rootUser} bind:value={database.rootUser}
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="rootUserPassword" <label for="rootUserPassword"
>{$t('forms.roots_password')} >{$t('forms.roots_password')}
<Explainer explanation="Could be changed while the database is running." /></label <Explainer explanation="Can be modified even when the database is active." /></label
> >
<CopyPasswordField <CopyPasswordField
disabled={!$status.database.isRunning} disabled={false}
readonly={!$status.database.isRunning} readonly={false}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField isPasswordField
id="rootUserPassword" id="rootUserPassword"

View File

@ -11,11 +11,11 @@
</div> </div>
<div class="space-y-2 lg:px-10 px-2"> <div class="space-y-2 lg:px-10 px-2">
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="defaultDatabase">{$t('database.default_database')}</label> <label for="defaultDatabase">{$t('database.default_database')}<Explainer explanation="Can only be modified when the database is not active."/></label>
<CopyPasswordField <CopyPasswordField
required required
readonly={database.defaultDatabase} readonly={$status.database.isRunning}
disabled={database.defaultDatabase} disabled={$status.database.isRunning}
placeholder="{$t('forms.eg')}: mydb" placeholder="{$t('forms.eg')}: mydb"
id="defaultDatabase" id="defaultDatabase"
name="defaultDatabase" name="defaultDatabase"
@ -25,13 +25,11 @@
{#if !$appSession.isARM} {#if !$appSession.isARM}
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="rootUser" <label for="rootUser"
>Postgres User Password <Explainer >Postgres User Password <Explainer explanation="Can be modified even when the database is active." /></label
explanation="Could be changed while the database is running."
/></label
> >
<CopyPasswordField <CopyPasswordField
disabled={!$status.database.isRunning} readonly={false}
readonly={!$status.database.isRunning} disabled={false}
placeholder="Generated automatically after start" placeholder="Generated automatically after start"
isPasswordField isPasswordField
id="rootUserPassword" id="rootUserPassword"
@ -41,24 +39,24 @@
</div> </div>
{/if} {/if}
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="dbUser">{$t('forms.user')}</label> <label for="dbUser">{$t('forms.user')}<Explainer explanation="Can only be modified when the database is not active."/></label>
<CopyPasswordField <CopyPasswordField
readonly readonly={$status.database.isRunning}
disabled disabled={$status.database.isRunning}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
id="dbUser" id="dbUser"
name="dbUser" name="dbUser"
value={database.dbUser} bind:value={database.dbUser}
/> />
</div> </div>
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="dbUserPassword" <label for="dbUserPassword"
>{$t('forms.password')} >{$t('forms.password')}
<Explainer explanation="Could be changed while the database is running." /></label <Explainer explanation="Can be modified even when the database is active." /></label
> >
<CopyPasswordField <CopyPasswordField
disabled={!$status.database.isRunning} readonly={false}
readonly={!$status.database.isRunning} disabled={false}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField isPasswordField
id="dbUserPassword" id="dbUserPassword"

View File

@ -13,11 +13,11 @@
<div class="grid grid-cols-2 items-center"> <div class="grid grid-cols-2 items-center">
<label for="dbUserPassword" <label for="dbUserPassword"
>{$t('forms.password')} >{$t('forms.password')}
<Explainer explanation="Could be changed while the database is running." /></label <Explainer explanation="Can be modified even when the database is active." /></label
> >
<CopyPasswordField <CopyPasswordField
disabled={!$status.database.isRunning} readonly={false}
readonly={!$status.database.isRunning} disabled={false}
placeholder={$t('forms.generated_automatically_after_start')} placeholder={$t('forms.generated_automatically_after_start')}
isPasswordField isPasswordField
id="dbUserPassword" id="dbUserPassword"

2422
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff