moved protocol config generation to VpnConfigirationsController (#665)
Moved protocol config generation to VpnConfigurationsController
This commit is contained in:
parent
82a9e7e27d
commit
a6ca1b12da
70 changed files with 1314 additions and 1458 deletions
|
@ -37,6 +37,8 @@ QVariant ShadowSocksConfigModel::data(const QModelIndex &index, int role) const
|
|||
case Roles::PortRole: return m_protocolConfig.value(config_key::port).toString(protocols::shadowsocks::defaultPort);
|
||||
case Roles::CipherRole:
|
||||
return m_protocolConfig.value(config_key::cipher).toString(protocols::shadowsocks::defaultCipher);
|
||||
case Roles::IsPortEditableRole: return m_container == DockerContainer::ShadowSocks ? true : false;
|
||||
case Roles::IsCipherEditableRole: return m_container == DockerContainer::ShadowSocks ? true : false;
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
|
@ -71,6 +73,8 @@ QHash<int, QByteArray> ShadowSocksConfigModel::roleNames() const
|
|||
|
||||
roles[PortRole] = "port";
|
||||
roles[CipherRole] = "cipher";
|
||||
roles[IsPortEditableRole] = "isPortEditable";
|
||||
roles[IsCipherEditableRole] = "isCipherEditable";
|
||||
|
||||
return roles;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,9 @@ class ShadowSocksConfigModel : public QAbstractListModel
|
|||
public:
|
||||
enum Roles {
|
||||
PortRole = Qt::UserRole + 1,
|
||||
CipherRole
|
||||
CipherRole,
|
||||
IsPortEditableRole,
|
||||
IsCipherEditableRole
|
||||
};
|
||||
|
||||
explicit ShadowSocksConfigModel(QObject *parent = nullptr);
|
||||
|
|
|
@ -63,7 +63,7 @@ void WireGuardConfigModel::updateModel(const QJsonObject &config)
|
|||
|
||||
QJsonObject WireGuardConfigModel::getConfig()
|
||||
{
|
||||
const WgConfig oldConfig(m_fullConfig.value(config_key::awg).toObject());
|
||||
const WgConfig oldConfig(m_fullConfig.value(config_key::wireguard).toObject());
|
||||
const WgConfig newConfig(m_protocolConfig);
|
||||
|
||||
if (!oldConfig.hasEqualServerSettings(newConfig)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue