mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 02:20:17 +00:00
[API CHANGE] Add a new API call for sysadm/update: action="applyupdate".
This takes no other inputs, and returns the following:
{
"applyupdate" : {
"result" : "rebooting to apply updates"
}
}
This commit is contained in:
@@ -650,6 +650,10 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmUpdateRequest(const QJsonVal
|
||||
ok = true;
|
||||
out->insert("stopupdate", sysadm::Update::stopUpdate() );
|
||||
|
||||
}else if(act=="applyupdate"){
|
||||
ok = true;
|
||||
out->insert("applyupdate", sysadm::Update::applyUpdates() );
|
||||
|
||||
}else if(act=="listsettings"){
|
||||
ok = true;
|
||||
out->insert("listsettings", sysadm::Update::readSettings() );
|
||||
|
||||
@@ -267,6 +267,12 @@ QJsonObject Update::stopUpdate() {
|
||||
return ret;
|
||||
}
|
||||
|
||||
QJsonObject Update::applyUpdates(){
|
||||
QJsonObject ret;
|
||||
QProcess::startDetached("pc-updatemanager startupdate");
|
||||
ret.insert("result","rebooting to complete updates");
|
||||
return ret;
|
||||
}
|
||||
//SETTINGS OPTIONS
|
||||
QJsonObject Update::readSettings(){
|
||||
QJsonObject ret;
|
||||
|
||||
@@ -25,6 +25,7 @@ public:
|
||||
//Start/stop update routine
|
||||
static QJsonObject startUpdate(QJsonObject);
|
||||
static QJsonObject stopUpdate();
|
||||
static QJsonObject applyUpdates();
|
||||
//Read/write update settings
|
||||
static QJsonObject readSettings();
|
||||
static QJsonObject writeSettings(QJsonObject);
|
||||
|
||||
Reference in New Issue
Block a user