Files
amnezia-client/client/ui/qml/Pages/PageServerContainers.qml
T

475 lines
19 KiB
QML
Raw Normal View History

2021-07-28 16:13:29 +07:00
import QtQuick 2.12
import QtQuick.Controls 2.12
import "./"
2021-08-19 01:27:22 +03:00
import "../Controls"
import "../Config"
2021-07-28 16:13:29 +07:00
Item {
id: root
2021-09-08 13:52:36 +03:00
enabled: ServerContainersLogic.pageEnabled
2021-07-28 16:13:29 +07:00
ImageButtonType {
id: back
x: 10
y: 10
width: 26
height: 20
icon.source: "qrc:/images/arrow_left.png"
onClicked: {
UiLogic.closePage()
}
}
Text {
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 24
color: "#100A44"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: qsTr("Protocols")
x: 10
y: 35
width: 361
height: 31
}
ProgressBar {
id: progress_bar
anchors.horizontalCenter: parent.horizontalCenter
y: 570
width: 301
height: 40
from: 0
2021-09-07 19:26:58 +03:00
to: ServerContainersLogic.progressBarProtocolsContainerReinstallMaximium
value: ServerContainersLogic.progressBarProtocolsContainerReinstallValue
visible: ServerContainersLogic.progressBarProtocolsContainerReinstallVisible
2021-07-28 16:13:29 +07:00
background: Rectangle {
implicitWidth: parent.width
implicitHeight: parent.height
color: "#100A44"
radius: 4
}
contentItem: Item {
implicitWidth: parent.width
implicitHeight: parent.height
Rectangle {
width: progress_bar.visualPosition * parent.width
height: parent.height
radius: 4
color: Qt.rgba(255, 255, 255, 0.15);
}
}
LabelType {
anchors.fill: parent
text: qsTr("Configuring...")
horizontalAlignment: Text.AlignHCenter
font.family: "Lato"
font.styleName: "normal"
font.pixelSize: 16
color: "#D4D4D4"
}
}
ScrollView {
x: 0
y: 70
width: 380
height: 471
clip: true
Column {
spacing: 5
Rectangle {
id: frame_openvpn_ss_cloak
x: 9
height: 135
width: 363
border.width: 1
border.color: "lightgray"
radius: 2
2021-09-07 19:26:58 +03:00
visible: ServerContainersLogic.frameOpenvpnSsCloakSettingsVisible
2021-07-28 16:13:29 +07:00
Item {
x: 5
y: 5
width: parent.width - 10
height: parent.height - 10
LabelType {
anchors.left: parent.left
width: 239
height: 24
text: qsTr("Cloak container")
leftPadding: 5
}
ImageButtonType {
anchors.right: sr1.left
anchors.rightMargin: 5
checkable: true
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
width: 24
height: 24
2021-09-08 14:23:02 +03:00
checked: ServerContainersLogic.pushButtonCloakOpenVpnContDefaultChecked
2021-08-09 00:41:52 +07:00
onCheckedChanged: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.pushButtonCloakOpenVpnContDefaultChecked = checked
2021-08-09 00:41:52 +07:00
}
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoCloakOpenVpnContDefaultClicked(checked)
2021-08-09 00:41:52 +07:00
}
2021-09-08 14:23:02 +03:00
visible: ServerContainersLogic.pushButtonCloakOpenVpnContDefaultVisible
2021-07-28 16:13:29 +07:00
}
ImageButtonType {
id: sr1
anchors.right: cn1.left
anchors.rightMargin: 5
icon.source: "qrc:/images/share.png"
width: 24
height: 24
2021-09-08 14:23:02 +03:00
visible: ServerContainersLogic.pushButtonCloakOpenVpnContShareVisible
2021-08-09 00:41:52 +07:00
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoCloakOpenVpnContShareClicked(false)
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
ImageButtonType {
id: cn1
anchors.right: parent.right
checkable: true
icon.source: checked ? "qrc:/images/connect_button_connected.png"
: "qrc:/images/connect_button_disconnected.png"
width: 36
height: 24
2021-09-08 14:23:02 +03:00
checked: ServerContainersLogic.pushButtonCloakOpenVpnContInstallChecked
2021-08-09 00:41:52 +07:00
onCheckedChanged: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.pushButtonCloakOpenVpnContInstallChecked = checked
2021-08-09 00:41:52 +07:00
}
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoCloakOpenVpnContInstallClicked(checked)
2021-08-09 00:41:52 +07:00
}
2021-09-08 14:23:02 +03:00
enabled: ServerContainersLogic.pushButtonCloakOpenVpnContInstallEnabled
2021-07-28 16:13:29 +07:00
}
}
Rectangle {
x: 10
y: 42
height: 83
width: 343
border.width: 1
border.color: "lightgray"
radius: 2
SettingButtonType {
x: 10
y: 10
width: 323
height: 24
text: qsTr("OpenVPN settings")
icon.source: "qrc:/images/settings.png"
2021-08-09 00:41:52 +07:00
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoCloakOpenVpnContOpenvpnConfigClicked()
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
SettingButtonType {
x: 10
y: 33
width: 323
height: 24
text: qsTr("ShadowSocks settings")
icon.source: "qrc:/images/settings.png"
2021-08-09 00:41:52 +07:00
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoCloakOpenVpnContSsConfigClicked()
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
SettingButtonType {
x: 10
y: 56
width: 323
height: 24
text: qsTr("Cloak settings")
icon.source: "qrc:/images/settings.png"
2021-08-09 00:41:52 +07:00
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoCloakOpenVpnContCloakConfigClicked()
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
}
}
Rectangle {
id: frame_openvpn_ss
x: 9
height: 105
width: 363
border.width: 1
border.color: "lightgray"
radius: 2
2021-09-07 19:26:58 +03:00
visible: ServerContainersLogic.frameOpenvpnSsSettingsVisible
2021-07-28 16:13:29 +07:00
Item {
x: 5
y: 5
width: parent.width - 10
height: parent.height - 10
LabelType {
anchors.left: parent.left
width: 239
height: 24
text: qsTr("ShadowSocks container")
leftPadding: 5
}
ImageButtonType {
anchors.right: sr2.left
anchors.rightMargin: 5
checkable: true
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
width: 24
height: 24
2021-09-08 14:23:02 +03:00
checked: ServerContainersLogic.pushButtonSsOpenVpnContDefaultChecked
2021-08-09 00:41:52 +07:00
onCheckedChanged: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.pushButtonSsOpenVpnContDefaultChecked = checked
2021-08-09 00:41:52 +07:00
}
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoSsOpenVpnContDefaultClicked(checked)
2021-08-09 00:41:52 +07:00
}
2021-09-08 14:23:02 +03:00
visible: ServerContainersLogic.pushButtonSsOpenVpnContDefaultVisible
2021-07-28 16:13:29 +07:00
}
ImageButtonType {
id: sr2
anchors.right: cn2.left
anchors.rightMargin: 5
icon.source: "qrc:/images/share.png"
width: 24
height: 24
2021-09-08 14:23:02 +03:00
visible: ServerContainersLogic.pushButtonSsOpenVpnContShareVisible
2021-08-09 00:41:52 +07:00
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoSsOpenVpnContShareClicked(false)
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
ImageButtonType {
id: cn2
anchors.right: parent.right
checkable: true
icon.source: checked ? "qrc:/images/connect_button_connected.png"
: "qrc:/images/connect_button_disconnected.png"
width: 36
height: 24
2021-09-08 14:23:02 +03:00
checked: ServerContainersLogic.pushButtonSsOpenVpnContInstallChecked
2021-08-09 00:41:52 +07:00
onCheckedChanged: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.pushButtonSsOpenVpnContInstallChecked = checked
2021-08-09 00:41:52 +07:00
}
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoSsOpenVpnContInstallClicked(checked)
2021-08-09 00:41:52 +07:00
}
2021-09-08 14:23:02 +03:00
enabled: ServerContainersLogic.pushButtonSsOpenVpnContInstallEnabled
2021-07-28 16:13:29 +07:00
}
}
Rectangle {
x: 10
y: 42
height: 53
width: 343
border.width: 1
border.color: "lightgray"
radius: 2
SettingButtonType {
x: 10
y: 5
width: 323
height: 24
text: qsTr("OpenVPN settings")
icon.source: "qrc:/images/settings.png"
2021-08-09 00:41:52 +07:00
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoSsOpenVpnContOpenvpnConfigClicked()
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
SettingButtonType {
x: 10
y: 27
width: 323
height: 24
text: qsTr("ShadowSocks settings")
icon.source: "qrc:/images/settings.png"
2021-08-09 00:41:52 +07:00
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoSsOpenVpnContSsConfigClicked()
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
}
}
Rectangle {
id: frame_openvpn
x: 9
height: 100
width: 363
border.width: 1
border.color: "lightgray"
radius: 2
2021-09-07 19:26:58 +03:00
visible: ServerContainersLogic.frameOpenvpnSettingsVisible
2021-07-28 16:13:29 +07:00
Item {
x: 5
y: 5
width: parent.width - 10
height: parent.height - 10
LabelType {
anchors.left: parent.left
width: 239
height: 24
text: qsTr("OpenVPN container")
leftPadding: 5
}
ImageButtonType {
anchors.right: sr3.left
anchors.rightMargin: 5
checkable: true
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
width: 24
height: 24
2021-09-08 14:23:02 +03:00
checked: ServerContainersLogic.pushButtonOpenVpnContDefaultChecked
2021-08-09 00:41:52 +07:00
onCheckedChanged: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.pushButtonOpenVpnContDefaultChecked = checked
2021-08-09 00:41:52 +07:00
}
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoOpenVpnContDefaultClicked(checked)
2021-08-09 00:41:52 +07:00
}
2021-09-08 14:23:02 +03:00
visible: ServerContainersLogic.pushButtonOpenVpnContDefaultVisible
2021-07-28 16:13:29 +07:00
}
ImageButtonType {
id: sr3
anchors.right: cn3.left
anchors.rightMargin: 5
icon.source: "qrc:/images/share.png"
width: 24
height: 24
2021-09-08 14:23:02 +03:00
visible: ServerContainersLogic.pushButtonOpenVpnContShareVisible
2021-08-09 00:41:52 +07:00
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoOpenVpnContShareClicked(false)
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
ImageButtonType {
id: cn3
anchors.right: parent.right
checkable: true
icon.source: checked ? "qrc:/images/connect_button_connected.png"
: "qrc:/images/connect_button_disconnected.png"
width: 36
height: 24
2021-09-08 14:23:02 +03:00
checked: ServerContainersLogic.pushButtonOpenVpnContInstallChecked
2021-08-09 00:41:52 +07:00
onCheckedChanged: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.pushButtonOpenVpnContInstallChecked = checked
2021-08-09 00:41:52 +07:00
}
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoOpenVpnContInstallClicked(checked)
2021-08-09 00:41:52 +07:00
}
2021-09-08 14:23:02 +03:00
enabled: ServerContainersLogic.pushButtonOpenVpnContInstallEnabled
2021-07-28 16:13:29 +07:00
}
}
Rectangle {
x: 10
y: 42
height: 44
width: 343
border.width: 1
border.color: "lightgray"
radius: 2
SettingButtonType {
x: 10
y: 10
width: 323
height: 24
text: qsTr("OpenVPN settings")
icon.source: "qrc:/images/settings.png"
2021-08-09 00:41:52 +07:00
onClicked: {
2021-09-08 14:23:02 +03:00
ServerContainersLogic.onPushButtonProtoOpenVpnContOpenvpnConfigClicked()
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
}
}
Rectangle {
id: frame_wireguard
x: 9
height: 100
width: 363
border.width: 1
border.color: "lightgray"
radius: 2
2021-09-07 19:26:58 +03:00
visible: ServerContainersLogic.frameWireguardVisible
2021-07-28 16:13:29 +07:00
Item {
x: 5
y: 5
width: parent.width - 10
height: parent.height - 10
LabelType {
anchors.left: parent.left
width: 239
height: 24
text: qsTr("WireGuard container")
leftPadding: 5
}
ImageButtonType {
anchors.right: sr4.left
anchors.rightMargin: 5
checkable: true
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
width: 24
height: 24
2021-09-08 13:52:36 +03:00
checked: ServerContainersLogic.pushButtonWireguardContDefaultChecked
2021-08-09 00:41:52 +07:00
onCheckedChanged: {
2021-09-08 13:52:36 +03:00
ServerContainersLogic.pushButtonWireguardContDefaultChecked = checked
2021-08-09 00:41:52 +07:00
}
onClicked: {
2021-09-07 19:26:58 +03:00
ServerContainersLogic.onPushButtonProtoWireguardContDefaultClicked(checked)
2021-08-09 00:41:52 +07:00
}
2021-09-08 13:52:36 +03:00
visible: ServerContainersLogic.pushButtonWireguardContDefaultVisible
2021-07-28 16:13:29 +07:00
}
ImageButtonType {
id: sr4
anchors.right: cn4.left
anchors.rightMargin: 5
icon.source: "qrc:/images/share.png"
width: 24
height: 24
2021-09-08 13:52:36 +03:00
visible: ServerContainersLogic.pushButtonWireguardContShareVisible
2021-08-09 00:41:52 +07:00
onClicked: {
2021-09-07 19:26:58 +03:00
ServerContainersLogic.onPushButtonProtoWireguardContShareClicked(false)
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
ImageButtonType {
id: cn4
anchors.right: parent.right
checkable: true
icon.source: checked ? "qrc:/images/connect_button_connected.png"
: "qrc:/images/connect_button_disconnected.png"
width: 36
height: 24
2021-09-08 13:52:36 +03:00
checked: ServerContainersLogic.pushButtonWireguardContInstallChecked
2021-08-09 00:41:52 +07:00
onCheckedChanged: {
2021-09-08 13:52:36 +03:00
ServerContainersLogic.pushButtonWireguardContInstallChecked = checked
2021-08-09 00:41:52 +07:00
}
onClicked: {
2021-09-07 19:26:58 +03:00
ServerContainersLogic.onPushButtonProtoWireguardContInstallClicked(checked)
2021-08-09 00:41:52 +07:00
}
2021-09-08 13:52:36 +03:00
enabled: ServerContainersLogic.pushButtonWireguardContInstallEnabled
2021-07-28 16:13:29 +07:00
}
}
Rectangle {
id: frame_wireguard_settings
2021-09-07 19:26:58 +03:00
visible: ServerContainersLogic.frameWireguardSettingsVisible
2021-07-28 16:13:29 +07:00
x: 10
y: 42
height: 44
width: 343
border.width: 1
border.color: "lightgray"
radius: 2
SettingButtonType {
x: 10
y: 10
width: 323
height: 24
text: qsTr("WireGuard settings")
icon.source: "qrc:/images/settings.png"
}
}
}
}
}
}