feat(install): 完成安装后跳转到成功页面

- 导入 `goto` 函数用于页面导航- 安装完成后自动跳转至 `/success` 页面- 移除无用的滚动条样式定义
- 新增成功页面组件 `success/+page.svelte`
- 移除 Windows 子系统属性配置
- 注释掉线程休眠代码
- 更新 IDE 模块配置排除 target 目录
- 美化 Header 组件添加阴影和模糊效果
- 简化网络接口信息结构体注释
- 添加 TypeScript 编译器配置文件
This commit is contained in:
Chaos
2025-11-13 00:00:56 +08:00
parent 056a9c6fee
commit 9c628162aa
10 changed files with 31 additions and 30 deletions

6
.idea/compiler.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="TypeScriptCompiler">
<option name="useTypesFromServer" value="true" />
</component>
</project>

2
.idea/gametools.iml generated
View File

@@ -2,9 +2,11 @@
<module type="WEB_MODULE" version="4"> <module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src-tauri/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" /> <excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" /> <excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" /> <excludeFolder url="file://$MODULE_DIR$/tmp" />
<excludeFolder url="file://$MODULE_DIR$/src-tauri/target" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />

View File

@@ -1,8 +0,0 @@
{
"game_name": "逃离鸭科夫",
"archive_name": "game_files.zip",
"executable_path": "bin/game_launcher.exe",
"default_install_dir_name": "My Awesome Game",
"shortcut_name": "启动 My Awesome Game",
"shortcut_icon_path": "assets/game_icon.ico"
}

Binary file not shown.

View File

@@ -1,5 +1,3 @@
// 只在 Windows 编译
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
// --- 1. 导入所需模块 --- // --- 1. 导入所需模块 ---
use thiserror::Error; use thiserror::Error;
@@ -123,7 +121,7 @@ pub async fn install_game(window: tauri::Window, target_dir: String) -> Result<S
// --- 2. (新增) 关键修复 --- // --- 2. (新增) 关键修复 ---
// 释放线程 1 毫秒,给 Svelte 留出渲染时间 // 释放线程 1 毫秒,给 Svelte 留出渲染时间
sleep(Duration::from_millis(1)).await; // sleep(Duration::from_millis(1)).await;
if (&*file.name()).ends_with('/') { if (&*file.name()).ends_with('/') {
fs::create_dir_all(&outpath)?; fs::create_dir_all(&outpath)?;

View File

@@ -4,8 +4,8 @@ use serde::Serialize;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
pub struct InterfaceInfo { pub struct InterfaceInfo {
pub name: String, pub name: String,
pub addr: String, // IP 地址 pub addr: String,
pub mac: Option<String>, // MAC 地址,可能不存在 pub mac: Option<String>,
} }
fn map_interface_to_info(interface: &NetworkInterface) -> InterfaceInfo { fn map_interface_to_info(interface: &NetworkInterface) -> InterfaceInfo {

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

View File

@@ -10,7 +10,7 @@
</script> </script>
<header class="h-8 z-50 w-full backdrop-blur-xs absolute top-0 window-controls flex gap-10 px-3 items-center" data-tauri-drag-region> <header class="h-8 z-50 w-full backdrop-blur-2xl absolute shadow-xl top-0 window-controls flex gap-10 px-3 items-center" data-tauri-drag-region>
<div class="flex-1" data-tauri-drag-region></div> <div class="flex-1" data-tauri-drag-region></div>

View File

@@ -4,6 +4,7 @@
// --- 1. 导入 Svelte 和 Tauri API --- // --- 1. 导入 Svelte 和 Tauri API ---
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { listen } from '@tauri-apps/api/event'; import { listen } from '@tauri-apps/api/event';
import { goto } from '$app/navigation';
let installPath = ''; let installPath = '';
let isInstalling = false; let isInstalling = false;
@@ -91,7 +92,7 @@
// 仅在最后显示成功弹窗 // 仅在最后显示成功弹窗
alert(`安装完成!\n${result}`); alert(`安装完成!\n${result}`);
await goto('/success')
} catch (error) { } catch (error) {
console.error('安装失败:', error); console.error('安装失败:', error);
log(`❌ 安装失败: ${error}`); // 将错误也记录到日志中 log(`❌ 安装失败: ${error}`); // 将错误也记录到日志中
@@ -178,19 +179,5 @@
</main> </main>
<style> <style>
/* 您的样式 (无需更改) */
::-webkit-scrollbar {
/*滚动条整体样式*/
width:5px;
/*高宽分别对应横竖滚动条的尺寸*/
height:5px;
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
background:#000000e0;
}
::-webkit-scrollbar-track {
/*滚动条里面轨道*/
background:#e8ecf3;
}
</style> </style>

View File

@@ -0,0 +1,16 @@
<script>
import tl from '$lib/assets/images/tl.png'
//https://nopj.cn/api/discussions?include=user%2ClastPostedUser%2Ctags%2Ctags.parent%2CfirstPost&sort=-createdAt&page%5Boffset%5D=0
</script>
<div class="h-screen w-screen flex z-10 pt-8">
<div class="flex-1">
123
</div>
<div class=" w-96 bg-base-200 p-4 bg-cover bg-center text-base-300" style="background-image: url({tl})">
<h1 class="font-bold text-4xl text-right">NoPJ</h1>
</div>
</div>