new package dbHandler accesscontrol memeberdb and login with rights
All checks were successful
Build Quasar SPA and Go Backend for memberApp / build-spa (push) Successful in 2m20s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, .exe, windows) (push) Successful in 5m27s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, , linux) (push) Successful in 5m32s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm, 6, , linux) (push) Successful in 5m28s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm64, , linux) (push) Successful in 5m29s
All checks were successful
Build Quasar SPA and Go Backend for memberApp / build-spa (push) Successful in 2m20s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, .exe, windows) (push) Successful in 5m27s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, , linux) (push) Successful in 5m32s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm, 6, , linux) (push) Successful in 5m28s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm64, , linux) (push) Successful in 5m29s
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
<p class="text-bold text-h6 text-primary q-pa-md">{{ $t('general') }}</p>
|
||||
<div class="row">
|
||||
<q-input
|
||||
:readonly="!user.isPermittedTo('userSettings', 'write')"
|
||||
:class="[
|
||||
colorGroup ? 'col-md-4' : 'col-md-3',
|
||||
colorGroup ? 'col-md-6' : 'col-md-6',
|
||||
@@ -24,6 +25,7 @@
|
||||
<p class="text-bold text-h6 text-primary q-pa-md">{{ $t('database') }}</p>
|
||||
<div class="row">
|
||||
<q-input
|
||||
:readonly="!user.isPermittedTo('userSettings', 'write')"
|
||||
:class="[
|
||||
colorGroup ? 'col-md-4' : 'col-md-3',
|
||||
colorGroup ? 'col-md-6' : 'col-md-6',
|
||||
@@ -52,18 +54,72 @@
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-6 col-md-3 q-px-md">
|
||||
<p class="text-center text-bold text-h6 text-primary">{{ $t('primaryColor') }}</p>
|
||||
<q-color bordered class="q-mx-md" v-model="settings.primaryColor"></q-color>
|
||||
<q-color
|
||||
:disable="!user.isPermittedTo('userSettings', 'write')"
|
||||
bordered
|
||||
class="q-mx-md"
|
||||
v-model="settings.primaryColor"
|
||||
></q-color>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-md-3 q-px-md">
|
||||
<p
|
||||
:class="[
|
||||
'text-center',
|
||||
'text-bold',
|
||||
'text-h6',
|
||||
'text-primary-text',
|
||||
settings.primaryColorText === '#ffffff' ? 'bg-black' : '',
|
||||
]"
|
||||
:style="settings.primaryColorText === '#ffffff' ? 'opacity: 0.2;' : ''"
|
||||
>
|
||||
{{ $t('primaryColorText') }}
|
||||
</p>
|
||||
<q-color
|
||||
:disable="!user.isPermittedTo('userSettings', 'write')"
|
||||
bordered
|
||||
class="q-mx-md"
|
||||
v-model="settings.primaryColorText"
|
||||
></q-color>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-md-3 q-px-md">
|
||||
<p class="text-center text-bold text-h6 text-secondary">
|
||||
{{ $t('secondaryColor') }}
|
||||
</p>
|
||||
<q-color class="q-mx-md" v-model="settings.secondaryColor"></q-color>
|
||||
<q-color
|
||||
:disable="!user.isPermittedTo('userSettings', 'write')"
|
||||
class="q-mx-md"
|
||||
v-model="settings.secondaryColor"
|
||||
></q-color>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-md-3 q-px-md">
|
||||
<p
|
||||
:class="[
|
||||
'text-center',
|
||||
'text-bold',
|
||||
'text-h6',
|
||||
'text-secondary-text',
|
||||
settings.secondaryColorText === '#ffffff' ? 'bg-black' : '',
|
||||
]"
|
||||
:style="settings.secondaryColorText === '#ffffff' ? 'opacity: 0.2;' : ''"
|
||||
>
|
||||
{{ $t('secondaryColorText') }}
|
||||
</p>
|
||||
<q-color
|
||||
:disable="!user.isPermittedTo('userSettings', 'write')"
|
||||
class="q-mx-md"
|
||||
v-model="settings.secondaryColorText"
|
||||
></q-color>
|
||||
</div>
|
||||
</div>
|
||||
<q-btn class="q-my-md q-mx-md" color="secondary" dense no-caps @click="resetColors">{{
|
||||
$t('resetColors')
|
||||
}}</q-btn>
|
||||
<q-btn
|
||||
:disable="!user.isPermittedTo('userSettings', 'write')"
|
||||
class="q-my-md q-mx-md"
|
||||
color="secondary"
|
||||
dense
|
||||
no-caps
|
||||
@click="resetColors"
|
||||
>{{ $t('resetColors') }}</q-btn
|
||||
>
|
||||
</div>
|
||||
</q-card>
|
||||
<div class="row justify-end">
|
||||
@@ -83,15 +139,21 @@ import { reactive, ref, watch } from 'vue';
|
||||
import { appApi } from 'src/boot/axios';
|
||||
import { useNotify } from 'src/vueLib/general/useNotify';
|
||||
import { type Settings } from 'src/vueLib/models/settings';
|
||||
import { useLogin } from 'src/vueLib/login/useLogin';
|
||||
import { useUserStore } from 'src/vueLib/login/userStore';
|
||||
|
||||
const { NotifyResponse } = useNotify();
|
||||
const { getUser } = useLogin();
|
||||
const colorGroup = ref(false);
|
||||
const user = useUserStore();
|
||||
|
||||
const settings = reactive<Settings>({
|
||||
icon: Logo.value,
|
||||
databaseName: databaseName.value,
|
||||
primaryColor: document.documentElement.style.getPropertyValue('--q-primary'),
|
||||
primaryColorText: document.documentElement.style.getPropertyValue('--q-primary-text'),
|
||||
secondaryColor: document.documentElement.style.getPropertyValue('--q-secondary'),
|
||||
secondaryColorText: document.documentElement.style.getPropertyValue('--q-secondary-text'),
|
||||
});
|
||||
|
||||
watch(settings, (newSettings) => {
|
||||
@@ -101,20 +163,30 @@ watch(settings, (newSettings) => {
|
||||
|
||||
function resetColors() {
|
||||
document.documentElement.style.setProperty('--q-primary', '#1976d2');
|
||||
settings.primaryColor = '#1976d2';
|
||||
document.documentElement.style.setProperty('--q-primary-text', '#ffffff');
|
||||
settings.primaryColorText = '#ffffff';
|
||||
document.documentElement.style.setProperty('--q-secondary', '#26a69a');
|
||||
settings.secondaryColor = '#26a69a';
|
||||
document.documentElement.style.setProperty('--q-secondary-text', '#ffffff');
|
||||
settings.secondaryColorText = '#ffffff';
|
||||
}
|
||||
|
||||
function save() {
|
||||
document.documentElement.style.setProperty('--q-primary', settings.primaryColor);
|
||||
document.documentElement.style.setProperty('--q-primary-text', settings.primaryColorText);
|
||||
document.documentElement.style.setProperty('--q-secondary', settings.secondaryColor);
|
||||
document.documentElement.style.setProperty('--q-secondary-text', settings.secondaryColorText);
|
||||
Logo.value = settings.icon;
|
||||
localStorage.setItem('icon', settings.icon);
|
||||
localStorage.setItem('databaseName', settings.databaseName);
|
||||
localStorage.setItem('primaryColor', settings.primaryColor);
|
||||
localStorage.setItem('primaryColorText', settings.primaryColorText);
|
||||
localStorage.setItem('secondaryColor', settings.secondaryColor);
|
||||
localStorage.setItem('secondaryColorText', settings.secondaryColorText);
|
||||
|
||||
appApi
|
||||
.post('secure/settings/update', { user: 'admin', settings })
|
||||
.post('settings/update', { user: getUser()?.username, settings })
|
||||
.then((resp) => NotifyResponse(resp.data.message))
|
||||
.catch((err) => NotifyResponse(err, 'error'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user