mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 11:06:02 +00:00
fix - don't show update mode in web
This commit is contained in:
@@ -1,115 +1,112 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { internalRedirectTo } from '../clientAuth';
|
import { internalRedirectTo } from '../clientAuth';
|
||||||
import FormCheckboxField from '../forms/FormCheckboxField.svelte';
|
import FormCheckboxField from '../forms/FormCheckboxField.svelte';
|
||||||
import FormFieldTemplateLarge from '../forms/FormFieldTemplateLarge.svelte';
|
import FormFieldTemplateLarge from '../forms/FormFieldTemplateLarge.svelte';
|
||||||
import FormSelectField from '../forms/FormSelectField.svelte';
|
import FormSelectField from '../forms/FormSelectField.svelte';
|
||||||
import SelectField from '../forms/SelectField.svelte';
|
import SelectField from '../forms/SelectField.svelte';
|
||||||
import FontIcon from '../icons/FontIcon.svelte';
|
import FontIcon from '../icons/FontIcon.svelte';
|
||||||
import { showModal } from '../modals/modalTools';
|
import { showModal } from '../modals/modalTools';
|
||||||
import { _t, getSelectedLanguage, setSelectedLanguage } from '../translations';
|
import { _t, getSelectedLanguage, setSelectedLanguage } from '../translations';
|
||||||
import { isMac } from '../utility/common';
|
import { isMac } from '../utility/common';
|
||||||
import getElectron from '../utility/getElectron';
|
import getElectron from '../utility/getElectron';
|
||||||
import ConfirmModal from '../modals/ConfirmModal.svelte';
|
import ConfirmModal from '../modals/ConfirmModal.svelte';
|
||||||
|
|
||||||
const electron = getElectron();
|
const electron = getElectron();
|
||||||
let restartWarning = false;
|
let restartWarning = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
|
<div class="heading">{_t('settings.application', { defaultMessage: 'Application' })}</div>
|
||||||
<div class="heading">{_t('settings.application', { defaultMessage: 'Application' })}</div>
|
<FormFieldTemplateLarge label={_t('settings.localization.language', { defaultMessage: 'Language' })} type="combo">
|
||||||
<FormFieldTemplateLarge
|
<SelectField
|
||||||
label={_t('settings.localization.language', { defaultMessage: 'Language' })}
|
isNative
|
||||||
type="combo"
|
data-testid="SettingsModal_languageSelect"
|
||||||
>
|
options={[
|
||||||
<SelectField
|
{ value: 'cs', label: 'Čeština' },
|
||||||
isNative
|
{ value: 'de', label: 'Deutsch' },
|
||||||
data-testid="SettingsModal_languageSelect"
|
{ value: 'en', label: 'English' },
|
||||||
options={[
|
{ value: 'es', label: 'Español' },
|
||||||
{ value: 'cs', label: 'Čeština' },
|
{ value: 'fr', label: 'Français' },
|
||||||
{ value: 'de', label: 'Deutsch' },
|
{ value: 'it', label: 'Italiano' },
|
||||||
{ value: 'en', label: 'English' },
|
{ value: 'pt', label: 'Português (Brasil)' },
|
||||||
{ value: 'es', label: 'Español' },
|
{ value: 'sk', label: 'Slovenčina' },
|
||||||
{ value: 'fr', label: 'Français' },
|
{ value: 'ja', label: '日本語' },
|
||||||
{ value: 'it', label: 'Italiano' },
|
{ value: 'zh', label: '中文' },
|
||||||
{ value: 'pt', label: 'Português (Brasil)' },
|
]}
|
||||||
{ value: 'sk', label: 'Slovenčina' },
|
defaultValue={getSelectedLanguage()}
|
||||||
{ value: 'ja', label: '日本語' },
|
value={getSelectedLanguage()}
|
||||||
{ value: 'zh', label: '中文' },
|
on:change={e => {
|
||||||
]}
|
setSelectedLanguage(e.detail);
|
||||||
defaultValue={getSelectedLanguage()}
|
showModal(ConfirmModal, {
|
||||||
value={getSelectedLanguage()}
|
message: _t('settings.localization.reloadWarning', {
|
||||||
on:change={e => {
|
defaultMessage: 'Application will be reloaded to apply new language settings',
|
||||||
setSelectedLanguage(e.detail);
|
}),
|
||||||
showModal(ConfirmModal, {
|
onConfirm: () => {
|
||||||
message: _t('settings.localization.reloadWarning', {
|
setTimeout(() => {
|
||||||
defaultMessage: 'Application will be reloaded to apply new language settings',
|
internalRedirectTo(electron ? '/index.html' : '/');
|
||||||
}),
|
}, 100);
|
||||||
onConfirm: () => {
|
},
|
||||||
setTimeout(() => {
|
});
|
||||||
internalRedirectTo(electron ? '/index.html' : '/');
|
}}
|
||||||
}, 100);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</FormFieldTemplateLarge>
|
|
||||||
|
|
||||||
<FormSelectField
|
|
||||||
label={_t('settings.other.autoUpdateApplication', { defaultMessage: 'Auto update application' })}
|
|
||||||
name="app.autoUpdateMode"
|
|
||||||
isNative
|
|
||||||
defaultValue=""
|
|
||||||
options={[
|
|
||||||
{
|
|
||||||
value: 'skip',
|
|
||||||
label: _t('settings.other.autoUpdateApplication.skip', {
|
|
||||||
defaultMessage: 'Do not check for new versions',
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: '',
|
|
||||||
label: _t('settings.other.autoUpdateApplication.check', { defaultMessage: 'Check for new versions' }),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'download',
|
|
||||||
label: _t('settings.other.autoUpdateApplication.download', {
|
|
||||||
defaultMessage: 'Check and download new versions',
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
/>
|
||||||
|
</FormFieldTemplateLarge>
|
||||||
|
|
||||||
<div class="heading">{_t('settings.appearance', { defaultMessage: 'Appearance' })}</div>
|
{#if electron}
|
||||||
|
<FormSelectField
|
||||||
|
label={_t('settings.other.autoUpdateApplication', { defaultMessage: 'Auto update application' })}
|
||||||
|
name="app.autoUpdateMode"
|
||||||
|
isNative
|
||||||
|
defaultValue=""
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
value: 'skip',
|
||||||
|
label: _t('settings.other.autoUpdateApplication.skip', {
|
||||||
|
defaultMessage: 'Do not check for new versions',
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '',
|
||||||
|
label: _t('settings.other.autoUpdateApplication.check', { defaultMessage: 'Check for new versions' }),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'download',
|
||||||
|
label: _t('settings.other.autoUpdateApplication.download', {
|
||||||
|
defaultMessage: 'Check and download new versions',
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
|
||||||
{#if electron}
|
<div class="heading">{_t('settings.appearance', { defaultMessage: 'Appearance' })}</div>
|
||||||
|
|
||||||
<FormCheckboxField
|
|
||||||
name="app.useNativeMenu"
|
|
||||||
label={isMac()
|
|
||||||
? _t('settings.useNativeWindowTitle', { defaultMessage: 'Use native window title' })
|
|
||||||
: _t('settings.useSystemNativeMenu', { defaultMessage: 'Use system native menu' })}
|
|
||||||
on:change={() => {
|
|
||||||
restartWarning = true;
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{#if restartWarning}
|
|
||||||
<div class="ml-5 mb-3">
|
|
||||||
<FontIcon icon="img warn" />
|
|
||||||
{_t('settings.nativeMenuRestartWarning', {
|
|
||||||
defaultMessage: 'Native menu settings will be applied after app restart',
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
|
{#if electron}
|
||||||
<FormCheckboxField
|
<FormCheckboxField
|
||||||
|
name="app.useNativeMenu"
|
||||||
|
label={isMac()
|
||||||
|
? _t('settings.useNativeWindowTitle', { defaultMessage: 'Use native window title' })
|
||||||
|
: _t('settings.useSystemNativeMenu', { defaultMessage: 'Use system native menu' })}
|
||||||
|
on:change={() => {
|
||||||
|
restartWarning = true;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{#if restartWarning}
|
||||||
|
<div class="ml-5 mb-3">
|
||||||
|
<FontIcon icon="img warn" />
|
||||||
|
{_t('settings.nativeMenuRestartWarning', {
|
||||||
|
defaultMessage: 'Native menu settings will be applied after app restart',
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<FormCheckboxField
|
||||||
name="tabGroup.showServerName"
|
name="tabGroup.showServerName"
|
||||||
label={_t('settings.tabGroup.showServerName', {
|
label={_t('settings.tabGroup.showServerName', {
|
||||||
defaultMessage: 'Show server name alongside database name in title of the tab group',
|
defaultMessage: 'Show server name alongside database name in title of the tab group',
|
||||||
})}
|
})}
|
||||||
defaultValue={false}
|
defaultValue={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@@ -120,8 +117,7 @@
|
|||||||
margin-top: var(--dim-large-form-margin);
|
margin-top: var(--dim-large-form-margin);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper :global(select){
|
.wrapper :global(select) {
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user