added installController with logic for server/container installation
This commit is contained in:
parent
03a0e2084a
commit
acca85b99a
19 changed files with 519 additions and 151 deletions
|
|
@ -2,6 +2,8 @@ import QtQuick
|
|||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
import PageEnum 1.0
|
||||
|
||||
import "./"
|
||||
|
|
@ -12,32 +14,111 @@ import "../Config"
|
|||
Item {
|
||||
id: root
|
||||
|
||||
property real progressBarValue: 0
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: proxyContainersModel
|
||||
sourceModel: ContainersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "isCurrentlyInstalled"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: root.top
|
||||
anchors.bottom: root.bottom
|
||||
anchors.fill: parent
|
||||
contentHeight: content.height
|
||||
|
||||
ColumnLayout {
|
||||
Column {
|
||||
id: content
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
|
||||
spacing: 16
|
||||
|
||||
HeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20
|
||||
ListView {
|
||||
// todo change id naming
|
||||
id: container
|
||||
width: parent.width
|
||||
height: container.contentItem.height
|
||||
currentIndex: -1
|
||||
clip: true
|
||||
interactive: false
|
||||
model: proxyContainersModel
|
||||
|
||||
//TODO remove later
|
||||
backButtonImage: "qrc:/images/controls/arrow-left.svg"
|
||||
delegate: Item {
|
||||
implicitWidth: container.width
|
||||
implicitHeight: delegateContent.implicitHeight
|
||||
|
||||
headerText: "Установка"
|
||||
descriptionText: ContainersModel.getCurrentlyInstalledContainerName()
|
||||
ColumnLayout {
|
||||
id: delegateContent
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.rightMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
|
||||
HeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20
|
||||
|
||||
headerText: "Установка"
|
||||
descriptionText: name
|
||||
}
|
||||
|
||||
ProgressBarType {
|
||||
id: progressBar
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 32
|
||||
|
||||
value: progressBarValue
|
||||
|
||||
Timer {
|
||||
id: timer
|
||||
|
||||
interval: 300
|
||||
repeat: true
|
||||
running: true
|
||||
onTriggered: {
|
||||
progressBarValue += 0.001
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ParagraphTextType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 8
|
||||
|
||||
text: "Обычно это занимает не больше 5 минут"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: closePageTimer
|
||||
|
||||
interval: 1000
|
||||
repeat: false
|
||||
running: false
|
||||
onTriggered: {
|
||||
// todo go to root installing page
|
||||
PageController.goToPage(PageEnum.PageHome)
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: InstallController
|
||||
|
||||
function onInstallContainerFinished() {
|
||||
progressBarValue = 1
|
||||
closePageTimer.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue