From cd5c7d156900196e3c7c925a3dd8e612649a47ba Mon Sep 17 00:00:00 2001 From: Simon Giesel Date: Wed, 12 Jul 2023 15:36:33 +0200 Subject: [PATCH] feat(webapp): add server time to admin portal --- server/pb_schema.json | 144 +++++++++--------- .../src/components/views/ViewStatePortal.vue | 13 ++ 2 files changed, 85 insertions(+), 72 deletions(-) diff --git a/server/pb_schema.json b/server/pb_schema.json index 57d793c..e959859 100644 --- a/server/pb_schema.json +++ b/server/pb_schema.json @@ -287,78 +287,6 @@ "deleteRule": null, "options": {} }, - { - "id": "s854d2w72fvyl54", - "name": "companies", - "type": "auth", - "system": false, - "schema": [ - { - "id": "h5ogbj93", - "name": "accountNumber", - "type": "text", - "system": false, - "required": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "id": "cvcgnf4x", - "name": "name", - "type": "text", - "system": false, - "required": true, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "id": "ujqd3vik", - "name": "earlyShiftPayed", - "type": "date", - "system": false, - "required": false, - "options": { - "min": "", - "max": "" - } - }, - { - "id": "t1kakf3f", - "name": "lateShiftPayed", - "type": "date", - "system": false, - "required": false, - "options": { - "min": "", - "max": "" - } - } - ], - "indexes": [ - "CREATE INDEX `idx_eX1Vqqz` ON `companies` (`accountNumber`)" - ], - "listRule": "", - "viewRule": null, - "createRule": null, - "updateRule": "(@request.data.id = null && @request.data.username = null && @request.data.email = null && @request.data.accountNumber = null && @request.data.created = null && @request.data.updated = null && @request.data.name = null && @request.data.emailVisibility = null && @request.data.verified = null) && @request.data.id = @request.auth.id", - "deleteRule": null, - "options": { - "allowEmailAuth": true, - "allowOAuth2Auth": true, - "allowUsernameAuth": true, - "exceptEmailDomains": null, - "manageRule": null, - "minPasswordLength": 8, - "onlyEmailDomains": null, - "requireEmail": false - } - }, { "id": "t4gewf713jqhz3i", "name": "settings", @@ -431,5 +359,77 @@ "updateRule": null, "deleteRule": null, "options": {} + }, + { + "id": "s854d2w72fvyl54", + "name": "companies", + "type": "auth", + "system": false, + "schema": [ + { + "id": "h5ogbj93", + "name": "accountNumber", + "type": "text", + "system": false, + "required": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "id": "cvcgnf4x", + "name": "name", + "type": "text", + "system": false, + "required": true, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "id": "ujqd3vik", + "name": "earlyShiftPayed", + "type": "date", + "system": false, + "required": false, + "options": { + "min": "", + "max": "" + } + }, + { + "id": "t1kakf3f", + "name": "lateShiftPayed", + "type": "date", + "system": false, + "required": false, + "options": { + "min": "", + "max": "" + } + } + ], + "indexes": [ + "CREATE INDEX `idx_eX1Vqqz` ON `companies` (`accountNumber`)" + ], + "listRule": "", + "viewRule": null, + "createRule": null, + "updateRule": "(@request.data.username = null && @request.data.email = null && @request.data.accountNumber = null && @request.data.created = null && @request.data.updated = null && @request.data.name = null && @request.data.emailVisibility = null && @request.data.verified = null) && id = @request.auth.id", + "deleteRule": null, + "options": { + "allowEmailAuth": true, + "allowOAuth2Auth": true, + "allowUsernameAuth": true, + "exceptEmailDomains": null, + "manageRule": null, + "minPasswordLength": 8, + "onlyEmailDomains": null, + "requireEmail": false + } } ] \ No newline at end of file diff --git a/webapp/src/components/views/ViewStatePortal.vue b/webapp/src/components/views/ViewStatePortal.vue index cb36131..be676c1 100644 --- a/webapp/src/components/views/ViewStatePortal.vue +++ b/webapp/src/components/views/ViewStatePortal.vue @@ -92,6 +92,16 @@ Admin Oberfläche +
+
+
Server-Time
+
{{ DateService.toTime(serverTime) }}
+
{{ DateService.toShortString(serverTime) }}
+
+
@@ -196,6 +206,7 @@ import AtomFactorInput from '../atoms/AtomFactorInput.vue'; import OrganismAuthWrapper from '../organisms/OrganismAuthWrapper.vue'; import MoleculeImportDataModal from '../molecules/MoleculeImportDataModal.vue'; import MoleculeErrorModal from '../molecules/MoleculeErrorModal.vue'; +import { DateService } from '../../services/date.service'; const importAccountsModal = ref>(); const importCompaniesModal = ref>(); @@ -212,6 +223,7 @@ const importPending = ref(false); const importDone = ref(false); const errorMsg = ref(); const createdCompanies = ref<{ name: string, password: string }[]>([]); +const serverTime = ref(); async function importAccounts(file: File): Promise { const data = await file.text(); @@ -299,6 +311,7 @@ onMounted(async () => { maxWageFactor.value = settings.value.maxWageFactor; incomeTaxRecipient.value = settings.value.incomeTaxRecipient; radioUrl.value = settings.value.radioUrl; + serverTime.value = await DateService.getServerTime(); }); async function saveSettings() {