/** * Initialize web server and add requests */ void webserver_start() { // not found g_server.onNotFound(handleNotFound); #ifdef CAPTIVE_PORTAL // handle captive requests g_server.addHandler(new CaptiveRequestHandler()).setFilter(ON_AP_FILTER); #endif // CDN g_server.on("/js/jquery-2.1.4.min.js", HTTP_GET, [](AsyncWebServerRequest *request) { request->redirect(F("http://code.jquery.com/jquery-2.1.4.min.js")); }).setFilter(ON_STA_FILTER); g_server.on("/css/foundation.min.css", HTTP_GET, [](AsyncWebServerRequest *request) { request->redirect(F("http://cdnjs.cloudflare.com/ajax/libs/foundation/6.2.3/foundation.min.css")); }).setFilter(ON_STA_FILTER); // GET g_server.on("/api/status", HTTP_GET, handleGetStatus); g_server.on("/api/plugins", HTTP_GET, handleGetPlugins); g_server.on("/api/scan", HTTP_GET, handleWifiScan); // POST g_server.on("/settings", HTTP_POST, handleSettings); g_server.on("/restart", HTTP_POST, [](AsyncWebServerRequest *request) { // AsyncWebServerResponse *response = request->beginResponse(302); // response->addHeader("Location", net_hostname + ".local"); // request->send(response); request->send(200, F(CONTENT_TYPE_HTML), F("<!DOCTYPE html><html><head><meta http-equiv=\"refresh\" content=\"5; url=/\"></head><body>Restarting...<br/><img src=\"/img/loading.gif\"></body></html>")); requestRestart(); }); // make sure config.json is not served! g_server.on("/config.json", HTTP_GET, [](AsyncWebServerRequest *request) { request->send(400); }); // catch-all g_server.serveStatic("/", SPIFFS, "/", CACHE_HEADER).setDefaultFile("index.html"); // sensor api registerPlugins(); #ifdef SPIFFS_EDITOR g_server.addHandler(new SPIFFSEditor()); #endif #ifdef BROWSER_EVENTS g_server.addHandler(&g_events); #endif // start server g_server.begin(); }
DrishtiImport::DrishtiImport(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); setWindowIcon(QPixmap(":/images/drishti_import_32.png")); setWindowTitle(QString("DrishtiImport v") + QString(DRISHTI_VERSION)); setAcceptDrops(true); m_remapWidget = new RemapWidget(); setCentralWidget(m_remapWidget); StaticFunctions::initQColorDialog(); loadSettings(); registerPlugins(); Global::setStatusBar(statusBar()); }
Factory::Factory(const std::string& pluginPath) : _parentFactory(NULL), _pluginPath(pluginPath) { registerPlugins(); }
Factory::Factory(const std::string& pluginPath, Factory* parentFactory) : _parentFactory(parentFactory), _pluginPath(pluginPath) { registerPlugins(); }