mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-21 02:01:03 +07:00
f9b106cf5b
* fix: fixed country model update * fix: fixed context menu crush on ios * fix: fixed passphrase dialog freeze * fix: fixed country switch * fix: fixed start minimized * fix: fixed black screen after remove container * refactor: return cloak and ss only for view * fix: fixed default server change after improt while connected * fix: divider visibility * fix: fixed revoke admin user * fix: fixed language restore after backup * fix: link hover for tor settings page * fix: fixed openvpn connecntion status * fix: fixed free color status * fix: fixed client config update * chore: bump version
39 lines
912 B
C++
39 lines
912 B
C++
#ifndef CLIENTMANAGEMENTMODEL_H
|
|
#define CLIENTMANAGEMENTMODEL_H
|
|
|
|
#include <QAbstractListModel>
|
|
#include <QJsonArray>
|
|
|
|
class ClientManagementModel : public QAbstractListModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum Roles {
|
|
ClientIdRole = Qt::UserRole + 1,
|
|
ClientNameRole,
|
|
CreationDateRole,
|
|
LatestHandshakeRole,
|
|
DataReceivedRole,
|
|
DataSentRole,
|
|
AllowedIpsRole
|
|
};
|
|
|
|
explicit ClientManagementModel(QObject *parent = nullptr);
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
public slots:
|
|
void updateModel(const QJsonArray &clients);
|
|
void updateClientName(int row, const QString &newName);
|
|
|
|
protected:
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
|
|
private:
|
|
QJsonArray m_clientsTable;
|
|
};
|
|
|
|
#endif // CLIENTMANAGEMENTMODEL_H
|