2026-03-24 17:45:02 +03:00
|
|
|
pragma ComponentBehavior: Bound
|
|
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import PageEnum 1.0
|
|
|
|
|
import Style 1.0
|
|
|
|
|
|
|
|
|
|
import "../Controls2"
|
|
|
|
|
import "../Controls2/TextTypes"
|
|
|
|
|
|
|
|
|
|
DrawerType2 {
|
|
|
|
|
id: root
|
|
|
|
|
|
2026-04-17 15:01:24 +08:00
|
|
|
property bool isRenewalAvailable: false
|
2026-04-08 11:21:12 +07:00
|
|
|
|
|
|
|
|
onOpened: {
|
2026-05-28 10:57:08 +08:00
|
|
|
isRenewalAvailable = ServersUiController.isServerRenewalAvailable(ServersUiController.defaultServerId) && !ApiAccountInfoModel.data("isInAppPurchase")
|
2026-04-08 11:21:12 +07:00
|
|
|
}
|
|
|
|
|
|
2026-03-24 17:45:02 +03:00
|
|
|
expandedStateContent: ColumnLayout {
|
|
|
|
|
id: content
|
|
|
|
|
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
|
|
onImplicitHeightChanged: {
|
2026-05-01 20:50:24 +08:00
|
|
|
root.expandedHeight = content.implicitHeight + 32 + PageController.safeAreaBottomMargin
|
2026-03-24 17:45:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: 24
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
implicitHeight: titleText.implicitHeight
|
|
|
|
|
|
|
|
|
|
Header2TextType {
|
|
|
|
|
id: titleText
|
|
|
|
|
anchors.left: parent.left
|
2026-03-25 07:34:42 +03:00
|
|
|
anchors.right: parent.right
|
2026-03-24 17:45:02 +03:00
|
|
|
|
2026-05-28 10:57:08 +08:00
|
|
|
text: ServersUiController.serverName(ServersUiController.defaultServerId) + qsTr(" subscription has expired")
|
2026-03-24 17:45:02 +03:00
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ParagraphTextType {
|
2026-04-17 15:01:24 +08:00
|
|
|
visible: root.isRenewalAvailable
|
2026-04-08 11:21:12 +07:00
|
|
|
|
2026-03-24 17:45:02 +03:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: 8
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
|
2026-04-10 21:24:00 +07:00
|
|
|
text: qsTr("Renew to continue using VPN")
|
2026-03-24 17:45:02 +03:00
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BasicButtonType {
|
2026-04-17 15:01:24 +08:00
|
|
|
visible: root.isRenewalAvailable
|
2026-04-08 11:21:12 +07:00
|
|
|
|
2026-03-24 17:45:02 +03:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: 16
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
|
|
|
|
|
text: qsTr("Renew")
|
|
|
|
|
|
|
|
|
|
defaultColor: AmneziaStyle.color.paleGray
|
|
|
|
|
hoveredColor: AmneziaStyle.color.lightGray
|
|
|
|
|
pressedColor: AmneziaStyle.color.mutedGray
|
|
|
|
|
textColor: AmneziaStyle.color.midnightBlack
|
|
|
|
|
|
|
|
|
|
clickedFunc: function() {
|
2026-05-28 10:57:08 +08:00
|
|
|
SubscriptionUiController.getRenewalLink(ServersUiController.defaultServerId)
|
2026-03-24 17:45:02 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BasicButtonType {
|
2026-03-25 07:34:42 +03:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
Layout.topMargin: 8
|
2026-03-24 17:45:02 +03:00
|
|
|
Layout.bottomMargin: 8
|
2026-03-25 07:34:42 +03:00
|
|
|
|
|
|
|
|
implicitHeight: 25
|
2026-03-24 17:45:02 +03:00
|
|
|
|
|
|
|
|
defaultColor: AmneziaStyle.color.transparent
|
|
|
|
|
hoveredColor: AmneziaStyle.color.translucentWhite
|
|
|
|
|
pressedColor: AmneziaStyle.color.sheerWhite
|
|
|
|
|
textColor: AmneziaStyle.color.goldenApricot
|
|
|
|
|
|
|
|
|
|
text: qsTr("Support")
|
|
|
|
|
|
|
|
|
|
clickedFunc: function() {
|
2026-04-17 15:01:24 +08:00
|
|
|
PageController.showBusyIndicator(true)
|
2026-05-28 10:57:08 +08:00
|
|
|
let result = SubscriptionUiController.getAccountInfo(ServersUiController.defaultServerId, false)
|
2026-04-17 15:01:24 +08:00
|
|
|
PageController.showBusyIndicator(false)
|
|
|
|
|
if (result) {
|
|
|
|
|
root.closeTriggered()
|
|
|
|
|
PageController.goToPage(PageEnum.PageSettingsApiSupport)
|
|
|
|
|
}
|
2026-03-24 17:45:02 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|