From d07658ee2147b1c3486a12e0f2aa74ca0be73bda Mon Sep 17 00:00:00 2001 From: q5sys Date: Thu, 2 Nov 2017 11:48:25 -0400 Subject: [PATCH] more api work for sourcectl --- src/server/DispatcherParsing.cpp | 43 +++++++++++++++++++++++++++++--- src/server/WebBackend.cpp | 6 ----- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/server/DispatcherParsing.cpp b/src/server/DispatcherParsing.cpp index 77ef1ff..a26842a 100644 --- a/src/server/DispatcherParsing.cpp +++ b/src/server/DispatcherParsing.cpp @@ -90,9 +90,25 @@ QJsonObject Dispatcher::CreateDispatcherEventNotification(QString ID, QJsonObjec }else if(full_log && ID.section("::",0,0)=="sysadm_sourcectl_downloadsource"){ //qDebug() << "Got update check process finished"; sysadm::sourcectl::saveSourceLog(cLog); //save this for use later - } - }else if(ID.startsWith("sysadm_sourcectl")){ + if(ID.section("::",0,0)=="sysadm_sourcectl_updatesource"){ + namesp = "sysadm"; name="soucectl"; + //No special parsing here: the git output should be available as-is + args.insert("update_log",cLog); + }else if(full_log && ID.section("::",0,0)=="sysadm_sourcectl_updatesource"){ + //qDebug() << "Got update check process finished"; + sysadm::sourcectl::saveSourceLog(cLog); //save this for use later + } + }else if(ID.startsWith("sysadm_sourcectl")){ + if(ID.section("::",0,0)=="sysadm_sourcectl_deleteports"){ + namesp = "sysadm"; name="soucectl"; + //No special parsing here: the git output should be available as-is + args.insert("update_log",cLog); + }else if(full_log && ID.section("::",0,0)=="sysadm_sourcectl_deleteports"){ + //qDebug() << "Got update check process finished"; + sysadm::sourcectl::savePortsLog(cLog); //save this for use later + } + }else if(ID.startsWith("sysadm_sourcectl")){ if(ID.section("::",0,0)=="sysadm_sourcectl_downloadports"){ namesp = "sysadm"; name="soucectl"; //No special parsing here: the git output should be available as-is @@ -100,8 +116,27 @@ QJsonObject Dispatcher::CreateDispatcherEventNotification(QString ID, QJsonObjec }else if(full_log && ID.section("::",0,0)=="sysadm_sourcectl_downloadports"){ //qDebug() << "Got update check process finished"; sysadm::sourcectl::savePortsLog(cLog); //save this for use later -} -} + } + }else if(ID.startsWith("sysadm_sourcectl")){ + if(ID.section("::",0,0)=="sysadm_sourcectl_updateports"){ + namesp = "sysadm"; name="soucectl"; + //No special parsing here: the git output should be available as-is + args.insert("update_log",cLog); + }else if(full_log && ID.section("::",0,0)=="sysadm_sourcectl_updateports"){ + //qDebug() << "Got update check process finished"; + sysadm::sourcectl::savePortsLog(cLog); //save this for use later + } + }else if(ID.startsWith("sysadm_sourcectl")){ + if(ID.section("::",0,0)=="sysadm_sourcectl_deleteports"){ + namesp = "sysadm"; name="soucectl"; + //No special parsing here: the git output should be available as-is + args.insert("update_log",cLog); + }else if(full_log && ID.section("::",0,0)=="sysadm_sourcectl_deleteports"){ + //qDebug() << "Got update check process finished"; + sysadm::sourcectl::savePortsLog(cLog); //save this for use later + } + } + } //Now assemble the output as needed if(namesp.isEmpty() || name.isEmpty()){ return QJsonObject(); } //no event diff --git a/src/server/WebBackend.cpp b/src/server/WebBackend.cpp index 4a616f5..067ff17 100644 --- a/src/server/WebBackend.cpp +++ b/src/server/WebBackend.cpp @@ -612,12 +612,6 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmSystemMgmtRequest(const QJso ok = true; out->insert("deviceinfo", sysadm::SysMgmt::systemDevices()); } - else if(act=="fetch_ports"){ - ok = true; - QString altdir; - if(keys.contains("ports_dir")){ altdir = in_args.toObject().value("ports_dir").toString(); } - out->insert("fetch_ports", sysadm::SysMgmt::fetchPortsTree(altdir)); - } } //end of "action" key usage