feat(vpn): support opening wireguard configs
This commit is contained in:
parent
d90074045f
commit
cd9a3d81e6
1 changed files with 8 additions and 1 deletions
|
|
@ -769,11 +769,18 @@ fn add_network() -> Command<crate::app::Message> {
|
||||||
.mimetype("application/x-openvpn-profile")
|
.mimetype("application/x-openvpn-profile")
|
||||||
.glob("*.ovpn"),
|
.glob("*.ovpn"),
|
||||||
)
|
)
|
||||||
|
.filter(FileFilter::new("WireGuard").glob("*.conf*"))
|
||||||
.open_file()
|
.open_file()
|
||||||
.then(|result| async move {
|
.then(|result| async move {
|
||||||
match result {
|
match result {
|
||||||
Ok(response) => {
|
Ok(response) => {
|
||||||
_ = super::nm_add_vpn_file("openvpn", response.url().path()).await;
|
let vpn_type = if response.url().as_str().ends_with(".conf") {
|
||||||
|
"wireguard"
|
||||||
|
} else {
|
||||||
|
"openvpn"
|
||||||
|
};
|
||||||
|
|
||||||
|
_ = super::nm_add_vpn_file(vpn_type, response.url().path()).await;
|
||||||
Message::Refresh
|
Message::Refresh
|
||||||
}
|
}
|
||||||
Err(why) => {
|
Err(why) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue