aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/deckit/DeckItDashboardPage.qml
blob: 8a1f7b6fbbf5d1a321cbc9135eb02dbbaa2e4ac3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

import QtQuick
import "../.."
import "../qtmaildir"
import "Modules.js" as Modules

// deck-it's Dashboard page: its panels, the tablet screen, the hardware it reads.
Column {
    id: col
    spacing: 6
    readonly property var st: DeckIt.store
    function def(section, key) { return col.st.fallback(section, key); }

    Small { visible: DeckIt.defaultsError !== ""; color: Theme.red; text: DeckIt.defaultsError }

    Heading { objectName: "modules/"; text: "Dashboard parts" }
    Small { text: "What the Dashboard shows. The OBS and K1C tabs, on the Server page, also feed its running row." }
    Repeater {
        model: Modules.parts(Object.keys(col.def("modules") ?? {}))
        BoolSetting {
            required property string modelData
            store: col.st; section: "modules"; key: modelData; label: Modules.name(modelData)
            fallback: col.def("modules", modelData) ?? true
        }
    }

    Heading { text: "Tablet screen" }
    Setting { store: col.st; section: "tablet"; key: "dim_after"; label: "Dim after"; kind: "int"; min: 0; max: 3600
              placeholder: col.st.placeholder("tablet", "dim_after")
              hint: "Seconds without a touch before the tablet's backlight goes down; a touch brings it back. 0 turns it off." }
    Setting { store: col.st; section: "tablet"; key: "dim_brightness"; label: "Dim brightness"; kind: "int"; min: 0; max: 255
              placeholder: col.st.placeholder("tablet", "dim_brightness"); hint: "Backlight while dimmed, 0 to 255." }

    Heading { text: "Hardware" }
    Small { text: "Each is auto, or a fixed value such as wlan0, BAT1 or coretemp." }
    Setting { store: col.st; section: "hardware"; key: "net"; label: "Network interface"
              placeholder: col.st.placeholder("hardware", "net") }
    Setting { store: col.st; section: "hardware"; key: "battery"; label: "Battery"
              placeholder: col.st.placeholder("hardware", "battery") }
    Setting { store: col.st; section: "hardware"; key: "cpu_sensor"; label: "CPU sensor"
              placeholder: col.st.placeholder("hardware", "cpu_sensor") }
    Setting { store: col.st; section: "hardware"; key: "gpu"; label: "GPU"
              placeholder: col.st.placeholder("hardware", "gpu"); hint: "auto (Intel xe) or none." }
    Setting { store: col.st; section: "hardware"; key: "gpu_mem_total"; label: "GPU memory"
              placeholder: col.st.placeholder("hardware", "gpu_mem_total"); hint: "The xe driver reports no VRAM size: the card's total, like 12G." }
}