mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:53:44 +08:00
feat: Added web notification of successful subscription import
This commit is contained in:
parent
772e01ad40
commit
0c6d417d8c
@ -279,6 +279,7 @@ pub async fn resolve_scheme(param: String) -> Result<()> {
|
|||||||
.body("Import profile success")
|
.body("Import profile success")
|
||||||
.show()
|
.show()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
handle::Handle::notice_message("import_sub_url::ok", "ok");
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
app_handle
|
app_handle
|
||||||
@ -288,6 +289,7 @@ pub async fn resolve_scheme(param: String) -> Result<()> {
|
|||||||
.body(format!("Import profile failed: {e}"))
|
.body(format!("Import profile failed: {e}"))
|
||||||
.show()
|
.show()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
handle::Handle::notice_message("import_sub_url::error", e.clone());
|
||||||
bail!("Import profile failed: {e}");
|
bail!("Import profile failed: {e}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -367,5 +367,6 @@
|
|||||||
"Clash Core Restarted": "Clash Core Restarted",
|
"Clash Core Restarted": "Clash Core Restarted",
|
||||||
"Switched to _clash Core": "Switched to {{core}} Core",
|
"Switched to _clash Core": "Switched to {{core}} Core",
|
||||||
"GeoData Updated": "GeoData Updated",
|
"GeoData Updated": "GeoData Updated",
|
||||||
"Currently on the Latest Version": "Currently on the Latest Version"
|
"Currently on the Latest Version": "Currently on the Latest Version",
|
||||||
|
"Import Subscription Successful": "Import subscription successful"
|
||||||
}
|
}
|
||||||
|
@ -365,5 +365,6 @@
|
|||||||
"Clash Core Restarted": "هسته Clash مجدداً راهاندازی شد",
|
"Clash Core Restarted": "هسته Clash مجدداً راهاندازی شد",
|
||||||
"Switched to _clash Core": "تغییر به هسته {{core}}",
|
"Switched to _clash Core": "تغییر به هسته {{core}}",
|
||||||
"GeoData Updated": "GeoData بهروزرسانی شد",
|
"GeoData Updated": "GeoData بهروزرسانی شد",
|
||||||
"Currently on the Latest Version": "در حال حاضر در آخرین نسخه"
|
"Currently on the Latest Version": "در حال حاضر در آخرین نسخه",
|
||||||
|
"Import Subscription Successfully": "عضویت با موفقیت وارد شد"
|
||||||
}
|
}
|
||||||
|
@ -365,5 +365,6 @@
|
|||||||
"Clash Core Restarted": "Clash ядра перезапущено",
|
"Clash Core Restarted": "Clash ядра перезапущено",
|
||||||
"Switched to _clash Core": "Переключено на ядра {{core}}",
|
"Switched to _clash Core": "Переключено на ядра {{core}}",
|
||||||
"GeoData Updated": "GeoData Обновлена",
|
"GeoData Updated": "GeoData Обновлена",
|
||||||
"Currently on the Latest Version": "В настоящее время используется последняя версия"
|
"Currently on the Latest Version": "В настоящее время используется последняя версия",
|
||||||
|
"Import subscription successful": "Импорт подписки успешно"
|
||||||
}
|
}
|
||||||
|
@ -367,5 +367,6 @@
|
|||||||
"Clash Core Restarted": "已重启 Clash 内核",
|
"Clash Core Restarted": "已重启 Clash 内核",
|
||||||
"Switched to _clash Core": "已切换至 {{core}} 内核",
|
"Switched to _clash Core": "已切换至 {{core}} 内核",
|
||||||
"GeoData Updated": "已更新 GeoData",
|
"GeoData Updated": "已更新 GeoData",
|
||||||
"Currently on the Latest Version": "当前已是最新版本"
|
"Currently on the Latest Version": "当前已是最新版本",
|
||||||
|
"Import Subscription Successful": "导入订阅成功"
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,12 @@ const Layout = () => {
|
|||||||
listen("verge://notice-message", ({ payload }) => {
|
listen("verge://notice-message", ({ payload }) => {
|
||||||
const [status, msg] = payload as [string, string];
|
const [status, msg] = payload as [string, string];
|
||||||
switch (status) {
|
switch (status) {
|
||||||
|
case "import_sub_url::ok":
|
||||||
|
Notice.success(t("Import Subscription Successful"));
|
||||||
|
break;
|
||||||
|
case "import_sub_url::error":
|
||||||
|
Notice.error(msg);
|
||||||
|
break;
|
||||||
case "set_config::ok":
|
case "set_config::ok":
|
||||||
Notice.success(t("Clash Config Updated"));
|
Notice.success(t("Clash Config Updated"));
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user