modify ui
This commit is contained in:
@@ -204,22 +204,31 @@ pub async fn download_qjs(app: &AppHandle) -> Result<PathBuf> {
|
||||
let source_name = get_qjs_source_name_in_zip();
|
||||
let target_name = get_qjs_binary_name(); // quickjs.exe or quickjs
|
||||
|
||||
let mut found = false;
|
||||
let mut found_exe = false;
|
||||
for i in 0..archive.len() {
|
||||
let mut file = archive.by_index(i)?;
|
||||
// Filenames in zip might be like "quickjs-win-x86_64-2024-01-13/qjs.exe"
|
||||
let name = file.name();
|
||||
let name = file.name().to_string();
|
||||
|
||||
// Skip directories
|
||||
if file.is_dir() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let filename_only = name.split('/').last().unwrap_or("");
|
||||
|
||||
if filename_only == source_name {
|
||||
let mut out_file = fs::File::create(bin_dir.join(target_name))?;
|
||||
std::io::copy(&mut file, &mut out_file)?;
|
||||
found = true;
|
||||
break;
|
||||
found_exe = true;
|
||||
} else if filename_only.ends_with(".dll") {
|
||||
// Extract DLLs (needed for Windows MinGW builds, e.g. libwinpthread-1.dll)
|
||||
let mut out_file = fs::File::create(bin_dir.join(filename_only))?;
|
||||
std::io::copy(&mut file, &mut out_file)?;
|
||||
}
|
||||
}
|
||||
|
||||
if !found {
|
||||
if !found_exe {
|
||||
return Err(anyhow!("在下载的压缩包中找不到 {}", source_name));
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"app": {
|
||||
"windows": [
|
||||
{
|
||||
"title": "Stream Capture",
|
||||
"title": "流萤 - 视频下载",
|
||||
"width": 1300,
|
||||
"height": 850
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ onMounted(async () => {
|
||||
<template>
|
||||
<div class="flex h-screen bg-gray-50 dark:bg-zinc-950 text-zinc-900 dark:text-gray-100 font-sans overflow-hidden">
|
||||
<!-- Sidebar -->
|
||||
<aside class="w-20 lg:w-56 bg-white dark:bg-zinc-900 border-r border-gray-200 dark:border-zinc-800 flex flex-col flex-shrink-0">
|
||||
<aside class="w-20 lg:w-48 bg-white dark:bg-zinc-900 border-r border-gray-200 dark:border-zinc-800 flex flex-col flex-shrink-0">
|
||||
<div class="p-6 flex items-center gap-3 justify-center lg:justify-start">
|
||||
<div class="w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center text-white shrink-0">
|
||||
<Download class="w-5 h-5" />
|
||||
|
||||
@@ -54,7 +54,7 @@ onMounted(loadHistory)
|
||||
<header class="mb-8 flex justify-between items-center">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold text-zinc-900 dark:text-white">下载历史</h1>
|
||||
<p class="text-gray-500 dark:text-gray-400 mt-2">管理您的下载记录。</p>
|
||||
<!-- <p class="text-gray-500 dark:text-gray-400 mt-2">管理您的下载记录。</p> -->
|
||||
</div>
|
||||
<button
|
||||
@click="clearHistory"
|
||||
|
||||
@@ -159,7 +159,7 @@ async function startDownload() {
|
||||
<div class="max-w-5xl mx-auto p-8">
|
||||
<header class="mb-8">
|
||||
<h1 class="text-3xl font-bold text-zinc-900 dark:text-white">新建下载</h1>
|
||||
<p class="text-gray-500 dark:text-gray-400 mt-2">粘贴 URL 开始下载媒体。</p>
|
||||
<!-- <p class="text-gray-500 dark:text-gray-400 mt-2">粘贴 URL 开始下载媒体。</p> -->
|
||||
</header>
|
||||
|
||||
<!-- Input Section -->
|
||||
|
||||
@@ -65,7 +65,7 @@ function formatTime(ts: number) {
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold text-zinc-900 dark:text-white">运行日志</h1>
|
||||
<p class="text-gray-500 dark:text-gray-400 mt-2">下载任务的实时输出。</p>
|
||||
<!-- <p class="text-gray-500 dark:text-gray-400 mt-2">下载任务的实时输出。</p> -->
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-3">
|
||||
|
||||
@@ -62,7 +62,7 @@ function setTheme(theme: 'light' | 'dark' | 'system') {
|
||||
<div class="max-w-3xl mx-auto p-8">
|
||||
<header class="mb-8">
|
||||
<h1 class="text-3xl font-bold text-zinc-900 dark:text-white">设置</h1>
|
||||
<p class="text-gray-500 dark:text-gray-400 mt-2">配置您的下载偏好。</p>
|
||||
<!-- <p class="text-gray-500 dark:text-gray-400 mt-2">配置您的下载偏好。</p> -->
|
||||
</header>
|
||||
|
||||
<div class="space-y-6">
|
||||
|
||||
Reference in New Issue
Block a user