Skip to content
Snippets Groups Projects
Commit e0f4af16 authored by aleksandr.ledyaev's avatar aleksandr.ledyaev
Browse files

Add VPN service

[*] DapMainApplicationWindow.qml
[+] DapCreateVPNOrderPanel.qml; DapNoOrdersPanel.qml; DapTextButton.qml;
DapVPNServiceTab.qml; DapVPNServiceTopPanel.qml; icon_vpn-service.svg;
icon_vpn-service_hover.svg; illustration_vpn-service.svg
parent 7bf4c3b8
No related branches found
No related tags found
1 merge request!11Cellframe clone
Showing
with 250 additions and 0 deletions
......@@ -190,5 +190,13 @@
<file>resources/icons/next-page.svg</file>
<file>resources/icons/next-page_hover.svg</file>
<file>screen/desktop/DapRightPanel_New.qml</file>
<file>screen/desktop/VPNService/DapVPNServiceTab.qml</file>
<file>screen/desktop/VPNService/DapVPNServiceTopPanel.qml</file>
<file>resources/icons/icon_vpn-service.svg</file>
<file>resources/icons/icon_vpn-service_hover.svg</file>
<file>screen/desktop/VPNService/DapNoOrdersPanel.qml</file>
<file>screen/desktop/VPNService/DapTextButton.qml</file>
<file>screen/desktop/VPNService/DapCreateVPNOrderPanel.qml</file>
<file>resources/illustrations/illustration_vpn-service.svg</file>
</qresource>
</RCC>
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18.4" viewBox="0 0 18 18.4"><g transform="translate(-29 -116.8)"><rect width="18" height="18" transform="translate(29 117)" fill="none"/><path d="M184.687,63.976l-1.545-.889a1.361,1.361,0,1,1,.274-.472l1.545.889,3.516-2.024V59.7a1.368,1.368,0,1,1,.547,0v1.779L192.54,63.5l1.545-.889a1.368,1.368,0,1,1,.273.472l-1.545.889v4.049l1.545.889a1.361,1.361,0,1,1-.273.472L192.54,68.5l-3.516,2.024V72.3a1.368,1.368,0,1,1-.547,0V70.521L184.961,68.5l-1.545.889a1.368,1.368,0,1,1-.274-.472l1.545-.889Zm4.063-2.024-3.516,2.024v4.049l3.516,2.024,3.516-2.024V63.976Zm0-2.769a.818.818,0,1,0-.821-.818A.819.819,0,0,0,188.75,59.182Zm7.042,3.709a.819.819,0,1,0-1.121-.3A.817.817,0,0,0,195.793,62.89Zm-1.121,6.519a.82.82,0,1,0,1.121-.3A.817.817,0,0,0,194.672,69.409Zm-5.922,3.409a.818.818,0,1,0,.821.818A.819.819,0,0,0,188.75,72.818Zm-5.922-3.409a.82.82,0,1,0-.3,1.118A.822.822,0,0,0,182.829,69.409Zm0-6.818a.82.82,0,1,0-1.121.3A.817.817,0,0,0,182.829,62.591Z" transform="translate(-150.751 60)" fill="#fff" stroke="#fff" stroke-width="0.4"/></g></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18.4" viewBox="0 0 18 18.4"><g transform="translate(-29 -116.8)"><rect width="18" height="18" transform="translate(29 117)" fill="none"/><path d="M184.687,63.976l-1.545-.889a1.361,1.361,0,1,1,.274-.472l1.545.889,3.516-2.024V59.7a1.368,1.368,0,1,1,.547,0v1.779L192.54,63.5l1.545-.889a1.368,1.368,0,1,1,.273.472l-1.545.889v4.049l1.545.889a1.361,1.361,0,1,1-.273.472L192.54,68.5l-3.516,2.024V72.3a1.368,1.368,0,1,1-.547,0V70.521L184.961,68.5l-1.545.889a1.368,1.368,0,1,1-.274-.472l1.545-.889Zm4.063-2.024-3.516,2.024v4.049l3.516,2.024,3.516-2.024V63.976Z" transform="translate(-150.751 60)" fill="#fff" stroke="#fff" stroke-width="0.4"/></g></svg>
\ No newline at end of file
......@@ -15,6 +15,8 @@ Item {
readonly property string exchangeScreen: "qrc:/screen/" + device + "/Exchange/DapExchangeTab.qml"
///@detalis Path to the history tab.
readonly property string historyScreen: "qrc:/screen/" + device + "/History/DapHistoryTab.qml"
///@detalis Path to the VPN service tab.
readonly property string vpnServiceScreen: "qrc:/screen/" + device + "/VPNService/DapVPNServiceTab.qml"
///@detalis Path to the settings tab.
readonly property string settingsScreen: "qrc:/screen/" + device + "/Settings/DapSettingsTab.qml"
///@detalis Path to the logs tab.
......@@ -212,6 +214,14 @@ Item {
})
append ({
name: qsTr("VPN service"),
page: vpnServiceScreen,
normalIcon: "qrc:/resources/icons/icon_vpn-service.svg",
hoverIcon: "qrc:/resources/icons/icon_vpn-service_hover.svg"
})
append ({
name: qsTr("Console"),
page: consoleScreen,
......
import QtQuick 2.7
Rectangle {
color: "green"
}
import QtQuick 2.7
import "qrc:/widgets"
Item {
id: control
signal newVPNOrder
Column {
anchors.centerIn: control
spacing: 22 * pt
Image {
sourceSize: Qt.size(500 * pt, 261 * pt)
source: "qrc:/resources/illustrations/illustration_vpn-service.svg"
}
Text {
anchors.horizontalCenter: parent.horizontalCenter
font: quicksandFonts.medium26
text: qsTr("Create your first VPN order")
}
DapTextButton {
anchors.horizontalCenter: parent.horizontalCenter
width: 163 * pt
height: 36 * pt
textColor: "#FFFFFF"
textColorHover: "#FFFFFF"
backgroundColor: "#271C4E"
backgroundColorHover: "#D51F5D"
backgroudRadius: 4 * pt
font: quicksandFonts.medium14
text: qsTr("New VPN order")
onClicked: control.newVPNOrder()
}
}
}
import QtQuick 2.7
import QtQuick.Controls 2.2
Button {
id: control
property color textColor
property color textColorHover
property color backgroundColor
property color backgroundColorHover
property real backgroudRadius: 0
property int borderWidth: 0
property color borderColor
contentItem: Text {
font: control.font
elide: Text.ElideRight
color: control.hovered ? control.textColorHover : control.textColor
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: control.text
}
background: Rectangle {
border { width: control.borderWidth; color: control.borderColor }
radius: control.backgroudRadius
color: control.hovered ? control.backgroundColorHover : control.backgroundColor
}
}
import QtQuick 2.7
import QtQuick.Controls 2.2
import ".."
Item {
id: tab
Item {
id: test
}
// TODO как узнать?
property bool ordersExists: false
function newVPNOrder()
{
rightPanel.caption = qsTr("Create VPN order");
rightPanel.stackView.clear();
rightPanel.stackView.push(createVPNOrderPanel);
rightPanel.visible = true;
}
state: {
if (ordersExists) {
return "showOrders";
} else if (rightPanel.visible) {
return "creatingFirstOrder";
} else {
return "noOrders";
}
}
Column {
anchors.fill: parent
DapVPNServiceTopPanel {
id: topPanel
onNewVPNOrder: tab.newVPNOrder()
}
Item {
height: parent.height - topPanel.height
width: parent.width
Item {
id: mainPanel
anchors.margins: 24 * pt
anchors.top: parent.top
anchors.left: parent.left
anchors.right: rightPanel.left
anchors.bottom: parent.bottom
DapNoOrdersPanel {
id: createYourFirstVPNOrderPanel
anchors.fill: parent
visible: false
onNewVPNOrder: tab.newVPNOrder()
}
Text {
id: textCreatingVPNOrder
anchors.centerIn: parent
font: quicksandFonts.medium26
elide: Text.ElideRight
color: "#070023"
text: qsTr("Creating VPN order in process…")
visible: false
}
}
DapRightPanel_New {
id: rightPanel
visible: false
}
}
}
Component {
id: createVPNOrderPanel
DapCreateVPNOrderPanel {
}
}
states: [
State {
name: "noOrders"
PropertyChanges {
target: createYourFirstVPNOrderPanel
visible: true
}
PropertyChanges {
target: topPanel
btnNewVPNOrderVisible: false
}
},
State {
name: "creatingFirstOrder"
PropertyChanges {
target: textCreatingVPNOrder
visible: true
}
},
State {
name: "showOrders"
}
]
}
import QtQuick 2.7
import "qrc:/widgets"
DapTopPanel {
id: control
property bool btnNewVPNOrderVisible: true
signal newVPNOrder
DapTextButton {
visible: control.btnNewVPNOrderVisible
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 24 * pt
width: 163 * pt
height: 36 * pt
textColor: "#FFFFFF"
textColorHover: "#FFFFFF"
backgroundColor: "#00000000"
backgroundColorHover: "#D51F5D"
backgroudRadius: 4 * pt
borderWidth: hovered ? 0 : pt
borderColor: "#FFFFFF"
font: quicksandFonts.medium14
text: qsTr("New VPN order")
onClicked: control.newVPNOrder()
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment