Update dependencies and refactor authentication logic

- Replaced `bcrypt` with `bcryptjs` for compatibility in `authService.js` and `settingsService.js`.
- Updated package versions in `package.json` and `package-lock.json`, including `multer`, `nodemailer`, and others.
- Added storage management features in the frontend, including free storage calculation and localization updates for new terms in `falukant.json` files.
This commit is contained in:
Torsten Schulz (local)
2025-11-26 18:14:36 +01:00
parent 608e62c2bd
commit c3ea7eecc2
8 changed files with 633 additions and 998 deletions

View File

@@ -35,6 +35,10 @@
<input type="number" id="quantity" v-model.number="productionQuantity" min="1" max="200"/>
</div>
<div>
<p>
{{ $t('falukant.branch.production.storageAvailable') }}:
<strong>{{ freeStorage }}</strong>
</p>
<p>{{ $t('falukant.branch.production.cost') }}:
<strong>{{ calculateProductionCost() }}</strong>
</p>
@@ -67,10 +71,19 @@
productionQuantity: 1,
currentTime: Date.now(),
timer: null,
currentStorage: 0,
maxStorage: 0,
};
},
computed: {
freeStorage() {
const diff = this.maxStorage - this.currentStorage;
return diff > 0 ? diff : 0;
},
},
async mounted() {
await this.loadProductions();
await this.loadStorage();
this.timer = setInterval(() => {
this.currentTime = Date.now();
}, 1000);
@@ -94,6 +107,15 @@
console.error('Error loading productions:', error);
}
},
async loadStorage() {
try {
const { data } = await apiClient.get(`/api/falukant/storage/${this.branchId}`);
this.currentStorage = data.totalUsedCapacity;
this.maxStorage = data.maxCapacity;
} catch (error) {
console.error('Error loading storage for production section:', error);
}
},
calculateProductionCost() {
if (!this.products) return 0;
const product = this.products.find(p => p.id === this.selectedProduct);