1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-24 12:05:21 -04:00

fix(network): fix excessive network prompting on failures, add VPN

connection statuses
This commit is contained in:
bbedward
2026-06-23 13:58:58 -04:00
parent 0e7901ebbe
commit 28f40afccf
15 changed files with 471 additions and 31 deletions
+23
View File
@@ -25,6 +25,7 @@ Singleton {
signal importComplete(string uuid, string name)
signal configLoaded(var config)
signal configUpdated
signal credentialsSet(string uuid)
signal vpnDeleted(string uuid)
Component.onCompleted: {
@@ -149,6 +150,28 @@ Singleton {
});
}
function setCredentials(uuid, username, password, save = true) {
if (!available)
return;
const params = {
uuid: uuid,
save: save
};
if (username)
params.username = username;
if (password)
params.password = password;
DMSService.sendRequest("network.vpn.setCredentials", params, response => {
if (response.error) {
ToastService.showError(I18n.tr("Failed to save VPN credentials"), response.error);
return;
}
ToastService.showInfo(I18n.tr("VPN credentials saved"));
credentialsSet(uuid);
});
}
function deleteVpn(uuidOrName) {
if (!available)
return;