diff --git a/docker-compose.yml b/docker-compose.yml index b4e78de..754ae0f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: hostname: pma image: ghcr.io/linuxserver/phpmyadmin profiles: - - debug + - dev environment: PMA_HOST: '${DB_HOST:-db}' PMA_USER: root @@ -12,6 +12,8 @@ services: TZ: Europe/Amsterdam ports: - '4081:80' + volumes: + - 'pmadata:/config' restart: unless-stopped networks: - net @@ -67,3 +69,5 @@ networks: volumes: dbdata: driver: local + pmadata: + driver: local diff --git a/src/html/bar/info.php b/src/html/bar/info.php index 71de062..5f25c65 100644 --- a/src/html/bar/info.php +++ b/src/html/bar/info.php @@ -4,6 +4,7 @@ ini_set('display_errors', 1); require_once '../core.php'; +header('Content-Type: application/json'); $data = []; // Grab all categories diff --git a/src/html/prices.php b/src/html/prices.php index c62af5d..06b75cb 100644 --- a/src/html/prices.php +++ b/src/html/prices.php @@ -2,7 +2,16 @@ require_once 'core.php'; header('Content-Type: application/json'); -$timeframe = 10 * 60; + +// fetch all settings +$query = $pdo->query('SELECT * FROM settings'); +$settings = []; + +foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) { + $settings[$row['setting']] = $row['value']; +} + +$timeframe = $settings['time_round'] * 60; // quotient of unix timestamp (10 minutes * 60 seconds in a minute) function roundTo5s($num) {