You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 14:11:59 +01:00
453 lines
25 KiB
Plaintext
453 lines
25 KiB
Plaintext
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Setup - FM-DX Webserver</title>
|
|
<link href="css/entry.css" type="text/css" rel="stylesheet">
|
|
<link href="css/flags.min.css" type="text/css" rel="stylesheet">
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" type="text/css" rel="stylesheet">
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.min.css" type="text/css" rel="stylesheet">
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.min.js"></script>
|
|
<link rel="icon" type="image/png" href="favicon2.png" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
</head>
|
|
<body>
|
|
<div id="wrapper" class="setup-wrapper">
|
|
<% if (isAdminAuthenticated) { %>
|
|
<div class="panel-100 no-bg">
|
|
<img class="top-10" src="./images/openradio_logo_neutral.png" height="64px">
|
|
<h2 class="text-monospace text-light">[ADMIN PANEL]</h2>
|
|
</div>
|
|
<div class="panel-100">
|
|
<ul class="nav">
|
|
<li data-panel="dashboard" class="active">Dashboard</li>
|
|
<li data-panel="tuner">Tuner</li>
|
|
<li data-panel="connection">Connection</li>
|
|
<li data-panel="audio">Audio</li>
|
|
<li data-panel="webserver">Webserver</li>
|
|
<li data-panel="identification">Info & Map</li>
|
|
<li class="logout-link text-gray"><i class="fas fa-sign-out"></i></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div id="login-message"></div>
|
|
<div class="panel-100">
|
|
<div class="panel-100 tab-content" id="dashboard">
|
|
<h2>Dashboard</h2>
|
|
|
|
<div class="panel-100 flex-container auto">
|
|
<div class="panel-33">
|
|
<span class="text-medium-big color-5"><%= onlineUsers %></span>
|
|
<p>Online users</p>
|
|
</div>
|
|
|
|
<div class="panel-33">
|
|
<span class="text-medium-big color-5"><%= memoryUsage %></span>
|
|
<p>Memory usage</p>
|
|
</div>
|
|
|
|
<div class="panel-33">
|
|
<span class="text-medium-big color-5"><%= processUptime %></span>
|
|
<p>Uptime</p>
|
|
</div>
|
|
</div>
|
|
|
|
<h3>Current users</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>IP Address</th>
|
|
<th>Location</th>
|
|
<th>Online since</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% if (connectedUsers.length > 0) { %>
|
|
<% connectedUsers.forEach(user => { %>
|
|
<tr>
|
|
<td><%= user.ip %></td>
|
|
<td><%= user.location %></td>
|
|
<td><%= user.time %></td>
|
|
</tr>
|
|
<% }); %>
|
|
<% } else { %>
|
|
<tr>
|
|
<td colspan="3" style="text-align: center">No users online</td>
|
|
</tr>
|
|
<% } %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3>Console</h3>
|
|
<% if (consoleOutput && consoleOutput.length > 0) { %>
|
|
<div class="panel-100 br-5 p-10 text-small text-left top-10" id="console-output">
|
|
<% consoleOutput.forEach(function(log) { %>
|
|
<pre class="m-0" style="white-space:pre-wrap;"><%= log %></pre>
|
|
<% }); %>
|
|
</div>
|
|
<% } else { %>
|
|
<p>No console output available.</p>
|
|
<% } %>
|
|
|
|
<h3>Maintenance</h3>
|
|
<div class="flex-container">
|
|
<div class="panel-50 no-bg">
|
|
<div class="form-group checkbox">
|
|
<input type="checkbox" id="tuner-public">
|
|
<label for="tuner-public">Allow tuner control without password</label>
|
|
</div>
|
|
<div class="form-group checkbox">
|
|
<input type="checkbox" id="tuner-lock">
|
|
<label for="tuner-lock">Lock the tuner [only admins can tune with this option]</label>
|
|
</div>
|
|
</div>
|
|
<div class="panel-50 no-bg">
|
|
<div class="form-group checkbox">
|
|
<input type="checkbox" id="shutdown-tuner">
|
|
<label for="shutdown-tuner">Auto-shutdown tuner when no one is online</label>
|
|
</div><br>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="tune-pass">Tune password:</label>
|
|
<input class="input-text w-200" type="password" name="tune-pass" id="tune-pass">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="admin-pass">Admin setup password:</label>
|
|
<input class="input-text w-200" type="password" name="admin-pass" id="admin-pass">
|
|
</div><br>
|
|
|
|
<p class="text-small">Version: <span class="version-string color-4"></span></p>
|
|
<p class="p-bottom-20"><a href="https://github.com/noobishsvk/fm-dx-webserver" target="_blank">Check for the latest source code</a> • <a href="https://buymeacoffee.com/noobish" target="_blank">Support the developer</a></p>
|
|
</div>
|
|
|
|
<div class="panel-100 tab-content" id="connection">
|
|
<h2>Connection settings</h2>
|
|
<p>You can set up your connection settings here. Changing these settings requires a server restart.</p>
|
|
<h3>Tuner connection:</h3>
|
|
|
|
<div style="width: 300px;" class="auto top-10">
|
|
<label class="toggleSwitch nolabel" onclick="">
|
|
<input id="connection-type-toggle" type="checkbox"/>
|
|
<a></a>
|
|
<span>
|
|
<span class="left-span">USB Cable</span>
|
|
<span class="right-span">Wireless</span>
|
|
</span>
|
|
</label>
|
|
</div>
|
|
|
|
<div id="tuner-usb" class="top-25">
|
|
<div class="form-group">
|
|
<label for="com-devices"><i class="fa-brands fa-usb"></i> USB Device:</label>
|
|
<div class="dropdown" style="width: 300px;margin-right: 0;">
|
|
<input id="com-devices" type="text" name="com-devices" placeholder="Choose your USB device" readonly />
|
|
<ul class="options" id="deviceList">
|
|
<% serialPorts.forEach(serialPort => { %>
|
|
<li data-value="<%= serialPort.path %>" class="option"><%= serialPort.path %> - <%= serialPort.friendlyName %></li>
|
|
<% }); %>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="tuner-wireless">
|
|
<p class="text-gray">If you are connecting your tuner <strong>wirelessly</strong>, enter the tuner IP. <br> If you use <strong>xdrd</strong>, use 127.0.0.1 as your IP.</p>
|
|
<div class="form-group">
|
|
<label for="xdrd-ip">xdrd ip address:</label>
|
|
<input class="input-text w-150" type="text" name="xdrd-ip" id="xdrd-ip" placeholder="127.0.0.1">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="xdrd-port">xdrd port:</label>
|
|
<input class="input-text w-100" type="text" name="xdrd-port" id="xdrd-port" placeholder="7373">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="xdrd-password">xdrd server password:</label>
|
|
<input class="input-text w-150" type="password" name="xdrd-password" id="xdrd-password">
|
|
</div>
|
|
</div>
|
|
|
|
<br class="top-25">
|
|
|
|
<h3>Webserver connection:</h3>
|
|
<p class="text-gray">Leave the IP at 0.0.0.0 unless you explicitly know you have to change it.<br>Don't enter your public IP here.</p>
|
|
<div class="form-group">
|
|
<label for="webserver-ip">Webserver IP:</label>
|
|
<input class="input-text w-150" type="text" name="webserver-ip" id="webserver-ip" placeholder="0.0.0.0">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="webserver-port">Webserver port:</label>
|
|
<input class="input-text w-100" type="text" name="webserver-port" id="webserver-port" placeholder="8080">
|
|
</div>
|
|
<br>
|
|
</div>
|
|
|
|
<div class="panel-100 tab-content" id="audio">
|
|
<h2>Audio settings</h2>
|
|
|
|
<p>You can set up your audio settings here. Changing these settings requires a server restart.</p>
|
|
<div class="panel-100 p-bottom-20">
|
|
<div class="form-group">
|
|
<p class="text-left">Your audio device port.<br>
|
|
<span class="text-gray">This is where your tuner is plugged in.</span>
|
|
</p>
|
|
<label for="audio-devices"><i class="fa-solid fa-headphones"></i> STREAM AUDIO FROM:</label>
|
|
<div class="dropdown" style="width: 300px;">
|
|
<input id="audio-devices" type="text" name="audio-devices" placeholder="Choose your audio device" readonly />
|
|
<ul class="options" id="deviceList">
|
|
<% videoDevices.forEach(device => { %>
|
|
<li data-value="<%= device.name %>" class="option"><%= device.name %></li>
|
|
<% }); %>
|
|
<% audioDevices.forEach(device => { %>
|
|
<li data-value="<%= device.name %>" class="option"><%= device.name %></li>
|
|
<% }); %>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<p class="text-left">Audio channel count.<br>
|
|
<span class="text-gray">Choose between Mono / Stereo.</span>
|
|
</p>
|
|
<label for="audio-devices"><i class="fa-solid fa-microphone-lines"></i> Audio channels:</label>
|
|
<div class="dropdown" style="width: 300px;">
|
|
<input id="audio-channels" type="text" name="audio-channels" placeholder="Stereo" readonly />
|
|
<ul class="options">
|
|
<li data-value="2" class="option">Stereo</li>
|
|
<li data-value="1" class="option">Mono</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<p class="text-left">The bitrate of the mp3 audio.<br>
|
|
<span class="text-gray">Minimum: 64 Kbps • Maximum: 320 Kbps</span>
|
|
</p>
|
|
<label for="audio-quality"><i class="fa-solid fa-wave-square"></i> Audio quality:</label>
|
|
<div class="dropdown" style="width: 300px;">
|
|
<input id="audio-quality" type="text" name="audio-quality" placeholder="128k (standard)" readonly />
|
|
<ul class="options">
|
|
<li data-value="64k" class="option">64k (lowest quality)</li>
|
|
<li data-value="96k" class="option">96k (low quality)</li>
|
|
<li data-value="128k" class="option">128k (standard)</li>
|
|
<li data-value="192k" class="option">192k (higher quality)</li>
|
|
<li data-value="256k" class="option">256k (very high quality)</li>
|
|
<li data-value="320k" class="option">320k (ultra quality)</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group checkbox bottom-20">
|
|
<input type="checkbox" id="audio-software-mode">
|
|
<label for="audio-software-mode">ALSA software mode (plughw) - LINUX ONLY</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel-100 tab-content" id="webserver">
|
|
<h2>Webserver settings</h2>
|
|
<div class="flex-container">
|
|
<div class="panel-50 no-bg">
|
|
<h3>Antenna options</h3>
|
|
<div class="form-group checkbox bottom-20">
|
|
<input type="checkbox" id="antenna-switch">
|
|
<label for="antenna-switch">Enable the antenna switch</label>
|
|
</div>
|
|
</div>
|
|
<div class="panel-50 no-bg">
|
|
<h3>Chat options</h3>
|
|
<div class="form-group checkbox bottom-20">
|
|
<input type="checkbox" id="chat-switch">
|
|
<label for="chat-switch">Enable chat</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<h3>Themes</h3>
|
|
<div class="form-group">
|
|
<label for="themes"><i class="fa-solid fa-palette"></i>Default server theme:</label>
|
|
<div class="dropdown" id="server-theme-selector" style="margin-right: 0;">
|
|
<input type="text" placeholder="Default" id="selected-theme" readonly>
|
|
<ul class="options">
|
|
<li class="option" data-value="theme1">Default</li>
|
|
<li class="option" data-value="theme2">Cappuccino</li>
|
|
<li class="option" data-value="theme3">Nature</li>
|
|
<li class="option" data-value="theme4">Ocean</li>
|
|
<li class="option" data-value="theme5">Terminal</li>
|
|
<li class="option" data-value="theme6">Nightlife</li>
|
|
<li class="option" data-value="theme7">Blurple</li>
|
|
<li class="option" data-value="theme8">Construction</li>
|
|
<li class="option" data-value="theme9">AMOLED</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<br><hr>
|
|
|
|
<div class="flex-container">
|
|
<div class="panel-50 no-bg">
|
|
<h3>Tuning options</h3>
|
|
<div class="form-group checkbox">
|
|
<input type="checkbox" id="default-freq-enable">
|
|
<label for="default-freq-enable">Enable default frequency for first client</label>
|
|
</div><br>
|
|
<div class="form-group">
|
|
<label for="default-freq">Default frequency:</label>
|
|
<input class="input-text w-150" type="text" placeholder="87.5" name="default-freq" id="default-freq">
|
|
</div>
|
|
<p>If you want to limit which frequencies the users can tune to,<br>you can set the lower and upper limit here.<br>
|
|
<span class="text-gray">Enter frequencies in MHz.</span>
|
|
</p>
|
|
<div class="form-group checkbox">
|
|
<input type="checkbox" id="tuning-limit">
|
|
<label for="tuning-limit">Limit tuning</label>
|
|
</div><br>
|
|
<div class="form-group">
|
|
<label for="tuning-lower-limit">Lower limit:</label>
|
|
<input class="input-text w-100" type="text" placeholder="0" name="tuning-lower-limit" id="tuning-lower-limit">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="tuning-upper-limit">Upper Limit:</label>
|
|
<input class="input-text w-100" type="text" placeholder="108" name="tuning-upper-limit" id="tuning-upper-limit">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel-50 no-bg">
|
|
<h3>Presets</h3>
|
|
<p>You can set up to 4 presets.<br>These presets are accessible with the F1-F4 buttons.<br>
|
|
<span class="text-gray">Enter frequencies in MHz.</span></p>
|
|
<div class="form-group">
|
|
<label for="preset1">Preset 1:</label>
|
|
<input class="input-text w-100" type="text" placeholder="87.5" name="preset1" id="preset1">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="preset2">Preset 2:</label>
|
|
<input class="input-text w-100" type="text" placeholder="87.5" name="preset2" id="preset2">
|
|
</div><br>
|
|
<div class="form-group">
|
|
<label for="preset1">Preset 3:</label>
|
|
<input class="input-text w-100" type="text" placeholder="87.5" name="preset3" id="preset3">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="preset1">Preset 4:</label>
|
|
<input class="input-text w-100" type="text" placeholder="87.5" name="preset4" id="preset4">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<br><hr>
|
|
|
|
<h3>Banlist</h3>
|
|
<p>If you have users that don't behave in your chat, you can choose to ban them by their IP address.<br>
|
|
<span class="text-gray">You can see their IP address by hovering over their nickname. One IP per row.</span></p>
|
|
<div class="form-group">
|
|
<label for="preset1">Banned users:</label>
|
|
<textarea id="ip-addresses" placeholder="123.45.67.8"></textarea>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="panel-100 tab-content" id="tuner">
|
|
<h2>Tuner Specific Settings</h2>
|
|
<div class="form-group">
|
|
<label for="themes"><i class="fa-solid fa-radio"></i> Device:</label>
|
|
<div class="dropdown" id="device-selector" style="margin-right: 0;">
|
|
<input type="text" placeholder="TEF6686 / TEA685x" id="device-type" readonly>
|
|
<ul class="options">
|
|
<li class="option" data-value="tef">TEF668x / TEA685x</li>
|
|
<li class="option" data-value="xdr">XDR (F1HD / S10HDiP)</li>
|
|
<li class="option" data-value="sdr">SDR (RTL-SDR / AirSpy)</li>
|
|
<li class="option" data-value="sdr">Other</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel-100 tab-content" id="identification">
|
|
<h2>Identification & Map</h2>
|
|
|
|
<div class="flex-container">
|
|
<div class="panel-50 no-bg">
|
|
<h3>Basic info</h3>
|
|
|
|
<p class="text-gray">Set your tuner name and description here.<br>This info will be visible to anyone who tunes in. </p>
|
|
<div class="panel-100" style="padding-left: 20px; padding-right: 20px;">
|
|
<label for="webserver-name" style="width: 100%;max-width: 768px; margin:auto;">Webserver name:</label>
|
|
<input style="width: 100%; max-width: 768px;" class="input-text" type="text" name="webserver-name" id="webserver-name" placeholder="Fill your server name here." maxlength="32">
|
|
<br>
|
|
<label for="webserver-desc" style="width: 100%;max-width: 768px; margin: auto;">Webserver description:</label>
|
|
<textarea id="webserver-desc" name="webserver-desc" placeholder="Fill the server description here. You can put useful info here such as your antenna setup. You can use simple markdown." maxlength="255"></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel-50 no-bg">
|
|
<h3>Online map</h3>
|
|
<p class="m-0 text-gray">If your location information is filled,<br>you can add your tuner to a public list.</p>
|
|
<p></p>
|
|
<div class="form-group checkbox">
|
|
<input type="checkbox" id="broadcast-tuner">
|
|
<label for="broadcast-tuner">Broadcast to map</label>
|
|
</div><br>
|
|
<div class="form-group">
|
|
<label for="owner-contact">Owner contact:</label>
|
|
<input class="input-text" type="text" placeholder="Your e-mail, discord..." name="owner-contact" id="owner-contact">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="broadcast-address">Broadcast address (if using a proxy):</label>
|
|
<input class="input-text" type="text" name="broadcast-address" id="broadcast-address">
|
|
</div>
|
|
|
|
<p>Check your tuner at <strong><a href="https://list.fmdx.pl" target="_blank" class="color-4">list.fmdx.pl</a></strong>.</p>
|
|
</div>
|
|
</div>
|
|
<br>
|
|
<hr>
|
|
|
|
<h3>Location:</h3>
|
|
<p class="text-gray">Location info is useful for automatic identification of stations using RDS.</p>
|
|
<div class="form-group">
|
|
<label for="lat">Latitude:</label>
|
|
<input class="input-text" type="text" name="lat" id="lat">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="lng">Longitude:</label>
|
|
<input class="input-text" type="text" name="lng" id="lng">
|
|
</div>
|
|
|
|
<div id="map"></div>
|
|
<br>
|
|
</div>
|
|
|
|
<button id="submit-config" style="height:48px; width: 200px;margin:20px;" onclick="submitData();">Save settings</button>
|
|
</div>
|
|
|
|
<div class="panel-100 no-bg">
|
|
<p>Feel free to contact us on <a href="https://discord.gg/ZAVNdS74mC" target="_blank"><strong><i class="fa-brands fa-discord"></i> Discord</strong></a> for community support.</p>
|
|
</div>
|
|
|
|
<button onclick="document.location.href='./'" id="back-btn" aria-label="Go back to tuning"><i class="fa-solid fa-arrow-left"></i></button>
|
|
<% } else { %>
|
|
<div class="panel-100 no-bg">
|
|
<img class="top-10" src="./images/openradio_logo_neutral.png" height="64px">
|
|
<h2 class="text-monospace text-light">[ADMIN PANEL]</h2>
|
|
<p>You are currently not logged in as an administrator and therefore can't change the settings.</p>
|
|
<p>Please login below.</p>
|
|
</div>
|
|
<div class="panel-100 p-bottom-20">
|
|
<h2>LOGIN</h2>
|
|
<form action="./login" method="post" id="login-form">
|
|
<input style="background-color: var(--color-2);" type="password" id="password" name="password" required>
|
|
<button type="submit" class="br-0 w-100" style="height: 44px;">Login</button>
|
|
</form>
|
|
<div id="login-message"></div>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
<script src="js/settings.js"></script>
|
|
<script src="js/dropdown.js"></script>
|
|
<script src="js/setup.js"></script>
|
|
<script src="js/confighandler.js"></script>
|
|
</body>
|
|
</html>
|