feat(install): 完成安装后跳转到成功页面
- 导入 `goto` 函数用于页面导航- 安装完成后自动跳转至 `/success` 页面- 移除无用的滚动条样式定义 - 新增成功页面组件 `success/+page.svelte` - 移除 Windows 子系统属性配置 - 注释掉线程休眠代码 - 更新 IDE 模块配置排除 target 目录 - 美化 Header 组件添加阴影和模糊效果 - 简化网络接口信息结构体注释 - 添加 TypeScript 编译器配置文件
This commit is contained in:
6
.idea/compiler.xml
generated
Normal file
6
.idea/compiler.xml
generated
Normal 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
2
.idea/gametools.iml
generated
@@ -2,9 +2,11 @@
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<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$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/src-tauri/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
||||
@@ -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.
@@ -1,5 +1,3 @@
|
||||
// 只在 Windows 编译
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
// --- 1. 导入所需模块 ---
|
||||
use thiserror::Error;
|
||||
@@ -123,7 +121,7 @@ pub async fn install_game(window: tauri::Window, target_dir: String) -> Result<S
|
||||
|
||||
// --- 2. (新增) 关键修复 ---
|
||||
// 释放线程 1 毫秒,给 Svelte 留出渲染时间
|
||||
sleep(Duration::from_millis(1)).await;
|
||||
// sleep(Duration::from_millis(1)).await;
|
||||
|
||||
if (&*file.name()).ends_with('/') {
|
||||
fs::create_dir_all(&outpath)?;
|
||||
|
||||
@@ -4,8 +4,8 @@ use serde::Serialize;
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct InterfaceInfo {
|
||||
pub name: String,
|
||||
pub addr: String, // IP 地址
|
||||
pub mac: Option<String>, // MAC 地址,可能不存在
|
||||
pub addr: String,
|
||||
pub mac: Option<String>,
|
||||
}
|
||||
|
||||
fn map_interface_to_info(interface: &NetworkInterface) -> InterfaceInfo {
|
||||
|
||||
BIN
src/lib/assets/images/tl.png
Normal file
BIN
src/lib/assets/images/tl.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 163 KiB |
@@ -10,7 +10,7 @@
|
||||
|
||||
</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>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
// --- 1. 导入 Svelte 和 Tauri API ---
|
||||
import { onMount } from 'svelte';
|
||||
import { listen } from '@tauri-apps/api/event';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
let installPath = '';
|
||||
let isInstalling = false;
|
||||
@@ -91,7 +92,7 @@
|
||||
|
||||
// 仅在最后显示成功弹窗
|
||||
alert(`安装完成!\n${result}`);
|
||||
|
||||
await goto('/success')
|
||||
} catch (error) {
|
||||
console.error('安装失败:', error);
|
||||
log(`❌ 安装失败: ${error}`); // 将错误也记录到日志中
|
||||
@@ -178,19 +179,5 @@
|
||||
</main>
|
||||
|
||||
<style>
|
||||
/* 您的样式 (无需更改) */
|
||||
::-webkit-scrollbar {
|
||||
/*滚动条整体样式*/
|
||||
width:5px;
|
||||
/*高宽分别对应横竖滚动条的尺寸*/
|
||||
height:5px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
/*滚动条里面小方块*/
|
||||
background:#000000e0;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
/*滚动条里面轨道*/
|
||||
background:#e8ecf3;
|
||||
}
|
||||
|
||||
</style>
|
||||
16
src/routes/success/+page.svelte
Normal file
16
src/routes/success/+page.svelte
Normal 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>
|
||||
Reference in New Issue
Block a user