mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Add new WebBackendSlots.cpp which has the initial slots for
Iohvye Fetch processing
This commit is contained in:
@@ -584,7 +584,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIohyveRequest(const QJsonVal
|
||||
}
|
||||
if(act=="fetchiso"){
|
||||
ok = true;
|
||||
out->insert("fetchiso", sysadm::Iohyve::fetchISO(in_args.toObject()));
|
||||
DProcess *fetchproc;
|
||||
out->insert("fetchiso", sysadm::Iohyve::fetchISO(in_args.toObject(), fetchproc));
|
||||
connect(fetchproc, SIGNAL(ProcessOutput(QString)), this, SLOT(slotIohyveFetchProcessOutput(QString)) );
|
||||
connect(fetchproc, SIGNAL(Finished(QString, int, QString)), this, SLOT(slotIohyveFetchDone(QString, int, QString)) );
|
||||
}
|
||||
if(act=="install"){
|
||||
ok = true;
|
||||
|
||||
22
src/server/WebBackendSlots.cpp
Normal file
22
src/server/WebBackendSlots.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
// ===============================
|
||||
// Slots for long running Library Tasks
|
||||
// Available under the 3-clause BSD License
|
||||
// Written by: Kris Moore <kris@pcbsd.org> FEB 2016
|
||||
// =================================
|
||||
#include <WebSocket.h>
|
||||
#define DEBUG 0
|
||||
|
||||
|
||||
// Iohyve Fetch is done
|
||||
void WebSocket::slotIohyveFetchDone(QString id, int retcode, QString log)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Iohyve Fetch has output to read
|
||||
void WebSocket::slotIohyveFetchProcessOutput(QString output)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
@@ -79,6 +79,10 @@ private slots:
|
||||
void nowEncrypted(); //the socket/connection is now encrypted
|
||||
void peerError(const QSslError&); //peerVerifyError() signal
|
||||
void SslError(const QList<QSslError>&); //sslErrors() signal
|
||||
|
||||
// Library Slots
|
||||
void slotIohyveFetchDone(QString, int, QString);
|
||||
void slotIohyveFetchReadyRead();
|
||||
|
||||
public slots:
|
||||
void EventUpdate(EventWatcher::EVENT_TYPE, QJsonValue = QJsonValue() );
|
||||
|
||||
@@ -44,7 +44,7 @@ QJsonObject Iohyve::createGuest(QJsonObject jsin) {
|
||||
}
|
||||
|
||||
// Queue the fetch of an ISO
|
||||
QJsonObject Iohyve::fetchISO(QJsonObject jsin) {
|
||||
QJsonObject Iohyve::fetchISO(QJsonObject jsin, DProcess *returnproc) {
|
||||
QJsonObject retObject;
|
||||
|
||||
QStringList keys = jsin.keys();
|
||||
@@ -60,7 +60,7 @@ QJsonObject Iohyve::fetchISO(QJsonObject jsin) {
|
||||
QString ID = QUuid::createUuid().toString();
|
||||
|
||||
// Queue the fetch action
|
||||
DISPATCHER->queueProcess(ID, "iohyve fetch " + url);
|
||||
returnproc = DISPATCHER->queueProcess(ID, "iohyve fetch " + url);
|
||||
|
||||
// Return some details to user that the action was queued
|
||||
retObject.insert("command", "iohyve fetch " + url);
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
|
||||
#include <QJsonObject>
|
||||
#include "sysadm-global.h"
|
||||
#include "globals.h"
|
||||
|
||||
namespace sysadm{
|
||||
|
||||
class Iohyve{
|
||||
public:
|
||||
static QJsonObject createGuest(QJsonObject);
|
||||
static QJsonObject fetchISO(QJsonObject);
|
||||
static QJsonObject fetchISO(QJsonObject, DProcess *);
|
||||
static QJsonObject installGuest(QJsonObject);
|
||||
static QJsonObject isSetup();
|
||||
static QJsonObject listVMs();
|
||||
@@ -24,6 +25,7 @@ public:
|
||||
static QJsonObject setupIohyve(QJsonObject);
|
||||
static QJsonObject startGuest(QJsonObject);
|
||||
static QJsonObject stopGuest(QJsonObject);
|
||||
|
||||
};
|
||||
|
||||
} //end of pcbsd namespace
|
||||
|
||||
@@ -19,6 +19,7 @@ SOURCES += main.cpp \
|
||||
WebServer.cpp \
|
||||
WebSocket.cpp \
|
||||
WebBackend.cpp \
|
||||
WebBackendSlots.cpp \
|
||||
syscache-client.cpp \
|
||||
AuthorizationManager.cpp \
|
||||
EventWatcher.cpp \
|
||||
|
||||
Reference in New Issue
Block a user