mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-21 02:01:03 +07:00
fb5666057b
* update UI XRay, add new page PageProtocolXrayTransportSettings.qml PageProtocolXrayXmuxSettings.qml PageProtocolXrayXPaddingSettings.qml * add UI PageProtocolXrayConfigsSettings, PageProtocolXrayFlowSettings, PageProtocolXraySecuritySettings * add Xray-specific keys * add vars xray model * add new qml padding, update model * update model and export * rename file & update name class & update list xray * fixed ui * add save file in temp * remove debug macros * fixed build windows * fix path Windows * remove save config * fixed changes * fixed conf * fixed UI * fixed size & button save * fixed build iOS * fix: fixed headers base control --------- Co-authored-by: vkamn <vk@amnezia.org>
66 lines
2.3 KiB
C++
66 lines
2.3 KiB
C++
#ifndef EXPORTUICONTROLLER_H
|
|
#define EXPORTUICONTROLLER_H
|
|
|
|
#include <QObject>
|
|
|
|
#include "core/controllers/selfhosted/exportController.h"
|
|
#include "core/utils/errorCodes.h"
|
|
|
|
class ExportUiController : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit ExportUiController(ExportController* exportController, QObject *parent = nullptr);
|
|
|
|
Q_PROPERTY(QList<QString> qrCodes READ getQrCodes NOTIFY exportConfigChanged)
|
|
Q_PROPERTY(int qrCodesCount READ getQrCodesCount NOTIFY exportConfigChanged)
|
|
Q_PROPERTY(QString config READ getConfig NOTIFY exportConfigChanged)
|
|
Q_PROPERTY(QString nativeConfigString READ getNativeConfigString NOTIFY exportConfigChanged)
|
|
|
|
public slots:
|
|
void generateFullAccessConfig(const QString &serverId);
|
|
|
|
void generateConnectionConfig(const QString &serverId, int containerIndex, const QString &clientName);
|
|
void generateOpenVpnConfig(const QString &serverId, const QString &clientName);
|
|
void generateWireGuardConfig(const QString &serverId, const QString &clientName);
|
|
void generateAwgConfig(const QString &serverId, int containerIndex, const QString &clientName);
|
|
void generateXrayConfig(const QString &serverId, const QString &clientName);
|
|
void generateQrFromString(const QString &text);
|
|
|
|
QString getConfig();
|
|
QString getNativeConfigString();
|
|
QList<QString> getQrCodes();
|
|
|
|
void exportConfig(const QString &fileName);
|
|
void setConfigFromString(const QString &config, const QString &fileName);
|
|
|
|
void updateClientManagementModel(const QString &serverId, int containerIndex);
|
|
|
|
void revokeConfig(int row, const QString &serverId, int containerIndex);
|
|
|
|
void renameClient(int row, const QString &clientName, const QString &serverId, int containerIndex);
|
|
|
|
signals:
|
|
void generateConfig(int type);
|
|
void revokeConfigFinished();
|
|
void exportErrorOccurred(const QString &errorMessage);
|
|
void exportErrorOccurred(ErrorCode errorCode);
|
|
|
|
void exportConfigChanged();
|
|
|
|
void saveFile(const QString &fileName, const QString &data);
|
|
|
|
private:
|
|
int getQrCodesCount();
|
|
void clearPreviousConfig();
|
|
void applyExportResult(const ExportController::ExportResult &result);
|
|
|
|
ExportController* m_exportController;
|
|
|
|
QString m_config;
|
|
QString m_nativeConfigString;
|
|
QList<QString> m_qrCodes;
|
|
};
|
|
|
|
#endif // EXPORTUICONTROLLER_H
|