amnezia-client/client/ui/models/protocols/xrayConfigModel.h
Mitternacht822 a28ed6a977
feature: added the ability to change port after installing xray (#1556)
* added the ability to change port after installing xray

* fixed issue with not updating server config for xray on windows platform

* fixed some warning in exportcontroller.cpp
2025-05-12 21:14:59 +07:00

39 lines
890 B
C++

#ifndef XRAYCONFIGMODEL_H
#define XRAYCONFIGMODEL_H
#include <QAbstractListModel>
#include <QJsonObject>
#include "containers/containers_defs.h"
class XrayConfigModel : public QAbstractListModel
{
Q_OBJECT
public:
enum Roles {
SiteRole,
PortRole
};
explicit XrayConfigModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
public slots:
void updateModel(const QJsonObject &config);
QJsonObject getConfig();
protected:
QHash<int, QByteArray> roleNames() const override;
private:
DockerContainer m_container;
QJsonObject m_protocolConfig;
QJsonObject m_fullConfig;
};
#endif // XRAYCONFIGMODEL_H