fix: Deploying version dynamically + adding Tauri project files

This commit is contained in:
gauvainboiche
2026-08-02 18:18:29 +02:00
parent 165935521a
commit 257e187964
12 changed files with 4618 additions and 60 deletions
+10 -1
View File
@@ -1,4 +1,4 @@
import { MODES, PK_MODELS, CLINICAL_THRESHOLDS, generateSimulationData, processTimelineEvents } from './pkCore.js';
import { MODES, PK_MODELS, CLINICAL_THRESHOLDS, APP_VERSION, generateSimulationData, processTimelineEvents } from './pkCore.js';
import { adjustChartYScale } from './chartManager.js';
import { initCalculatorUI } from './calculator.js';
import { exportSimulationToCSV } from './csvExport.js';
@@ -8,6 +8,13 @@ let currentMode = MODES.ESKETAMINE;
let pkChart = null;
let currentSimulationData = null;
function updateVersionDisplay() {
const versionEl = document.querySelector('[data-i18n="app.version"]');
if (versionEl) {
versionEl.textContent = t('app.version', { version: APP_VERSION });
}
}
const timelineInputs = Array.from({ length: 61 }, (_, i) => ({
time: i * 5,
bolusMg: 0,
@@ -16,12 +23,14 @@ const timelineInputs = Array.from({ length: 61 }, (_, i) => ({
document.addEventListener('DOMContentLoaded', async () => {
await initI18n();
updateVersionDisplay();
const selectLang = document.getElementById('selectLang');
if (selectLang) {
selectLang.value = getCurrentLang();
selectLang.addEventListener('change', async (e) => {
await initI18n(e.target.value);
updateVersionDisplay();
renderTimelineGrid();
updateSimulation();
});