mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
nm: revise enterprise flow
This commit is contained in:
@@ -12,19 +12,15 @@ DankModal {
|
|||||||
property string wifiUsernameInput: ""
|
property string wifiUsernameInput: ""
|
||||||
property bool requiresEnterprise: false
|
property bool requiresEnterprise: false
|
||||||
|
|
||||||
property string wifiRealmInput: ""
|
|
||||||
property bool wifiUseAtRealm: true
|
|
||||||
property string wifiAnonymousIdentityInput: ""
|
property string wifiAnonymousIdentityInput: ""
|
||||||
property string wifiDomainSuffixMatchInput: ""
|
property string wifiDomainInput: ""
|
||||||
|
|
||||||
function show(ssid) {
|
function show(ssid) {
|
||||||
wifiPasswordSSID = ssid
|
wifiPasswordSSID = ssid
|
||||||
wifiPasswordInput = ""
|
wifiPasswordInput = ""
|
||||||
wifiUsernameInput = ""
|
wifiUsernameInput = ""
|
||||||
wifiRealmInput = ""
|
|
||||||
wifiUseAtRealm = true
|
|
||||||
wifiAnonymousIdentityInput = ""
|
wifiAnonymousIdentityInput = ""
|
||||||
wifiDomainSuffixMatchInput = ""
|
wifiDomainInput = ""
|
||||||
|
|
||||||
const network = NetworkService.wifiNetworks.find(n => n.ssid === ssid)
|
const network = NetworkService.wifiNetworks.find(n => n.ssid === ssid)
|
||||||
requiresEnterprise = network?.enterprise || false
|
requiresEnterprise = network?.enterprise || false
|
||||||
@@ -43,15 +39,13 @@ DankModal {
|
|||||||
|
|
||||||
shouldBeVisible: false
|
shouldBeVisible: false
|
||||||
width: 420
|
width: 420
|
||||||
height: requiresEnterprise ? 520 : 230
|
height: requiresEnterprise ? 430 : 230
|
||||||
onShouldBeVisibleChanged: () => {
|
onShouldBeVisibleChanged: () => {
|
||||||
if (!shouldBeVisible) {
|
if (!shouldBeVisible) {
|
||||||
wifiPasswordInput = ""
|
wifiPasswordInput = ""
|
||||||
wifiUsernameInput = ""
|
wifiUsernameInput = ""
|
||||||
wifiRealmInput = ""
|
|
||||||
wifiUseAtRealm = true
|
|
||||||
wifiAnonymousIdentityInput = ""
|
wifiAnonymousIdentityInput = ""
|
||||||
wifiDomainSuffixMatchInput = ""
|
wifiDomainInput = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onOpened: {
|
onOpened: {
|
||||||
@@ -69,10 +63,8 @@ DankModal {
|
|||||||
close()
|
close()
|
||||||
wifiPasswordInput = ""
|
wifiPasswordInput = ""
|
||||||
wifiUsernameInput = ""
|
wifiUsernameInput = ""
|
||||||
wifiRealmInput = ""
|
|
||||||
wifiUseAtRealm = true
|
|
||||||
wifiAnonymousIdentityInput = ""
|
wifiAnonymousIdentityInput = ""
|
||||||
wifiDomainSuffixMatchInput = ""
|
wifiDomainInput = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
@@ -101,10 +93,8 @@ DankModal {
|
|||||||
close()
|
close()
|
||||||
wifiPasswordInput = ""
|
wifiPasswordInput = ""
|
||||||
wifiUsernameInput = ""
|
wifiUsernameInput = ""
|
||||||
wifiRealmInput = ""
|
|
||||||
wifiUseAtRealm = true
|
|
||||||
wifiAnonymousIdentityInput = ""
|
wifiAnonymousIdentityInput = ""
|
||||||
wifiDomainSuffixMatchInput = ""
|
wifiDomainInput = ""
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,6 +134,8 @@ DankModal {
|
|||||||
close()
|
close()
|
||||||
wifiPasswordInput = ""
|
wifiPasswordInput = ""
|
||||||
wifiUsernameInput = ""
|
wifiUsernameInput = ""
|
||||||
|
wifiAnonymousIdentityInput = ""
|
||||||
|
wifiDomainInput = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -221,18 +213,14 @@ DankModal {
|
|||||||
wifiPasswordSSID,
|
wifiPasswordSSID,
|
||||||
passwordInput.text,
|
passwordInput.text,
|
||||||
username,
|
username,
|
||||||
wifiRealmInput,
|
|
||||||
wifiUseAtRealm,
|
|
||||||
wifiAnonymousIdentityInput,
|
wifiAnonymousIdentityInput,
|
||||||
wifiDomainSuffixMatchInput
|
wifiDomainInput
|
||||||
)
|
)
|
||||||
close()
|
close()
|
||||||
wifiPasswordInput = ""
|
wifiPasswordInput = ""
|
||||||
wifiUsernameInput = ""
|
wifiUsernameInput = ""
|
||||||
wifiRealmInput = ""
|
|
||||||
wifiUseAtRealm = true
|
|
||||||
wifiAnonymousIdentityInput = ""
|
wifiAnonymousIdentityInput = ""
|
||||||
wifiDomainSuffixMatchInput = ""
|
wifiDomainInput = ""
|
||||||
passwordInput.text = ""
|
passwordInput.text = ""
|
||||||
if (requiresEnterprise) usernameInput.text = ""
|
if (requiresEnterprise) usernameInput.text = ""
|
||||||
}
|
}
|
||||||
@@ -268,100 +256,6 @@ DankModal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
visible: requiresEnterprise
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Theme.surfaceHover
|
|
||||||
border.color: realmInput.activeFocus ? Theme.primary : Theme.outlineStrong
|
|
||||||
border.width: realmInput.activeFocus ? 2 : 1
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: () => {
|
|
||||||
realmInput.forceActiveFocus()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
id: realmInput
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
textColor: Theme.surfaceText
|
|
||||||
text: wifiRealmInput
|
|
||||||
placeholderText: I18n.tr("Realm / Domain (optional)")
|
|
||||||
backgroundColor: "transparent"
|
|
||||||
enabled: root.shouldBeVisible
|
|
||||||
onTextEdited: () => {
|
|
||||||
wifiRealmInput = text
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
visible: requiresEnterprise
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
width: parent.width
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: atRealmBtn
|
|
||||||
|
|
||||||
height: 36
|
|
||||||
width: (parent.width - Theme.spacingM) / 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: wifiUseAtRealm ? Theme.primary : Theme.surfaceHover
|
|
||||||
border.color: wifiUseAtRealm ? Theme.primary : Theme.outlineStrong
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
wifiUseAtRealm = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "username@realm"
|
|
||||||
color: wifiUseAtRealm ? Theme.background : Theme.surfaceText
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: domainSlashBtn
|
|
||||||
|
|
||||||
height: 36
|
|
||||||
width: (parent.width - Theme.spacingM) / 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: !wifiUseAtRealm ? Theme.primary : Theme.surfaceHover
|
|
||||||
border.color: !wifiUseAtRealm ? Theme.primary : Theme.outlineStrong
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
wifiUseAtRealm = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "DOMAIN\\username"
|
|
||||||
color: !wifiUseAtRealm ? Theme.background : Theme.surfaceText
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
visible: requiresEnterprise
|
visible: requiresEnterprise
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -416,12 +310,12 @@ DankModal {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
textColor: Theme.surfaceText
|
textColor: Theme.surfaceText
|
||||||
text: wifiDomainSuffixMatchInput
|
text: wifiDomainInput
|
||||||
placeholderText: I18n.tr("Server Domain for certificate (optional)")
|
placeholderText: I18n.tr("Domain (optional)")
|
||||||
backgroundColor: "transparent"
|
backgroundColor: "transparent"
|
||||||
enabled: root.shouldBeVisible
|
enabled: root.shouldBeVisible
|
||||||
onTextEdited: () => {
|
onTextEdited: () => {
|
||||||
wifiDomainSuffixMatchInput = text
|
wifiDomainInput = text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -504,10 +398,8 @@ DankModal {
|
|||||||
close()
|
close()
|
||||||
wifiPasswordInput = ""
|
wifiPasswordInput = ""
|
||||||
wifiUsernameInput = ""
|
wifiUsernameInput = ""
|
||||||
wifiRealmInput = ""
|
|
||||||
wifiUseAtRealm = true
|
|
||||||
wifiAnonymousIdentityInput = ""
|
wifiAnonymousIdentityInput = ""
|
||||||
wifiDomainSuffixMatchInput = ""
|
wifiDomainInput = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -543,18 +435,14 @@ DankModal {
|
|||||||
wifiPasswordSSID,
|
wifiPasswordSSID,
|
||||||
passwordInput.text,
|
passwordInput.text,
|
||||||
username,
|
username,
|
||||||
wifiRealmInput,
|
|
||||||
wifiUseAtRealm,
|
|
||||||
wifiAnonymousIdentityInput,
|
wifiAnonymousIdentityInput,
|
||||||
wifiDomainSuffixMatchInput
|
wifiDomainInput
|
||||||
)
|
)
|
||||||
close()
|
close()
|
||||||
wifiPasswordInput = ""
|
wifiPasswordInput = ""
|
||||||
wifiUsernameInput = ""
|
wifiUsernameInput = ""
|
||||||
wifiRealmInput = ""
|
|
||||||
wifiUseAtRealm = true
|
|
||||||
wifiAnonymousIdentityInput = ""
|
wifiAnonymousIdentityInput = ""
|
||||||
wifiDomainSuffixMatchInput = ""
|
wifiDomainInput = ""
|
||||||
passwordInput.text = ""
|
passwordInput.text = ""
|
||||||
if (requiresEnterprise) usernameInput.text = ""
|
if (requiresEnterprise) usernameInput.text = ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -244,10 +244,9 @@ Singleton {
|
|||||||
scanWifi()
|
scanWifi()
|
||||||
}
|
}
|
||||||
|
|
||||||
function connectToWifi(ssid, password = "", username = "", realmOrDomain = "", useAtRealm = true, anonymousIdentity = "", domainSuffixMatch = "") {
|
function connectToWifi(ssid, password = "", username = "", anonymousIdentity = "", domainSuffixMatch = "") {
|
||||||
if (!networkAvailable || isConnecting) return
|
if (!networkAvailable || isConnecting) return
|
||||||
|
|
||||||
isConnecting = true
|
|
||||||
connectingSSID = ssid
|
connectingSSID = ssid
|
||||||
connectionError = ""
|
connectionError = ""
|
||||||
connectionStatus = "connecting"
|
connectionStatus = "connecting"
|
||||||
@@ -255,8 +254,6 @@ Singleton {
|
|||||||
const params = { ssid: ssid }
|
const params = { ssid: ssid }
|
||||||
if (password) params.password = password
|
if (password) params.password = password
|
||||||
if (username) params.username = username
|
if (username) params.username = username
|
||||||
if (realmOrDomain) params.realmOrDomain = realmOrDomain
|
|
||||||
if (username) params.useAtRealm = useAtRealm
|
|
||||||
if (anonymousIdentity) params.anonymousIdentity = anonymousIdentity
|
if (anonymousIdentity) params.anonymousIdentity = anonymousIdentity
|
||||||
if (domainSuffixMatch) params.domainSuffixMatch = domainSuffixMatch
|
if (domainSuffixMatch) params.domainSuffixMatch = domainSuffixMatch
|
||||||
|
|
||||||
@@ -387,8 +384,8 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function connectToWifiAndSetPreference(ssid, password, username = "", realmOrDomain = "", useAtRealm = true, anonymousIdentity = "", domainSuffixMatch = "") {
|
function connectToWifiAndSetPreference(ssid, password, username = "", anonymousIdentity = "", domainSuffixMatch = "") {
|
||||||
connectToWifi(ssid, password, username, realmOrDomain, useAtRealm, anonymousIdentity, domainSuffixMatch)
|
connectToWifi(ssid, password, username, anonymousIdentity, domainSuffixMatch)
|
||||||
setNetworkPreference("wifi")
|
setNetworkPreference("wifi")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -149,9 +149,9 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function connectToWifi(ssid, password = "", username = "", realmOrDomain = "", useAtRealm = true, anonymousIdentity = "", domainSuffixMatch = "") {
|
function connectToWifi(ssid, password = "", username = "", anonymousIdentity = "", domainSuffixMatch = "") {
|
||||||
if (activeService && activeService.connectToWifi) {
|
if (activeService && activeService.connectToWifi) {
|
||||||
activeService.connectToWifi(ssid, password, username, realmOrDomain, useAtRealm, anonymousIdentity, domainSuffixMatch)
|
activeService.connectToWifi(ssid, password, username, anonymousIdentity, domainSuffixMatch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,9 +191,9 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function connectToWifiAndSetPreference(ssid, password, username = "", realmOrDomain = "", useAtRealm = true, anonymousIdentity = "", domainSuffixMatch = "") {
|
function connectToWifiAndSetPreference(ssid, password, username = "", anonymousIdentity = "", domainSuffixMatch = "") {
|
||||||
if (activeService && activeService.connectToWifiAndSetPreference) {
|
if (activeService && activeService.connectToWifiAndSetPreference) {
|
||||||
activeService.connectToWifiAndSetPreference(ssid, password, username, realmOrDomain, useAtRealm, anonymousIdentity, domainSuffixMatch)
|
activeService.connectToWifiAndSetPreference(ssid, password, username, anonymousIdentity, domainSuffixMatch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
14
assets/systemd/dms.service
Normal file
14
assets/systemd/dms.service
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Dank Material Shell (DMS)
|
||||||
|
PartOf=graphical-session.target
|
||||||
|
After=graphical-session-pre.target
|
||||||
|
Wants=graphical-session-pre.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/bin/dms run
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=1
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=graphical-session.target
|
||||||
Reference in New Issue
Block a user