6 Commits

Author SHA1 Message Date
Adrian Zürcher
9866cc3ffd fix event edit not working closes #3 2025-11-05 11:30:56 +01:00
Adrian Zürcher
7b760afeb3 remove permission object 2025-11-04 15:32:02 +01:00
Adrian Zürcher
21dcf1a476 remove id from table 2025-11-04 15:31:36 +01:00
Adrian Zürcher
35d1a0f734 change wrong permissions 2025-11-04 15:31:21 +01:00
Adrian Zürcher
effbb61707 fix reference problem so value changes only after saving 2025-11-04 15:30:58 +01:00
Adrian Zürcher
7eb5ab9ab2 add env files for dev and production 2025-11-04 15:30:17 +01:00
17 changed files with 26 additions and 38 deletions

1
.env.development Normal file
View File

@@ -0,0 +1 @@
VITE_API_URL= https://localhost:9500/api

1
.env.production Normal file
View File

@@ -0,0 +1 @@
VITE_API_URL= https://members.tecamino.com/api

1
.gitignore vendored
View File

@@ -36,6 +36,7 @@ yarn-error.log*
# local .db files
*.db
*.dba
# local .log files
*.log

View File

@@ -4,7 +4,7 @@ go 1.24.5
require (
gitea.tecamino.com/paadi/access-handler v1.0.12
gitea.tecamino.com/paadi/memberDB v1.0.11
gitea.tecamino.com/paadi/memberDB v1.0.12
gitea.tecamino.com/paadi/tecamino-dbm v0.1.1
gitea.tecamino.com/paadi/tecamino-logger v0.2.1
github.com/gin-contrib/cors v1.7.6

View File

@@ -2,8 +2,8 @@ gitea.tecamino.com/paadi/access-handler v1.0.12 h1:lSmW0YrBJJvCqCg0ukTJHlFUNwd7q
gitea.tecamino.com/paadi/access-handler v1.0.12/go.mod h1:w71lpnuu5MgAWG3oiI9vsY2dWi4njF/iPrM/xV/dbBQ=
gitea.tecamino.com/paadi/dbHandler v1.0.4 h1:ctnaec0GDdtw3gRQdUISVDYLJ9x+vt50VW41OemfhD4=
gitea.tecamino.com/paadi/dbHandler v1.0.4/go.mod h1:y/xn/POJg1DO++67uKvnO23lJQgh+XFQq7HZCS9Getw=
gitea.tecamino.com/paadi/memberDB v1.0.11 h1:Mwo86NVe7sLReRf+R4Z6hRxeEIgjjq6EPyiL1L1TlrA=
gitea.tecamino.com/paadi/memberDB v1.0.11/go.mod h1:iLm7nunVRzqJK8CV4PJVuWIhgPlQjNIaeOkmtfK5fMg=
gitea.tecamino.com/paadi/memberDB v1.0.12 h1:chUTNlRpbB0dMcZtXpi114mrWO8G7jrTSkDYIvWzVzQ=
gitea.tecamino.com/paadi/memberDB v1.0.12/go.mod h1:iLm7nunVRzqJK8CV4PJVuWIhgPlQjNIaeOkmtfK5fMg=
gitea.tecamino.com/paadi/tecamino-dbm v0.1.1 h1:vAq7mwUxlxJuLzCQSDMrZCwo8ky5usWi9Qz+UP+WnkI=
gitea.tecamino.com/paadi/tecamino-dbm v0.1.1/go.mod h1:+tmf1rjPaKEoNeUcr1vdtoFIFweNG3aUGevDAl3NMBk=
gitea.tecamino.com/paadi/tecamino-logger v0.2.1 h1:sQTBKYPdzn9mmWX2JXZBtGBvNQH7cuXIwsl4TD0aMgE=

View File

@@ -133,6 +133,7 @@ func main() {
auth.POST("/members/import/csv", dbHandler.ImportCSV)
auth.POST("/events/add", dbHandler.StartNewEvent)
auth.POST("/events/edit", dbHandler.UpdateEvent)
auth.POST("/events/add/attendees", dbHandler.AddNewAttendees)
auth.POST("/events/delete/attendees", dbHandler.DeleteAttendee)
auth.POST("/events/delete", dbHandler.DeleteEvent)

Binary file not shown.

View File

@@ -3,12 +3,11 @@ import type { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } fro
import axios from 'axios';
import { useLogin } from 'src/vueLib/login/useLogin';
const host = window.location.hostname;
export const portApp = 9500;
const host = import.meta.env.VITE_API_URL;
// Create axios instance
export const appApi: AxiosInstance = axios.create({
baseURL: `https://${host}:${portApp}/api`,
baseURL: host,
timeout: 10000,
withCredentials: true,
});

View File

@@ -49,7 +49,7 @@ function open(Event: Event | null) {
}
if (Event !== null) {
localEvent.value = Event;
localEvent.value = { ...Event };
newEvent.value = false;
} else {
localEvent.value = {
@@ -68,13 +68,15 @@ async function save() {
if (!valid) return;
let query = 'events/edit?id=' + localEvent.value.id;
let query = 'events/edit';
let payload = JSON.stringify([localEvent.value]);
if (newEvent.value) {
query = 'events/add?name=' + localEvent.value.name;
payload = JSON.stringify(localEvent.value);
}
appApi
.post(query, JSON.stringify(localEvent.value))
.post(query, payload)
.then(() => {
emit('update');
dialog.value.close();

View File

@@ -132,7 +132,7 @@ function open(member: Member | null) {
}
if (member !== null) {
localMember.value = member;
localMember.value = { ...member };
newMember.value = false;
} else {
localMember.value = {

View File

@@ -60,7 +60,7 @@ function open(role: Role | null, typ?: 'permissions') {
showRoleField.value = typ !== 'permissions';
if (role !== null) {
localRole.value = role;
localRole.value = { ...role };
localRole.value.permissions = role.permissions || defaultPermissions;
newRole.value = false;
} else {
@@ -80,7 +80,7 @@ function save() {
if (newRole.value) {
query = 'roles/add';
update = false;
localRole.value.permissions = defaultPermissions;
localRole.value.permissions = localRole.value.permissions ?? defaultPermissions;
}
appApi

View File

@@ -149,7 +149,7 @@ async function open(user: User | null) {
}
if (user !== null) {
localUser.value = user;
localUser.value = { ...user };
newUser.value = false;
} else {
localUser.value = {

View File

@@ -8,7 +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')"
:readonly="!user.isPermittedTo('settings', 'write')"
:class="[
colorGroup ? 'col-md-4' : 'col-md-3',
colorGroup ? 'col-md-6' : 'col-md-6',
@@ -25,7 +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')"
:readonly="!user.isPermittedTo('settings', 'write')"
:class="[
colorGroup ? 'col-md-4' : 'col-md-3',
colorGroup ? 'col-md-6' : 'col-md-6',
@@ -55,7 +55,7 @@
<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
:disable="!user.isPermittedTo('userSettings', 'write')"
:disable="!user.isPermittedTo('settings', 'write')"
bordered
class="q-mx-md"
v-model="settings.primaryColor"
@@ -75,7 +75,7 @@
{{ $t('primaryColorText') }}
</p>
<q-color
:disable="!user.isPermittedTo('userSettings', 'write')"
:disable="!user.isPermittedTo('settings', 'write')"
bordered
class="q-mx-md"
v-model="settings.primaryColorText"
@@ -86,7 +86,7 @@
{{ $t('secondaryColor') }}
</p>
<q-color
:disable="!user.isPermittedTo('userSettings', 'write')"
:disable="!user.isPermittedTo('settings', 'write')"
class="q-mx-md"
v-model="settings.secondaryColor"
></q-color>
@@ -105,14 +105,14 @@
{{ $t('secondaryColorText') }}
</p>
<q-color
:disable="!user.isPermittedTo('userSettings', 'write')"
:disable="!user.isPermittedTo('settings', 'write')"
class="q-mx-md"
v-model="settings.secondaryColorText"
></q-color>
</div>
</div>
<q-btn
:disable="!user.isPermittedTo('userSettings', 'write')"
:disable="!user.isPermittedTo('settings', 'write')"
class="q-my-md q-mx-md"
color="secondary"
dense

View File

@@ -2,7 +2,6 @@
<q-card>
<q-card bordered v-for="(permission, index) in localPermission" v-bind:key="index">
<q-card-section class="text-center">
{{ permission }}
<div class="text-h7 text-bold text-primary">{{ $t(permission.name) }}</div>
</q-card-section>
<q-separator></q-separator>

View File

@@ -125,7 +125,7 @@
</div>
<EditOneDialog
ref="editOneDialog"
endpoint="Events/edit"
endpoint="events/edit"
query-id
v-on:update="updateEvents"
></EditOneDialog>

View File

@@ -17,14 +17,6 @@ export function useRoleTable() {
});
const columns = computed(() => [
{
name: 'id',
align: 'left' as const,
label: 'Id',
field: 'id',
sortable: true,
style: 'width: 50px; max-width: 50px;',
},
{
name: 'role',
align: 'left' as const,

View File

@@ -15,14 +15,6 @@ export function useUserTable() {
});
const columns = computed(() => [
{
name: 'id',
align: 'left' as const,
label: 'Id',
field: 'id',
sortable: true,
style: 'width: 50px; max-width: 50px;',
},
{
name: 'user',
align: 'left' as const,