webui - "cgi" handler and multiple fixes (#700)

* initial commit of webconfig

* update example config with webconfig and fix format of file
update debian postinst script for install example config

* fix compiling
add new web server command "serverinfo" to use in webapp to retrieve json port

* change web default port to 8099

* add cgi engine to webserver

* fix include
This commit is contained in:
redPanther
2016-06-14 20:14:06 +02:00
committed by brindosch
parent eb64e7e528
commit 4a841710dd
12 changed files with 193 additions and 67 deletions

View File

@@ -67,7 +67,7 @@ public:
///
/// @param[in] jsonConfig The Json configuration
///
Hyperion(const Json::Value& jsonConfig);
Hyperion(const Json::Value& jsonConfig, const std::string configFile);
///
/// Destructor; cleans up resourcess
@@ -110,6 +110,11 @@ public:
/// Get the list of active effects
/// @return The list of active effects
const std::list<ActiveEffectDefinition> &getActiveEffects();
///
const Json::Value& getJsonConfig() { return _jsonConfig; };
std::string getConfigFileName() { return _configFile; };
public slots:
///
@@ -293,6 +298,12 @@ private:
// proto and json Message forwarder
MessageForwarder * _messageForwarder;
// json configuration
const Json::Value& _jsonConfig;
// the name of config file
std::string _configFile;
/// The timer for handling priority channel timeouts
QTimer _timer;
};

View File

@@ -5,6 +5,7 @@
#include <QString>
#include <string>
#include <utils/jsonschema/JsonFactory.h>
#include <hyperion/Hyperion.h>
class StaticFileServing;
@@ -12,8 +13,7 @@ class WebConfig : public QObject {
Q_OBJECT
public:
WebConfig (std::string baseUrl, quint16 port, quint16 jsonPort, QObject * parent = NULL);
WebConfig (const Json::Value &config, QObject * parent = NULL);
WebConfig (Hyperion *hyperion, QObject * parent = NULL);
virtual ~WebConfig (void);
@@ -21,10 +21,9 @@ public:
void stop();
private:
QObject* _parent;
Hyperion* _hyperion;
QString _baseUrl;
quint16 _port;
quint16 _jsonPort;
StaticFileServing* _server;
const std::string WEBCONFIG_DEFAULT_PATH = "/usr/share/hyperion/webconfig";