added display of wireguard configs, such a config will be displayed as raw text
This commit is contained in:
parent
99a6cd82b2
commit
6941b7463e
10 changed files with 142 additions and 14 deletions
30
client/ui/pages_logic/protocols/WireGuardLogic.cpp
Normal file
30
client/ui/pages_logic/protocols/WireGuardLogic.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "WireGuardLogic.h"
|
||||
#include "core/servercontroller.h"
|
||||
#include <functional>
|
||||
#include "../../uilogic.h"
|
||||
|
||||
using namespace amnezia;
|
||||
using namespace PageEnumNS;
|
||||
|
||||
WireGuardLogic::WireGuardLogic(UiLogic *logic, QObject *parent):
|
||||
PageProtocolLogicBase(logic, parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void WireGuardLogic::updateProtocolPage(const QJsonObject &wireGuardConfig, DockerContainer container, bool haveAuthData, bool isThirdPartyConfig)
|
||||
{
|
||||
qDebug() << "WireGuardLogic::updateProtocolPage";
|
||||
|
||||
auto lastConfigJsonDoc = QJsonDocument::fromJson(wireGuardConfig.value(config_key::last_config).toString().toUtf8());
|
||||
auto lastConfigJson = lastConfigJsonDoc.object();
|
||||
|
||||
QString wireGuardLastConfigText;
|
||||
QStringList lines = lastConfigJson.value(config_key::config).toString().replace("\r", "").split("\n");
|
||||
for (const QString &l: lines) {
|
||||
wireGuardLastConfigText.append(l + "\n");
|
||||
}
|
||||
|
||||
set_wireGuardLastConfigText(wireGuardLastConfigText);
|
||||
set_isThirdPartyConfig(isThirdPartyConfig);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue