amnezia-client/client/ui/pages_logic/NewServerProtocolsLogic.cpp
vladimir.kuznetsov 2580475f67 added a button to scan the server for already installed containers
- refactoring of old code, redundant sections of code removed
2023-02-25 17:59:22 +03:00

34 lines
1,018 B
C++

#include "NewServerProtocolsLogic.h"
#include "../uilogic.h"
NewServerProtocolsLogic::NewServerProtocolsLogic(UiLogic *logic, QObject *parent):
PageLogicBase(logic, parent),
m_progressBarConnectionMinimum{0},
m_progressBarConnectionMaximum{100}
{
}
void NewServerProtocolsLogic::onUpdatePage()
{
set_progressBarConnectionMinimum(0);
set_progressBarConnectionMaximum(300);
}
void NewServerProtocolsLogic::onPushButtonConfigureClicked(DockerContainer c, int port, TransportProto tp)
{
Proto mainProto = ContainerProps::defaultProtocol(c);
QJsonObject config {
{ config_key::container, ContainerProps::containerToString(c) },
{ ProtocolProps::protoToString(mainProto), QJsonObject {
{ config_key::port, QString::number(port) },
{ config_key::transport_proto, ProtocolProps::transportProtoToString(tp, mainProto) }}
}
};
QPair<DockerContainer, QJsonObject> container(c, config);
uiLogic()->installServer(container);
}