mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
"added display of busy server package manager on the PageSetupWizardInstalling"
This commit is contained in:
@@ -85,6 +85,7 @@ void InstallController::install(DockerContainer container, int port, TransportPr
|
||||
void InstallController::installServer(DockerContainer container, QJsonObject &config)
|
||||
{
|
||||
ServerController serverController(m_settings);
|
||||
connect(&serverController, &ServerController::serverIsBusy, this, &InstallController::serverIsBusy);
|
||||
|
||||
QMap<DockerContainer, QJsonObject> installedContainers;
|
||||
ErrorCode errorCode =
|
||||
@@ -138,6 +139,7 @@ void InstallController::installContainer(DockerContainer container, QJsonObject
|
||||
qvariant_cast<ServerCredentials>(m_serversModel->data(serverIndex, ServersModel::Roles::CredentialsRole));
|
||||
|
||||
ServerController serverController(m_settings);
|
||||
connect(&serverController, &ServerController::serverIsBusy, this, &InstallController::serverIsBusy);
|
||||
|
||||
QMap<DockerContainer, QJsonObject> installedContainers;
|
||||
ErrorCode errorCode = serverController.getAlreadyInstalledContainers(serverCredentials, installedContainers);
|
||||
@@ -239,6 +241,7 @@ void InstallController::updateContainer(QJsonObject config)
|
||||
qvariant_cast<QJsonObject>(m_containersModel->data(modelIndex, ContainersModel::Roles::ConfigRole));
|
||||
|
||||
ServerController serverController(m_settings);
|
||||
connect(&serverController, &ServerController::serverIsBusy, this, &InstallController::serverIsBusy);
|
||||
|
||||
auto errorCode = serverController.updateContainer(serverCredentials, container, oldContainerConfig, config);
|
||||
if (errorCode == ErrorCode::NoError) {
|
||||
|
||||
@@ -60,6 +60,8 @@ signals:
|
||||
void passphraseRequestStarted();
|
||||
void passphraseRequestFinished();
|
||||
|
||||
void serverIsBusy(const bool isBusy);
|
||||
|
||||
private:
|
||||
void installServer(DockerContainer container, QJsonObject &config);
|
||||
void installContainer(DockerContainer container, QJsonObject &config);
|
||||
|
||||
@@ -75,7 +75,7 @@ PageType {
|
||||
repeat: true
|
||||
running: true
|
||||
onTriggered: {
|
||||
progressBar.value += 0.001
|
||||
progressBar.value += 0.003
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,9 @@ PageType {
|
||||
Component.onCompleted: PageController.enableTabBar(false)
|
||||
Component.onDestruction: PageController.enableTabBar(true)
|
||||
|
||||
property bool isTimerRunning: true
|
||||
property string progressBarText: qsTr("Usually it takes no more than 5 minutes")
|
||||
|
||||
Connections {
|
||||
target: InstallController
|
||||
|
||||
@@ -57,6 +60,18 @@ PageType {
|
||||
|
||||
PageController.showErrorMessage(qsTr("The server has already been added to the application"))
|
||||
}
|
||||
|
||||
function onServerIsBusy(isBusy) {
|
||||
if (isBusy) {
|
||||
root.progressBarText = qsTr("Amnesia has detected that your server is currently ") +
|
||||
qsTr("busy installing other software. Amnesia installation ") +
|
||||
qsTr("will pause until the server finishes installing other software")
|
||||
root.isTimerRunning = false
|
||||
} else {
|
||||
root.progressBarText = qsTr("Usually it takes no more than 5 minutes")
|
||||
root.isTimerRunning = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SortFilterProxyModel {
|
||||
@@ -122,18 +137,20 @@ PageType {
|
||||
|
||||
interval: 300
|
||||
repeat: true
|
||||
running: true
|
||||
running: root.isTimerRunning
|
||||
onTriggered: {
|
||||
progressBar.value += 0.001
|
||||
progressBar.value += 0.003
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ParagraphTextType {
|
||||
id: progressText
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 8
|
||||
|
||||
text: qsTr("Usually it takes no more than 5 minutes")
|
||||
text: root.progressBarText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user