Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ MYSQL_DATABASE=ik_kontroll
MYSQL_USER=ik_user
MYSQL_PASSWORD=ik_pass

# ── Spring datasource overrides ───────────────────────────────────────────────
# Optional when running locally outside Docker Compose. Docker Compose sets these
# automatically for the backend container.
SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/ik_kontroll?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC&characterEncoding=UTF-8&useUnicode=true
SPRING_DATASOURCE_USERNAME=ik_user
SPRING_DATASOURCE_PASSWORD=ik_pass

# ── JWT secret ────────────────────────────────────────────────────────────────
# Must be at least 32 characters. Change this to something random in production.
JWT_SECRET=local-dev-secret-please-change-this-for-production-use-only
Expand Down
8 changes: 8 additions & 0 deletions backend/src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Flyway in dev: run normal schema migrations + dev-only seed migrations
spring.flyway.locations=classpath:db/migration,classpath:db/migration-dev

# Local datasource defaults for IDE runs. Docker Compose overrides these with
# SPRING_DATASOURCE_* environment variables when the app runs in containers.
spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:mysql://localhost:3306/${MYSQL_DATABASE:ik_kontroll}?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC&characterEncoding=UTF-8&useUnicode=true}
spring.datasource.username=${SPRING_DATASOURCE_USERNAME:${MYSQL_USER:ik_user}}
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:${MYSQL_PASSWORD:ik_pass}}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect

# Allow Flyway to wipe and rebuild schema if it finds a failed migration record
spring.flyway.clean-disabled=false
spring.flyway.clean-on-validation-error=true
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/GraphView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ const lineChartOptions = computed(() => ({
callbacks: {
label: (ctx: any) => {
const ds = visibleDatasets.value[ctx.datasetIndex]
if (!ds || ctx.parsed.y == null) return null
if (!ds || ctx.parsed.y == null) return undefined
const val: number = ctx.parsed.y
const hasThresholds = ds.minThreshold != null && ds.maxThreshold != null
const isOut = hasThresholds && (val < ds.minThreshold || val > ds.maxThreshold)
return ` ${ctx.dataset.label}: ${val}°C${isOut ? ' ⚠ avvik' : ''}`
},
afterLabel: (ctx: any) => {
const ds = visibleDatasets.value[ctx.datasetIndex]
if (!ds || ctx.parsed.y == null || ds.minThreshold == null || ds.maxThreshold == null) return null
if (!ds || ctx.parsed.y == null || ds.minThreshold == null || ds.maxThreshold == null) return undefined
return ` Grense: ${ds.minThreshold}°C – ${ds.maxThreshold}°C`
},
},
Expand Down
Loading