feat: Nyanpasu Misc

This commit is contained in:
keiko233 2023-11-12 00:09:32 +08:00
parent b4ead4076a
commit 7ce8bd8988
19 changed files with 41 additions and 40 deletions

View File

@ -3,8 +3,7 @@ name: Bug report
about: Create a report to help us improve about: Create a report to help us improve
title: "[BUG]" title: "[BUG]"
labels: bug labels: bug
assignees: '' assignees: ""
--- ---
**Describe the bug** **Describe the bug**
@ -12,6 +11,7 @@ A clear and concise description of what the bug is.
**To Reproduce** **To Reproduce**
Steps to reproduce the behavior: Steps to reproduce the behavior:
1. Go to '...' 1. Go to '...'
2. Click on '....' 2. Click on '....'
3. Scroll down to '....' 3. Scroll down to '....'
@ -24,9 +24,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem. If applicable, add screenshots to help explain your problem.
**Information** **Information**
- OS: [e.g. macOS]
- Clash Verge Version: [e.g. 1.3.4] - OS: [e.g. macOS]
- Clash Core: [e.g. Clash or Clash Meta] - Clash Nyanpasu Version: [e.g. 1.3.4]
- Clash Core: [e.g. Clash or Clash Meta]
**Additional context** **Additional context**
Add any other context about the problem here. Add any other context about the problem here.

View File

@ -45,8 +45,8 @@ async function resolve() {
const join = (p) => path.join(bundlePath, p); const join = (p) => path.join(bundlePath, p);
const appPathList = [ const appPathList = [
join("macos/Clash Verge.aarch64.app.tar.gz"), join("macos/Clash Nyanpasu.aarch64.app.tar.gz"),
join("macos/Clash Verge.aarch64.app.tar.gz.sig"), join("macos/Clash Nyanpasu.aarch64.app.tar.gz.sig"),
]; ];
for (const appPath of appPathList) { for (const appPath of appPathList) {
@ -55,8 +55,8 @@ async function resolve() {
} }
} }
fs.copyFileSync(join("macos/Clash Verge.app.tar.gz"), appPathList[0]); fs.copyFileSync(join("macos/Clash Nyanpasu.app.tar.gz"), appPathList[0]);
fs.copyFileSync(join("macos/Clash Verge.app.tar.gz.sig"), appPathList[1]); fs.copyFileSync(join("macos/Clash Nyanpasu.app.tar.gz.sig"), appPathList[1]);
const options = { owner: context.repo.owner, repo: context.repo.repo }; const options = { owner: context.repo.owner, repo: context.repo.repo };
const github = getOctokit(process.env.GITHUB_TOKEN); const github = getOctokit(process.env.GITHUB_TOKEN);
@ -69,7 +69,7 @@ async function resolve() {
if (!release.id) throw new Error("failed to find the release"); if (!release.id) throw new Error("failed to find the release");
await uploadAssets(release.id, [ await uploadAssets(release.id, [
join(`dmg/Clash Verge_${version}_aarch64.dmg`), join(`dmg/Clash Nyanpasu_${version}_aarch64.dmg`),
...appPathList, ...appPathList,
]); ]);
} }

View File

@ -17,7 +17,7 @@ async function resolvePortable() {
const zip = new AdmZip(); const zip = new AdmZip();
zip.addLocalFile(path.join(releaseDir, "Clash Verge.exe")); zip.addLocalFile(path.join(releaseDir, "Clash Nyanpasu.exe"));
zip.addLocalFile(path.join(releaseDir, "clash.exe")); zip.addLocalFile(path.join(releaseDir, "clash.exe"));
zip.addLocalFile(path.join(releaseDir, "clash-meta.exe")); zip.addLocalFile(path.join(releaseDir, "clash-meta.exe"));
zip.addLocalFolder(path.join(releaseDir, "resources"), "resources"); zip.addLocalFolder(path.join(releaseDir, "resources"), "resources");
@ -26,7 +26,7 @@ async function resolvePortable() {
const packageJson = require("../package.json"); const packageJson = require("../package.json");
const { version } = packageJson; const { version } = packageJson;
const zipFile = `Clash.Verge_${version}_x64_portable.zip`; const zipFile = `Clash.Nyanpasu_${version}_x64_portable.zip`;
zip.writeZip(zipFile); zip.writeZip(zipFile);
console.log("[INFO]: create portable zip successfully"); console.log("[INFO]: create portable zip successfully");

View File

@ -58,7 +58,7 @@ impl IClashTemp {
help::save_yaml( help::save_yaml(
&dirs::clash_path()?, &dirs::clash_path()?,
&self.0, &self.0,
Some("# Generated by Clash Verge"), Some("# Generated by Clash Nyanpasu"),
) )
} }

View File

@ -57,7 +57,7 @@ impl Config {
help::save_yaml( help::save_yaml(
&runtime_path, &runtime_path,
&Config::clash().latest().0, &Config::clash().latest().0,
Some("# Clash Verge Runtime"), Some("# Clash Nyanpasu Runtime"),
)?; )?;
} }
} }
@ -78,7 +78,7 @@ impl Config {
.as_ref() .as_ref()
.ok_or(anyhow!("failed to get runtime config"))?; .ok_or(anyhow!("failed to get runtime config"))?;
help::save_yaml(&path, &config, Some("# Generated by Clash Verge"))?; help::save_yaml(&path, &config, Some("# Generated by Clash Nyanpasu"))?;
Ok(path) Ok(path)
} }

View File

@ -69,7 +69,7 @@ impl IProfiles {
help::save_yaml( help::save_yaml(
&dirs::profiles_path()?, &dirs::profiles_path()?,
self, self,
Some("# Profiles Config for Clash Verge"), Some("# Profiles Config for Clash Nyanpasu"),
) )
} }

View File

@ -143,7 +143,7 @@ impl IVerge {
/// Save IVerge App Config /// Save IVerge App Config
pub fn save_file(&self) -> Result<()> { pub fn save_file(&self) -> Result<()> {
help::save_yaml(&dirs::verge_path()?, &self, Some("# Clash Verge Config")) help::save_yaml(&dirs::verge_path()?, &self, Some("# Clash Nyanpasu Config"))
} }
/// patch verge config /// patch verge config

View File

@ -13,7 +13,7 @@ pub fn grant_permission(core: String) -> anyhow::Result<()> {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
let output = { let output = {
// the path of clash /Applications/Clash Verge.app/Contents/MacOS/clash // the path of clash /Applications/Clash Nyanpasu.app/Contents/MacOS/clash
// https://apple.stackexchange.com/questions/82967/problem-with-empty-spaces-when-executing-shell-commands-in-applescript // https://apple.stackexchange.com/questions/82967/problem-with-empty-spaces-when-executing-shell-commands-in-applescript
// let path = escape(&path); // let path = escape(&path);
let path = path.replace(' ', "\\\\ "); let path = path.replace(' ', "\\\\ ");

View File

@ -158,7 +158,7 @@ impl Sysopt {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
let app_path = format!("\"{app_path}\""); let app_path = format!("\"{app_path}\"");
// use the /Applications/Clash Verge.app path // use the /Applications/Clash Nyanpasu.app path
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
let app_path = (|| -> Option<String> { let app_path = (|| -> Option<String> {
let path = std::path::PathBuf::from(&app_path); let path = std::path::PathBuf::from(&app_path);

View File

@ -30,7 +30,7 @@ pub struct JsonResponse {
pub data: Option<ResponseBody>, pub data: Option<ResponseBody>,
} }
/// Install the Clash Verge Service /// Install the Clash Nyanpasu Service
/// 该函数应该在协程或者线程中执行避免UAC弹窗阻塞主线程 /// 该函数应该在协程或者线程中执行避免UAC弹窗阻塞主线程
pub async fn install_service() -> Result<()> { pub async fn install_service() -> Result<()> {
let binary_path = dirs::service_path()?; let binary_path = dirs::service_path()?;
@ -60,7 +60,7 @@ pub async fn install_service() -> Result<()> {
Ok(()) Ok(())
} }
/// Uninstall the Clash Verge Service /// Uninstall the Clash Nyanpasu Service
/// 该函数应该在协程或者线程中执行避免UAC弹窗阻塞主线程 /// 该函数应该在协程或者线程中执行避免UAC弹窗阻塞主线程
pub async fn uninstall_service() -> Result<()> { pub async fn uninstall_service() -> Result<()> {
let binary_path = dirs::service_path()?; let binary_path = dirs::service_path()?;
@ -99,10 +99,10 @@ pub async fn check_service() -> Result<JsonResponse> {
.get(url) .get(url)
.send() .send()
.await .await
.context("failed to connect to the Clash Verge Service")? .context("failed to connect to the Clash Nyanpasu Service")?
.json::<JsonResponse>() .json::<JsonResponse>()
.await .await
.context("failed to parse the Clash Verge Service response")?; .context("failed to parse the Clash Nyanpasu Service response")?;
Ok(response) Ok(response)
} }
@ -148,7 +148,7 @@ pub(super) async fn run_core_by_service(config_file: &PathBuf) -> Result<()> {
.await? .await?
.json::<JsonResponse>() .json::<JsonResponse>()
.await .await
.context("failed to connect to the Clash Verge Service")?; .context("failed to connect to the Clash Nyanpasu Service")?;
if res.code != 0 { if res.code != 0 {
bail!(res.msg); bail!(res.msg);
@ -168,7 +168,7 @@ pub(super) async fn stop_core_by_service() -> Result<()> {
.await? .await?
.json::<JsonResponse>() .json::<JsonResponse>()
.await .await
.context("failed to connect to the Clash Verge Service")?; .context("failed to connect to the Clash Nyanpasu Service")?;
if res.code != 0 { if res.code != 0 {
bail!(res.msg); bail!(res.msg);

View File

@ -93,21 +93,21 @@ pub fn init_config() -> Result<()> {
crate::log_err!(dirs::clash_path().map(|path| { crate::log_err!(dirs::clash_path().map(|path| {
if !path.exists() { if !path.exists() {
help::save_yaml(&path, &IClashTemp::template().0, Some("# Clash Verge"))?; help::save_yaml(&path, &IClashTemp::template().0, Some("# Clash Nyanpasuasu"))?;
} }
<Result<()>>::Ok(()) <Result<()>>::Ok(())
})); }));
crate::log_err!(dirs::verge_path().map(|path| { crate::log_err!(dirs::verge_path().map(|path| {
if !path.exists() { if !path.exists() {
help::save_yaml(&path, &IVerge::template(), Some("# Clash Verge"))?; help::save_yaml(&path, &IVerge::template(), Some("# Clash Nyanpasu"))?;
} }
<Result<()>>::Ok(()) <Result<()>>::Ok(())
})); }));
crate::log_err!(dirs::profiles_path().map(|path| { crate::log_err!(dirs::profiles_path().map(|path| {
if !path.exists() { if !path.exists() {
help::save_yaml(&path, &IProfiles::template(), Some("# Clash Verge"))?; help::save_yaml(&path, &IProfiles::template(), Some("# Clash Nyanpasu"))?;
} }
<Result<()>>::Ok(()) <Result<()>>::Ok(())
})); }));

View File

@ -59,7 +59,7 @@ pub fn create_window(app_handle: &AppHandle) {
"main".to_string(), "main".to_string(),
tauri::WindowUrl::App("index.html".into()), tauri::WindowUrl::App("index.html".into()),
) )
.title("Clash Verge") .title("Clash Nyanpasu")
.fullscreen(false) .fullscreen(false)
.min_inner_size(600.0, 520.0); .min_inner_size(600.0, 520.0);

View File

@ -100,7 +100,7 @@ export const ClashFieldViewer = forwardRef<DialogRef>((props, ref) => {
<Divider sx={{ my: 1 }}> <Divider sx={{ my: 1 }}>
<Typography color="text.secondary" fontSize={14}> <Typography color="text.secondary" fontSize={14}>
Clash Verge Control Fields Clash Nyanpasu Control Fields
</Typography> </Typography>
</Divider> </Divider>

View File

@ -90,7 +90,7 @@ export const ServiceViewer = forwardRef<DialogRef, Props>((props, ref) => {
{(state === "unknown" || state === "uninstall") && ( {(state === "unknown" || state === "uninstall") && (
<Typography> <Typography>
Information: Please make sure that the Clash Verge Service is Information: Please make sure that the Clash Nyanpasu Service is
installed and enabled installed and enabled
</Typography> </Typography>
)} )}

View File

@ -56,7 +56,7 @@ const SettingVerge = ({ onError }: Props) => {
}); });
return ( return (
<SettingList title={t("Verge Setting")}> <SettingList title={t("Nyanpasu Setting")}>
<ThemeViewer ref={themeRef} /> <ThemeViewer ref={themeRef} />
<ConfigViewer ref={configRef} /> <ConfigViewer ref={configRef} />
<HotkeyViewer ref={hotkeyRef} /> <HotkeyViewer ref={hotkeyRef} />
@ -192,7 +192,7 @@ const SettingVerge = ({ onError }: Props) => {
</SettingItem> </SettingItem>
)} )}
<SettingItem label={t("Verge Version")}> <SettingItem label={t("Nyanpasu Version")}>
<Typography sx={{ py: "7px", pr: 1 }}>v{version}</Typography> <Typography sx={{ py: "7px", pr: 1 }}>v{version}</Typography>
</SettingItem> </SettingItem>
</SettingList> </SettingList>

View File

@ -8,7 +8,7 @@
type="image/x-icon" type="image/x-icon"
/> />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Clash Verge</title> <title>Clash Nyanpasu</title>
<script> <script>
(function () { (function () {
var _matchMedia = window.matchMedia; var _matchMedia = window.matchMedia;

View File

@ -64,7 +64,7 @@
"Settings": "Settings", "Settings": "Settings",
"Clash Setting": "Clash Setting", "Clash Setting": "Clash Setting",
"System Setting": "System Setting", "System Setting": "System Setting",
"Verge Setting": "Verge Setting", "Nyanpasu Setting": "Nyanpasu Setting",
"Allow Lan": "Allow Lan", "Allow Lan": "Allow Lan",
"IPv6": "IPv6", "IPv6": "IPv6",
"Log Level": "Log Level", "Log Level": "Log Level",
@ -94,7 +94,7 @@
"Open Core Dir": "Open Core Dir", "Open Core Dir": "Open Core Dir",
"Open Logs Dir": "Open Logs Dir", "Open Logs Dir": "Open Logs Dir",
"Check for Updates": "Check for Updates", "Check for Updates": "Check for Updates",
"Verge Version": "Verge Version", "Nyanpasu Version": "Nyanpasu Version",
"theme.light": "Light", "theme.light": "Light",
"theme.dark": "Dark", "theme.dark": "Dark",
"theme.system": "System", "theme.system": "System",

View File

@ -59,7 +59,7 @@
"Settings": "Настройки", "Settings": "Настройки",
"Clash Setting": "Настройки Clash", "Clash Setting": "Настройки Clash",
"System Setting": "Настройки системы", "System Setting": "Настройки системы",
"Verge Setting": "Настройки Verge", "Nyanpasu Setting": "Настройки Nyanpasu",
"Allow Lan": "Разрешить локальную сеть", "Allow Lan": "Разрешить локальную сеть",
"IPv6": "IPv6", "IPv6": "IPv6",
"Log Level": "Уровень логов", "Log Level": "Уровень логов",
@ -84,7 +84,7 @@
"Open App Dir": "Открыть папку приложения", "Open App Dir": "Открыть папку приложения",
"Open Core Dir": "Открыть папку ядра", "Open Core Dir": "Открыть папку ядра",
"Open Logs Dir": "Открыть папку логов", "Open Logs Dir": "Открыть папку логов",
"Verge Version": "Версия Verge", "Nyanpasu Version": "Версия Nyanpasu",
"theme.light": "Светлая", "theme.light": "Светлая",
"theme.dark": "Тёмная", "theme.dark": "Тёмная",
"theme.system": "Системная", "theme.system": "Системная",

View File

@ -64,7 +64,7 @@
"Settings": "设置", "Settings": "设置",
"Clash Setting": "Clash 设置", "Clash Setting": "Clash 设置",
"System Setting": "系统设置", "System Setting": "系统设置",
"Verge Setting": "Verge 设置", "Nyanpasu Setting": "Nyanpasu 设置",
"Allow Lan": "局域网连接", "Allow Lan": "局域网连接",
"IPv6": "IPv6", "IPv6": "IPv6",
"Log Level": "日志等级", "Log Level": "日志等级",
@ -94,7 +94,7 @@
"Open Core Dir": "内核目录", "Open Core Dir": "内核目录",
"Open Logs Dir": "日志目录", "Open Logs Dir": "日志目录",
"Check for Updates": "检查更新", "Check for Updates": "检查更新",
"Verge Version": "应用版本", "Nyanpasu Version": "Nyanpasu 版本",
"theme.light": "浅色", "theme.light": "浅色",
"theme.dark": "深色", "theme.dark": "深色",
"theme.system": "系统", "theme.system": "系统",