Merge branch 'dev' into feature/import-config-from-cloud
This commit is contained in:
commit
147726ecb0
33 changed files with 1299 additions and 365 deletions
|
|
@ -267,6 +267,10 @@ QJsonObject ImportController::extractWireGuardConfig(const QString &data)
|
|||
// return QJsonObject();
|
||||
// }
|
||||
|
||||
QJsonArray allowedIpsJsonArray = QJsonArray::fromStringList(configMap.value("AllowedIPs").split(","));
|
||||
|
||||
lastConfig[config_key::allowed_ips] = allowedIpsJsonArray;
|
||||
|
||||
QString protocolName = "wireguard";
|
||||
if (!configMap.value(config_key::junkPacketCount).isEmpty()
|
||||
&& !configMap.value(config_key::junkPacketMinSize).isEmpty()
|
||||
|
|
|
|||
|
|
@ -22,10 +22,6 @@ bool ContainersModel::setData(const QModelIndex &index, const QVariant &value, i
|
|||
DockerContainer container = ContainerProps::allContainers().at(index.row());
|
||||
|
||||
switch (role) {
|
||||
case NameRole:
|
||||
// return ContainerProps::containerHumanNames().value(container);
|
||||
case DescriptionRole:
|
||||
// return ContainerProps::containerDescriptions().value(container);
|
||||
case ConfigRole: {
|
||||
m_settings->setContainerConfig(m_currentlyProcessedServerIndex, container, value.toJsonObject());
|
||||
m_containers = m_settings->containers(m_currentlyProcessedServerIndex);
|
||||
|
|
@ -35,19 +31,15 @@ bool ContainersModel::setData(const QModelIndex &index, const QVariant &value, i
|
|||
break;
|
||||
}
|
||||
}
|
||||
case ServiceTypeRole:
|
||||
// return ContainerProps::containerService(container);
|
||||
case DockerContainerRole:
|
||||
// return container;
|
||||
case IsInstalledRole:
|
||||
// return m_settings->containers(m_currentlyProcessedServerIndex).contains(container);
|
||||
case IsDefaultRole: { //todo remove
|
||||
m_settings->setDefaultContainer(m_currentlyProcessedServerIndex, container);
|
||||
m_defaultContainerIndex = container;
|
||||
emit defaultContainerChanged();
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
emit containersModelUpdated();
|
||||
emit dataChanged(index, index);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ protected:
|
|||
|
||||
signals:
|
||||
void defaultContainerChanged();
|
||||
void containersModelUpdated();
|
||||
|
||||
private:
|
||||
QMap<DockerContainer, QJsonObject> m_containers;
|
||||
|
|
|
|||
|
|
@ -201,6 +201,12 @@ bool ServersModel::isDefaultServerConfigContainsAmneziaDns()
|
|||
return primaryDns == protocols::dns::amneziaDnsIp;
|
||||
}
|
||||
|
||||
void ServersModel::updateContainersConfig()
|
||||
{
|
||||
auto server = m_settings->server(m_currentlyProcessedServerIndex);
|
||||
m_servers.replace(m_currentlyProcessedServerIndex, server);
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> ServersModel::roleNames() const
|
||||
{
|
||||
QHash<int, QByteArray> roles;
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ public slots:
|
|||
bool isDefaultServerConfigContainsAmneziaDns();
|
||||
|
||||
QJsonObject getDefaultServerConfig();
|
||||
void updateContainersConfig();
|
||||
|
||||
protected:
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ PageType {
|
|||
function onRestorePageHomeState(isContainerInstalled) {
|
||||
buttonContent.state = "expanded"
|
||||
if (isContainerInstalled) {
|
||||
containersDropDown.menuVisible = true
|
||||
containersDropDown.rootButtonClickedFunction()
|
||||
}
|
||||
}
|
||||
function onForceCloseDrawer() {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ PageType {
|
|||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
visible: GC.isDesktop()
|
||||
visible: true
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
|
|
|
|||
|
|
@ -28,17 +28,11 @@ PageType {
|
|||
ContainersModel.setDefaultContainer(ContainersModel.getCurrentlyProcessedContainerIndex())
|
||||
}
|
||||
|
||||
PageController.goToStartPage()
|
||||
PageController.closePage() // close installing page
|
||||
PageController.closePage() // close protocol settings page
|
||||
|
||||
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) {
|
||||
PageController.restorePageHomeState(true)
|
||||
} else if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSettings)) {
|
||||
PageController.goToPage(PageEnum.PageSettingsServersList, false)
|
||||
PageController.goToPage(PageEnum.PageSettingsServerInfo, false)
|
||||
if (isServiceInstall) {
|
||||
PageController.goToPageSettingsServerServices()
|
||||
}
|
||||
} else {
|
||||
PageController.goToPage(PageEnum.PageHome)
|
||||
}
|
||||
|
||||
PageController.showNotificationMessage(finishedMessage)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue