2022-08-25 17:35:28 +03:00
|
|
|
#ifndef CONFIGURATORBASE_H
|
|
|
|
|
#define CONFIGURATORBASE_H
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
|
|
#include "containers/containers_defs.h"
|
|
|
|
|
#include "core/defs.h"
|
2024-04-12 20:00:21 +05:00
|
|
|
#include "core/controllers/serverController.h"
|
2024-04-01 20:20:02 +07:00
|
|
|
#include "settings.h"
|
2022-08-25 17:35:28 +03:00
|
|
|
|
|
|
|
|
class ConfiguratorBase : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2024-04-12 20:00:21 +05:00
|
|
|
explicit ConfiguratorBase(std::shared_ptr<Settings> settings, const QSharedPointer<ServerController> &serverController, QObject *parent = nullptr);
|
2022-08-25 17:35:28 +03:00
|
|
|
|
2024-04-01 20:20:02 +07:00
|
|
|
virtual QString createConfig(const ServerCredentials &credentials, DockerContainer container,
|
|
|
|
|
const QJsonObject &containerConfig, ErrorCode errorCode) = 0;
|
|
|
|
|
|
|
|
|
|
virtual QString processConfigWithLocalSettings(const QPair<QString, QString> &dns, const bool isApiConfig,
|
|
|
|
|
QString &protocolConfigString);
|
|
|
|
|
virtual QString processConfigWithExportSettings(const QPair<QString, QString> &dns, const bool isApiConfig,
|
|
|
|
|
QString &protocolConfigString);
|
|
|
|
|
|
2022-08-25 17:35:28 +03:00
|
|
|
protected:
|
2024-04-01 20:20:02 +07:00
|
|
|
void processConfigWithDnsSettings(const QPair<QString, QString> &dns, QString &protocolConfigString);
|
|
|
|
|
|
2022-08-25 17:35:28 +03:00
|
|
|
std::shared_ptr<Settings> m_settings;
|
2024-04-12 20:00:21 +05:00
|
|
|
QSharedPointer<ServerController> m_serverController;
|
|
|
|
|
|
2022-08-25 17:35:28 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // CONFIGURATORBASE_H
|