Refactor backend CORS settings to include default origins and improve error handling in chat services: Introduce dynamic CORS origin handling, enhance RabbitMQ message sending with fallback mechanisms, and update WebSocket service to manage pending messages. Update UI components for better accessibility and responsiveness, including adjustments to dialog and navigation elements. Enhance styling for improved user experience across various components.

This commit is contained in:
Torsten Schulz (local)
2026-03-19 14:44:04 +01:00
parent 4442937ebd
commit 9d44a265ca
67 changed files with 5426 additions and 1099 deletions

View File

@@ -4,9 +4,9 @@
<!-- Benutzer-Suche -->
<div class="search-section">
<label>{{ $t('admin.falukant.edituser.username') }}: <input type="text" v-model="user.username" @keyup.enter="searchUser" /></label>
<label>{{ $t('admin.falukant.edituser.characterName') }}: <input type="text" v-model="user.characterName" @keyup.enter="searchUser" /></label>
<button @click="searchUser">{{ $t('admin.falukant.edituser.search') }}</button>
<label class="form-field">{{ $t('admin.falukant.edituser.username') }} <input type="text" v-model="user.username" @keyup.enter="searchUser" /></label>
<label class="form-field">{{ $t('admin.falukant.edituser.characterName') }} <input type="text" v-model="user.characterName" @keyup.enter="searchUser" /></label>
<button @click="searchUser" :disabled="!canSearch">{{ $t('admin.falukant.edituser.search') }}</button>
</div>
<!-- Benutzer-Liste -->
@@ -40,8 +40,8 @@
</select>
</label>
<div class="action-buttons">
<button @click="saveUser">{{ $t('common.save') }}</button>
<button @click="deleteUser">{{ $t('common.delete') }}</button>
<button @click="saveUser" :disabled="!hasUserChanges">{{ $t('common.save') }}</button>
<button @click="deleteUser" class="button-secondary">{{ $t('common.delete') }}</button>
</div>
</div>
</div>
@@ -122,6 +122,7 @@ import { mapState } from 'vuex';
import { mapActions } from 'vuex';
import SimpleTabs from '@/components/SimpleTabs.vue';
import apiClient from '@/utils/axios.js';
import { showApiError, showError, showSuccess } from '@/utils/feedback.js';
export default {
name: 'AdminFalukantEditUserView',
@@ -162,6 +163,15 @@ export default {
},
computed: {
...mapState('falukant', ['user']),
canSearch() {
return this.user.username.trim().length > 0 || this.user.characterName.trim().length > 0;
},
hasUserChanges() {
if (!this.editableUser || !this.originalUser) return false;
return this.editableUser.falukantData[0].money != this.originalUser.falukantData[0].money
|| this.editableUser.falukantData[0].character.title_of_nobility != this.originalUser.falukantData[0].character.title_of_nobility
|| this.originalAge != this.age;
},
availableStockTypes() {
if (!this.newStock.branchId || !this.stockTypes.length) {
return this.stockTypes;
@@ -191,6 +201,10 @@ export default {
},
methods: {
async searchUser() {
if (!this.canSearch) {
showError(this, 'Bitte Benutzername oder Charaktername eingeben.');
return;
}
const userResult = await apiClient.post('/api/admin/falukant/searchuser', {
userName: this.user.username,
characterName: this.user.characterName
@@ -221,9 +235,9 @@ export default {
}
try {
await apiClient.post(`/api/admin/falukant/edituser`, dataToChange);
this.$root.$refs.messageDialog.open('tr:admin.falukant.edituser.success');
showSuccess(this, 'tr:admin.falukant.edituser.success');
} catch (error) {
this.$root.$refs.errorDialog.open('tr:admin.falukant.edituser.error');
showApiError(this, error, 'tr:admin.falukant.edituser.error');
}
},
async deleteUser() {
@@ -245,7 +259,7 @@ export default {
this.userBranches = branchesResult.data;
} catch (error) {
console.error('Error loading user branches:', error);
this.$root.$refs.errorDialog.open('tr:admin.falukant.edituser.errorLoadingBranches');
showApiError(this, error, 'tr:admin.falukant.edituser.errorLoadingBranches');
} finally {
this.loading.branches = false;
}
@@ -255,7 +269,7 @@ export default {
await apiClient.put(`/api/admin/falukant/stock/${stock.id}`, {
quantity: stock.quantity
});
this.$root.$refs.messageDialog.open('tr:admin.falukant.edituser.stockUpdated');
showSuccess(this, 'tr:admin.falukant.edituser.stockUpdated');
} catch (error) {
console.error('Error updating stock:', error);
this.$root.$refs.errorDialog.open('tr:admin.falukant.edituser.errorUpdatingStock');
@@ -675,4 +689,4 @@ export default {
font-size: 14px;
text-align: center;
}
</style>
</style>