added client management panel

- added classes for displaying the client management panel
- added class for displaying the client info
- added page to display a list of clients
- added page to display OpenVpn client information
- added diagram with OpenVpn certificate revocation process
This commit is contained in:
vladimir.kuznetsov 2023-01-09 12:38:01 +03:00
parent 3f257af7a9
commit a42beb86c0
19 changed files with 771 additions and 102 deletions

View file

@ -0,0 +1,42 @@
#ifndef CLIENTMANAGEMENTMODEL_H
#define CLIENTMANAGEMENTMODEL_H
#include <QAbstractListModel>
#include "settings.h"
class ClientManagementModel : public QAbstractListModel
{
Q_OBJECT
public:
enum ClientRoles {
NameRole = Qt::UserRole + 1,
CertIdRole,
CertDataRole
};
struct ClientInfo
{
QString name;
QString certId;
QString certData;
};
ClientManagementModel(std::shared_ptr<Settings> settings, QObject *parent = nullptr);
void clearData();
void setContent(const QVector<ClientInfo> &data);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
void setData(const QModelIndex &index, QVariant data, int role = Qt::DisplayRole);
protected:
QHash<int, QByteArray> roleNames() const override;
private:
std::shared_ptr<Settings> m_settings; //TODO remove this?
QVector<ClientInfo> m_content;
};
#endif // CLIENTMANAGEMENTMODEL_H