<!DOCTYPE html>
<html lang="en">
{{ template "head" . }}
<body>

<div class="container-fluid">
    {{ $root := . }}
    {{ $devs := .Devices }}
    {{ $temperatures := .Temperatures }}
    {{ $device := .Device }}
    {{ $rgb := .Rgb }}
    {{ $lcd := .Device.HasLCD }}
    {{ $lcdProfiles := .Device.LCDProfiles.Profiles }}
    {{ $lcdMode := .Device.DeviceProfile.LCDMode }}
    {{ $deviceProfile := .Device.DeviceProfile }}
    {{ $stats := .Stats }}
    <input type="hidden" id="deviceId" name="deviceId" value="{{ $device.Serial }}">
    <div class="row">
        <!-- Sidebar -->
        {{ template "sidebar" . }}

        <!-- Main -->
        <main class="main-content p-4">
            <!-- Temperature bar -->
            {{ if .Dashboard.TemperatureBar }}
            {{ template "temperature-bar" . }}
            {{ end }}

            <!-- NEXUS -->
            <div class="row g-4 mb-4 align-items-stretch">
                <div class="col-md-2">
                    <div class="card system-card text-center">
                        <div class="card-header">
                            {{ .Device.Product }}
                        </div>
                        <div class="card-body">
                            <div class="settings-list">
                                <!-- Firmware -->
                                <div class="settings-row">
                                    <span class="settings-label text-ellipsis">{{ .Lang "txtFirmware" }}</span>
                                    <span class="meta-value">{{ .Device.Firmware }}</span>
                                </div>

                                <!-- RGB Profile -->
                                <div class="settings-row">
                                    <span class="settings-label text-ellipsis">{{ .Lang "txtRgb" }}</span>
                                    <label for="lcdProfile">
                                        <select id="lcdProfile" class="form-select system-select compact auto-width lcdProfile" name="{{ $device.Serial }}">
                                            {{ range $key, $value := $lcdProfiles }}
                                            {{ if eq $key "default" }}
                                            {{ continue }}
                                            {{ end }}

                                            {{ if eq $key $lcdMode }}
                                            <option value="{{ $key }}" selected>{{ $value.Name }}</option>
                                            {{ else }}
                                            <option value="{{ $key }}">{{ $value.Name }}</option>
                                            {{ end }}
                                            {{ end }}

                                            {{ range $key, $value := $stats }}
                                            {{ range $channel, $data := $value.Devices }}
                                            <option value="{{ $key }};{{ $channel }}">{{ $data.Device }}</option>
                                            {{ end }}
                                            {{ end }}
                                        </select>
                                    </label>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
    </div>
</div>
<script src="/static/js/overview.js"></script>
<script src="/static/js/sidebar.js"></script>
{{ if .Dashboard.TemperatureBar }}
<script src="/static/js/temperature-bar.js"></script>
{{ end }}
</body>
</html>
