mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
ws281x - Update logic to identify is user is admin (#1623)
This commit is contained in:
parent
c0dc08b0c0
commit
d1879c2e39
@ -2069,7 +2069,7 @@ var updateOutputSelectList = function (ledType, discoveryInfo) {
|
|||||||
case "devRPiPWM":
|
case "devRPiPWM":
|
||||||
key = ledType;
|
key = ledType;
|
||||||
|
|
||||||
if (discoveryInfo.devices.length == 0) {
|
if (!discoveryInfo.isUserAdmin) {
|
||||||
enumVals.push("NONE");
|
enumVals.push("NONE");
|
||||||
enumTitleVals.push($.i18n('edt_dev_spec_devices_discovered_none'));
|
enumTitleVals.push($.i18n('edt_dev_spec_devices_discovered_none'));
|
||||||
$('#btn_submit_controller').prop('disabled', true);
|
$('#btn_submit_controller').prop('disabled', true);
|
||||||
|
@ -159,12 +159,10 @@ QJsonObject LedDeviceWS281x::discover(const QJsonObject& /*params*/)
|
|||||||
|
|
||||||
QJsonArray deviceList;
|
QJsonArray deviceList;
|
||||||
|
|
||||||
if (SysInfo::isUserAdmin())
|
//Indicate the general availability of the device, if hyperion is run under root
|
||||||
{
|
devicesDiscovered.insert("isUserAdmin", SysInfo::isUserAdmin());
|
||||||
//Indicate the general availability of the device, if hyperion is run under root
|
|
||||||
deviceList << QJsonObject ({{"found",true}});
|
devicesDiscovered.insert("devices", deviceList);
|
||||||
devicesDiscovered.insert("devices", deviceList);
|
|
||||||
}
|
|
||||||
|
|
||||||
DebugIf(verbose,_log, "devicesDiscovered: [%s]", QString(QJsonDocument(devicesDiscovered).toJson(QJsonDocument::Compact)).toUtf8().constData());
|
DebugIf(verbose,_log, "devicesDiscovered: [%s]", QString(QJsonDocument(devicesDiscovered).toJson(QJsonDocument::Compact)).toUtf8().constData());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user