mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-20 02:00:55 +07:00
checking the parallelism of lines
This commit is contained in:
@@ -883,8 +883,6 @@ PageType {
|
||||
}
|
||||
|
||||
function mtProxyRemoveAdditionalSecret(idx) {
|
||||
// Symmetric with "Add additional secret": only mutate the model here; the change
|
||||
// is pushed to the server on Save (no immediate server update on add/remove).
|
||||
MtProxyConfigModel.removeAdditionalSecret(idx)
|
||||
}
|
||||
|
||||
@@ -1398,7 +1396,11 @@ PageType {
|
||||
sourceSize.width: 24
|
||||
sourceSize.height: 24
|
||||
rotation: addSecretDelegate.linksExpanded ? 180 : 0
|
||||
Behavior on rotation { NumberAnimation { duration: 150 } }
|
||||
Behavior on rotation {
|
||||
NumberAnimation {
|
||||
duration: 150
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1617,8 +1619,12 @@ PageType {
|
||||
}
|
||||
var n = parseInt(cur, 10)
|
||||
var maxW = MtProxyConfigModel.maxWorkers()
|
||||
if (isNaN(n) || n < 0) { n = 0 }
|
||||
if (n > maxW) { n = maxW }
|
||||
if (isNaN(n) || n < 0) {
|
||||
n = 0
|
||||
}
|
||||
if (n > maxW) {
|
||||
n = maxW
|
||||
}
|
||||
var clamped = String(n)
|
||||
if (clamped !== cur) {
|
||||
textField.text = clamped
|
||||
@@ -1630,8 +1636,12 @@ PageType {
|
||||
if (v !== "") {
|
||||
var m = parseInt(v, 10)
|
||||
var maxW2 = MtProxyConfigModel.maxWorkers()
|
||||
if (isNaN(m) || m < 0) { m = 0 }
|
||||
if (m > maxW2) { m = maxW2 }
|
||||
if (isNaN(m) || m < 0) {
|
||||
m = 0
|
||||
}
|
||||
if (m > maxW2) {
|
||||
m = maxW2
|
||||
}
|
||||
v = String(m)
|
||||
textField.text = v
|
||||
}
|
||||
@@ -1988,6 +1998,5 @@ PageType {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,35 +43,6 @@ PageType {
|
||||
property string savedTlsDomain: ""
|
||||
property string savedPublicHost: ""
|
||||
|
||||
readonly property var natIpv4InputFormat: /^(\d{1,3}\.){0,3}\d{0,3}$/
|
||||
|
||||
function natIpv4FieldShowInvalidError(text) {
|
||||
var t = text ? String(text).replace(/^\s+|\s+$/g, '') : ""
|
||||
if (t === "")
|
||||
return false
|
||||
if (TelemtConfigModel.isValidOptionalIpv4(t))
|
||||
return false
|
||||
var parts = t.split('.')
|
||||
var j
|
||||
for (j = 0; j < parts.length; j++) {
|
||||
if (parts[j].length > 3)
|
||||
return true
|
||||
}
|
||||
if (parts.length > 4)
|
||||
return true
|
||||
if (t.indexOf('.') < 0 && t.length > 3)
|
||||
return true
|
||||
if (t.endsWith('.'))
|
||||
return false
|
||||
if (parts.length < 4)
|
||||
return false
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
if (parts[i] === "")
|
||||
return true
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
onSavedTransportModeChanged: {
|
||||
if (savedTransportMode === "faketls") {
|
||||
root.syncedSecretTabIndex = 1
|
||||
@@ -182,13 +153,6 @@ PageType {
|
||||
root.telemtScheduleContainerStatusRefresh()
|
||||
}
|
||||
|
||||
function telemtScheduleUpdate(closePage) {
|
||||
var cp = closePage === undefined ? false : closePage
|
||||
Qt.callLater(function () {
|
||||
InstallController.updateServerConfig(ServersUiController.processedServerId, ServersUiController.processedContainerIndex, ProtocolEnum.Telemt, cp)
|
||||
})
|
||||
}
|
||||
|
||||
property var telemtPersistedAdditionalHex: []
|
||||
|
||||
function telemtRefreshPersistedAdditionalSecrets() {
|
||||
@@ -210,6 +174,42 @@ PageType {
|
||||
return false
|
||||
}
|
||||
|
||||
readonly property var natIpv4InputFormat: /^(\d{1,3}\.){0,3}\d{0,3}$/
|
||||
|
||||
function telemtScheduleUpdate(closePage) {
|
||||
var cp = closePage === undefined ? false : closePage
|
||||
Qt.callLater(function () {
|
||||
InstallController.updateServerConfig(ServersUiController.processedServerId, ServersUiController.processedContainerIndex, ProtocolEnum.Telemt, cp)
|
||||
})
|
||||
}
|
||||
|
||||
function natIpv4FieldShowInvalidError(text) {
|
||||
var t = text ? String(text).replace(/^\s+|\s+$/g, '') : ""
|
||||
if (t === "")
|
||||
return false
|
||||
if (TelemtConfigModel.isValidOptionalIpv4(t))
|
||||
return false
|
||||
var parts = t.split('.')
|
||||
var j
|
||||
for (j = 0; j < parts.length; j++) {
|
||||
if (parts[j].length > 3)
|
||||
return true
|
||||
}
|
||||
if (parts.length > 4)
|
||||
return true
|
||||
if (t.indexOf('.') < 0 && t.length > 3)
|
||||
return true
|
||||
if (t.endsWith('.'))
|
||||
return false
|
||||
if (parts.length < 4)
|
||||
return false
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
if (parts[i] === "")
|
||||
return true
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
function statusText() {
|
||||
if (isCheckingStatus) {
|
||||
return qsTr("Checking...")
|
||||
@@ -1396,7 +1396,11 @@ PageType {
|
||||
sourceSize.width: 24
|
||||
sourceSize.height: 24
|
||||
rotation: addSecretDelegate.linksExpanded ? 180 : 0
|
||||
Behavior on rotation { NumberAnimation { duration: 150 } }
|
||||
Behavior on rotation {
|
||||
NumberAnimation {
|
||||
duration: 150
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1615,8 +1619,12 @@ PageType {
|
||||
}
|
||||
var n = parseInt(cur, 10)
|
||||
var maxW = TelemtConfigModel.maxWorkers()
|
||||
if (isNaN(n) || n < 0) { n = 0 }
|
||||
if (n > maxW) { n = maxW }
|
||||
if (isNaN(n) || n < 0) {
|
||||
n = 0
|
||||
}
|
||||
if (n > maxW) {
|
||||
n = maxW
|
||||
}
|
||||
var clamped = String(n)
|
||||
if (clamped !== cur) {
|
||||
textField.text = clamped
|
||||
@@ -1628,8 +1636,12 @@ PageType {
|
||||
if (v !== "") {
|
||||
var m = parseInt(v, 10)
|
||||
var maxW2 = TelemtConfigModel.maxWorkers()
|
||||
if (isNaN(m) || m < 0) { m = 0 }
|
||||
if (m > maxW2) { m = maxW2 }
|
||||
if (isNaN(m) || m < 0) {
|
||||
m = 0
|
||||
}
|
||||
if (m > maxW2) {
|
||||
m = maxW2
|
||||
}
|
||||
v = String(m)
|
||||
textField.text = v
|
||||
}
|
||||
@@ -1986,6 +1998,5 @@ PageType {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user