mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
* Add updated awg container * add missing files * Hide uninstalled AwgLegacy container * Fix resources file * Add role for allowed for installation containers * Add native config sharing for new Awg container * Fix not opening awg settings * Remove AwgLegacy from wizard manual installation page * Fix AmneziaWG settings * chore: update link to submodule * refactor: remove j1-j3 and itime * chore: return s3 s4 fields to ui * fix: awg2 native config compatability * chore: update packet size validation * feat: add awg2 support in self-hosted containers * fix: delete parameters from server config * feat: add H-parameters validation as a strings * chore: update link to submodule * chore: add containers type for awg 1.5 and awg 2 * chore: fixed s3/s4 visibility for awg 1 --------- Co-authored-by: aiamnezia <ai@amnezia.org>
77 lines
1.8 KiB
C++
77 lines
1.8 KiB
C++
#ifndef CONTAINERS_MODEL_H
|
|
#define CONTAINERS_MODEL_H
|
|
|
|
#include <QAbstractListModel>
|
|
#include <QJsonObject>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
#include "containers/containers_defs.h"
|
|
|
|
class ContainersModel : public QAbstractListModel
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
ContainersModel(QObject *parent = nullptr);
|
|
|
|
enum Roles {
|
|
NameRole = Qt::UserRole + 1,
|
|
DescriptionRole,
|
|
DetailedDescriptionRole,
|
|
ServiceTypeRole,
|
|
ConfigRole,
|
|
IsThirdPartyConfigRole,
|
|
DockerContainerRole,
|
|
|
|
IsEasySetupContainerRole,
|
|
EasySetupHeaderRole,
|
|
EasySetupDescriptionRole,
|
|
EasySetupOrderRole,
|
|
|
|
IsInstallationAllowedRole,
|
|
IsInstalledRole,
|
|
IsCurrentlyProcessedRole,
|
|
IsDefaultRole,
|
|
IsSupportedRole,
|
|
IsShareableRole,
|
|
|
|
InstallPageOrderRole
|
|
};
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
QVariant data(const int index, int role) const;
|
|
|
|
public slots:
|
|
void updateModel(const QJsonArray &containers);
|
|
|
|
void setProcessedContainerIndex(int containerIndex);
|
|
int getProcessedContainerIndex();
|
|
|
|
QString getProcessedContainerName();
|
|
|
|
QJsonObject getContainerConfig(const int containerIndex);
|
|
|
|
bool isSupportedByCurrentPlatform(const int containerIndex);
|
|
bool isServiceContainer(const int containerIndex);
|
|
|
|
bool hasInstalledServices();
|
|
bool hasInstalledProtocols();
|
|
|
|
static bool isInstallationAllowed(DockerContainer container);
|
|
|
|
protected:
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
|
|
signals:
|
|
void containersModelUpdated();
|
|
|
|
private:
|
|
QMap<DockerContainer, QJsonObject> m_containers;
|
|
|
|
int m_processedContainerIndex;
|
|
};
|
|
|
|
#endif // CONTAINERS_MODEL_H
|