You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-27 06:23:53 +01:00
usb device filter for linux
This commit is contained in:
11
index.js
11
index.js
@@ -377,10 +377,13 @@ app.get('/', (req, res) => {
|
|||||||
|
|
||||||
SerialPort.list()
|
SerialPort.list()
|
||||||
.then((deviceList) => {
|
.then((deviceList) => {
|
||||||
serialPorts = deviceList.map(port => ({
|
serialPorts = deviceList
|
||||||
path: port.path,
|
.filter(port => !port.path.startsWith('/dev/ttyS'))
|
||||||
friendlyName: port.friendlyName,
|
.map(port => ({
|
||||||
}));
|
path: port.path,
|
||||||
|
friendlyName: port.friendlyName,
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
parseAudioDevice((result) => {
|
parseAudioDevice((result) => {
|
||||||
res.render('wizard', {
|
res.render('wizard', {
|
||||||
|
|||||||
@@ -144,7 +144,7 @@
|
|||||||
<input id="com-devices" type="text" name="com-devices" placeholder="Choose your USB device" readonly />
|
<input id="com-devices" type="text" name="com-devices" placeholder="Choose your USB device" readonly />
|
||||||
<ul class="options" id="deviceList">
|
<ul class="options" id="deviceList">
|
||||||
<% serialPorts.forEach(serialPort => { %>
|
<% serialPorts.forEach(serialPort => { %>
|
||||||
<li data-value="<%= serialPort.path %>" class="option"><%= serialPort.friendlyName %></li>
|
<li data-value="<%= serialPort.path %>" class="option"><%= serialPort.path %> - <%= serialPort.friendlyName %></li>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
<input id="com-devices" type="text" name="com-devices" placeholder="Choose your USB device" readonly />
|
<input id="com-devices" type="text" name="com-devices" placeholder="Choose your USB device" readonly />
|
||||||
<ul class="options" id="deviceList">
|
<ul class="options" id="deviceList">
|
||||||
<% serialPorts.forEach(serialPort => { %>
|
<% serialPorts.forEach(serialPort => { %>
|
||||||
<li data-value="<%= serialPort.path %>" class="option"><%= serialPort.friendlyName %></li>
|
<li data-value="<%= serialPort.path %>" class="option"><%= serialPort.path %> - <%= serialPort.friendlyName %></li>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user