added ui for proxy container (#762)

Added proxy container
This commit is contained in:
Nethius 2024-06-10 18:35:24 +07:00 committed by GitHub
parent 4f8f873682
commit c22f9ff08a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 633 additions and 11 deletions

View file

@ -0,0 +1,40 @@
#ifndef SOCKS5PROXYCONFIGMODEL_H
#define SOCKS5PROXYCONFIGMODEL_H
#include <QAbstractListModel>
#include <QJsonObject>
#include "containers/containers_defs.h"
class Socks5ProxyConfigModel : public QAbstractListModel
{
Q_OBJECT
public:
enum Roles {
PortRole = Qt::UserRole + 1,
UserNameRole,
PasswordRole
};
explicit Socks5ProxyConfigModel(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 // SOCKS5PROXYCONFIGMODEL_H