mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Rename DispatcherParsing.h -> DispatcherParsing.cpp
Add first parsing function for iohyve fetch, will continue with it tomorrow
This commit is contained in:
@@ -5,8 +5,6 @@
|
||||
// =================================
|
||||
#include "Dispatcher.h"
|
||||
|
||||
#include "DispatcherParsing.h"
|
||||
|
||||
#include "globals.h"
|
||||
|
||||
|
||||
|
||||
@@ -80,6 +80,11 @@ private:
|
||||
|
||||
//Simplification routine for setting up a process
|
||||
DProcess* createProcess(QString ID, QStringList cmds);
|
||||
QJsonObject CreateDispatcherEventNotification(QString, QJsonObject);
|
||||
|
||||
// Functions to do parsing out dispatcher queued tasks
|
||||
// Please keep these sorted
|
||||
QJsonObject parseIohyveFetchOutput(QString outputLog);
|
||||
|
||||
private slots:
|
||||
void mkProcs(Dispatcher::PROC_QUEUE, DProcess *P);
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
// ===============================
|
||||
// PC-BSD REST API Server
|
||||
// PC-BSD REST API Server
|
||||
// Available under the 3-clause BSD License
|
||||
// Written by: Ken Moore <ken@pcbsd.org> 2015-2016
|
||||
// =================================
|
||||
// These static classes are for defining custom Dispatcher/Event notifications
|
||||
// These classes are for defining custom Dispatcher/Event notifications
|
||||
// for individual subsystems
|
||||
//=================================
|
||||
#ifndef _PCBSD_SYSADM_DISPATCH_SUBSYSTEM_FILTER_SYSTEM_H
|
||||
#define _PCBSD_SYSADM_DISPATCH_SUBSYSTEM_FILTER_SYSTEM_H
|
||||
|
||||
#include "globals-qt.h"
|
||||
#include "EventWatcher.h"
|
||||
#include "Dispatcher.h"
|
||||
|
||||
static QJsonObject CreateDispatcherEventNotification(QString ID, QJsonObject log){
|
||||
QJsonObject Dispatcher::CreateDispatcherEventNotification(QString ID, QJsonObject log){
|
||||
//key outputs - need to set these if an event is going to be sent out
|
||||
QJsonObject args; //any arguments to send out
|
||||
QString namesp, name; //the namespace/name of the subsystem used
|
||||
@@ -35,7 +33,8 @@ static QJsonObject CreateDispatcherEventNotification(QString ID, QJsonObject log
|
||||
args.insert("state","finished");
|
||||
}else{
|
||||
args.insert("state","running");
|
||||
args.insert("progress", cLog.section("\n",-1, QString::SectionSkipEmpty)); //send the last line of the fetch
|
||||
args.insert("progress", parseIohyveFetchOutput(cLog));
|
||||
//args.insert("progress", cLog.section("\n",-1, QString::SectionSkipEmpty)); //send the last line of the fetch
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,5 +46,9 @@ static QJsonObject CreateDispatcherEventNotification(QString ID, QJsonObject log
|
||||
return args;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
QJsonObject Dispatcher::parseIohyveFetchOutput(QString output)
|
||||
{
|
||||
qDebug() << "Parsing iohyve log" << output.section("\n", -1, QString::SectionSkipEmpty);
|
||||
QJsonObject ret;
|
||||
return ret;
|
||||
}
|
||||
@@ -13,8 +13,7 @@ HEADERS += globals.h globals-qt.h \
|
||||
SslServer.h \
|
||||
EventWatcher.h \
|
||||
LogManager.h \
|
||||
Dispatcher.h \
|
||||
DispatcherParsing.h
|
||||
Dispatcher.h
|
||||
|
||||
SOURCES += main.cpp \
|
||||
WebServer.cpp \
|
||||
@@ -25,7 +24,8 @@ SOURCES += main.cpp \
|
||||
AuthorizationManager.cpp \
|
||||
EventWatcher.cpp \
|
||||
LogManager.cpp \
|
||||
Dispatcher.cpp
|
||||
Dispatcher.cpp \
|
||||
DispatcherParsing.cpp
|
||||
|
||||
#Now pull in the the subsystem library classes and such
|
||||
include("library/library.pri");
|
||||
|
||||
Reference in New Issue
Block a user