Ngrok: Add toggle to start/stop service manually
This commit is contained in:
parent
2cbe1a7ec6
commit
957071fd42
|
@ -226,6 +226,19 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid
|
|||
});
|
||||
list->addItem(hiddenNetworkButton);
|
||||
|
||||
// Ngrok
|
||||
QProcess process;
|
||||
process.start("sudo service ngrok status | grep running");
|
||||
process.waitForFinished();
|
||||
QString output = QString(process.readAllStandardOutput());
|
||||
bool ngrokRunning = !output.isEmpty();
|
||||
ToggleControl *ngrokToggle = new ToggleControl(tr("Ngrok Service"), "", "", ngrokRunning);
|
||||
connect(ngrokToggle, &ToggleControl::toggleFlipped, [=](bool state) {
|
||||
if (state) std::system("sudo ngrok service start");
|
||||
else std::system("sudo ngrok service stop");
|
||||
});
|
||||
list->addItem(ngrokToggle);
|
||||
|
||||
// Set initial config
|
||||
wifi->updateGsmSettings(roamingEnabled, QString::fromStdString(params.get("GsmApn")), metered);
|
||||
|
||||
|
|
Loading…
Reference in New Issue