24 changed files with 12275 additions and 612 deletions
@ -0,0 +1,181 @@ |
|||||||
|
# GoFaster 前端系统 |
||||||
|
|
||||||
|
## 项目概述 |
||||||
|
|
||||||
|
GoFaster是一个基于Electron + Vue3的桌面应用程序,包含前端APP和后端Go服务。本仓库包含前端部分的完整实现。 |
||||||
|
|
||||||
|
## 功能特性 |
||||||
|
|
||||||
|
### 🎯 核心功能 |
||||||
|
- **用户管理**: 完整的用户CRUD操作,支持角色分配和权限管理 |
||||||
|
- **速度测试**: 网络连接速度测试功能 |
||||||
|
- **历史记录**: 测试历史数据查看和管理 |
||||||
|
- **系统设置**: 可配置的应用参数设置 |
||||||
|
|
||||||
|
### 🎨 界面特性 |
||||||
|
- **现代化设计**: 采用Material Design风格,界面美观易用 |
||||||
|
- **响应式布局**: 支持不同屏幕尺寸,适配各种设备 |
||||||
|
- **主题切换**: 支持浅色/深色主题切换 |
||||||
|
- **多语言支持**: 内置中英文界面 |
||||||
|
|
||||||
|
### 🔧 技术特性 |
||||||
|
- **标签页管理**: 支持多标签页操作,提高工作效率 |
||||||
|
- **收藏菜单**: 可收藏常用功能,快速访问 |
||||||
|
- **消息中心**: 实时消息通知和管理 |
||||||
|
- **面包屑导航**: 清晰的页面层级导航 |
||||||
|
|
||||||
|
## 技术架构 |
||||||
|
|
||||||
|
### 前端技术栈 |
||||||
|
- **框架**: Vue 3 + Composition API |
||||||
|
- **构建工具**: Vue CLI + Webpack |
||||||
|
- **桌面框架**: Electron |
||||||
|
- **路由**: Vue Router 4 |
||||||
|
- **状态管理**: Vuex 4 |
||||||
|
- **HTTP客户端**: Axios |
||||||
|
- **样式**: CSS3 + 响应式设计 |
||||||
|
|
||||||
|
### 项目结构 |
||||||
|
``` |
||||||
|
app/ |
||||||
|
├── src/ |
||||||
|
│ ├── main/ # Electron主进程 |
||||||
|
│ ├── renderer/ # 渲染进程 |
||||||
|
│ │ ├── components/ # 组件 |
||||||
|
│ │ ├── views/ # 页面 |
||||||
|
│ │ ├── services/ # 服务层 |
||||||
|
│ │ ├── router/ # 路由配置 |
||||||
|
│ │ └── store/ # 状态管理 |
||||||
|
│ └── public/ # 静态资源 |
||||||
|
├── package.json # 依赖配置 |
||||||
|
└── vue.config.js # Vue配置 |
||||||
|
``` |
||||||
|
|
||||||
|
## 快速开始 |
||||||
|
|
||||||
|
### 环境要求 |
||||||
|
- Node.js 16+ |
||||||
|
- npm 8+ |
||||||
|
|
||||||
|
### 安装依赖 |
||||||
|
```bash |
||||||
|
cd app |
||||||
|
npm install |
||||||
|
``` |
||||||
|
|
||||||
|
### 开发模式 |
||||||
|
```bash |
||||||
|
npm run dev |
||||||
|
``` |
||||||
|
|
||||||
|
### 构建生产版本 |
||||||
|
```bash |
||||||
|
npm run build |
||||||
|
``` |
||||||
|
|
||||||
|
## 主要组件说明 |
||||||
|
|
||||||
|
### 1. MainLayout.vue - 主布局组件 |
||||||
|
- **顶部导航栏**: Logo、面包屑导航、消息中心、用户信息 |
||||||
|
- **左侧菜单**: 主要功能菜单、收藏菜单 |
||||||
|
- **内容区域**: 标签页管理、功能内容展示 |
||||||
|
|
||||||
|
### 2. UserManagement.vue - 用户管理页面 |
||||||
|
- **用户列表**: 分页显示、搜索筛选、状态管理 |
||||||
|
- **用户操作**: 添加、编辑、删除用户 |
||||||
|
- **角色管理**: 用户角色分配和权限控制 |
||||||
|
|
||||||
|
### 3. Settings.vue - 系统设置页面 |
||||||
|
- **基本设置**: 应用名称、语言、主题 |
||||||
|
- **网络设置**: API地址、超时配置、重试策略 |
||||||
|
- **用户设置**: 登录配置、会话管理 |
||||||
|
- **通知设置**: 桌面通知、声音提醒 |
||||||
|
- **数据设置**: 缓存管理、备份策略 |
||||||
|
|
||||||
|
## 后端API集成 |
||||||
|
|
||||||
|
### 用户管理API |
||||||
|
- `GET /api/users` - 获取用户列表 |
||||||
|
- `POST /api/users` - 创建用户 |
||||||
|
- `PUT /api/users/:id` - 更新用户 |
||||||
|
- `DELETE /api/users/:id` - 删除用户 |
||||||
|
- `GET /api/roles` - 获取角色列表 |
||||||
|
|
||||||
|
### 认证API |
||||||
|
- `POST /api/auth/login` - 用户登录 |
||||||
|
- `POST /api/auth/logout` - 用户登出 |
||||||
|
- `GET /api/auth/me` - 获取当前用户信息 |
||||||
|
|
||||||
|
## 配置说明 |
||||||
|
|
||||||
|
### 环境配置 |
||||||
|
在 `src/renderer/services/userService.js` 中配置API基础URL: |
||||||
|
```javascript |
||||||
|
const API_BASE_URL = 'http://localhost:8080/api' |
||||||
|
``` |
||||||
|
|
||||||
|
### 主题配置 |
||||||
|
支持三种主题模式: |
||||||
|
- `light`: 浅色主题 |
||||||
|
- `dark`: 深色主题 |
||||||
|
- `auto`: 跟随系统设置 |
||||||
|
|
||||||
|
## 开发指南 |
||||||
|
|
||||||
|
### 添加新页面 |
||||||
|
1. 在 `src/renderer/views/` 创建新的Vue组件 |
||||||
|
2. 在 `src/renderer/router/index.js` 添加路由配置 |
||||||
|
3. 在 `src/renderer/components/MainLayout.vue` 添加菜单项 |
||||||
|
|
||||||
|
### 添加新API |
||||||
|
1. 在 `src/renderer/services/` 创建新的服务文件 |
||||||
|
2. 实现相应的API调用方法 |
||||||
|
3. 在组件中引入并使用 |
||||||
|
|
||||||
|
### 样式规范 |
||||||
|
- 使用CSS3和Flexbox布局 |
||||||
|
- 遵循Material Design设计规范 |
||||||
|
- 支持响应式设计,适配移动端 |
||||||
|
|
||||||
|
## 部署说明 |
||||||
|
|
||||||
|
### 开发环境 |
||||||
|
- 后端服务运行在 `localhost:8080` |
||||||
|
- 前端开发服务器自动构建并启动Electron |
||||||
|
|
||||||
|
### 生产环境 |
||||||
|
- 使用 `npm run build` 构建生产版本 |
||||||
|
- 生成的可执行文件在 `dist/` 目录 |
||||||
|
|
||||||
|
## 常见问题 |
||||||
|
|
||||||
|
### Q: 如何修改API服务器地址? |
||||||
|
A: 在设置页面的"网络设置"部分修改API服务器地址,或直接修改 `userService.js` 中的 `API_BASE_URL`。 |
||||||
|
|
||||||
|
### Q: 如何添加新的菜单项? |
||||||
|
A: 在 `MainLayout.vue` 的 `mainMenuItems` 数组中添加新的菜单项,包含id、name、path、icon等属性。 |
||||||
|
|
||||||
|
### Q: 如何自定义主题颜色? |
||||||
|
A: 在CSS中修改CSS变量或直接修改相应的颜色值。 |
||||||
|
|
||||||
|
## 贡献指南 |
||||||
|
|
||||||
|
1. Fork 本仓库 |
||||||
|
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`) |
||||||
|
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`) |
||||||
|
4. 推送到分支 (`git push origin feature/AmazingFeature`) |
||||||
|
5. 创建Pull Request |
||||||
|
|
||||||
|
## 许可证 |
||||||
|
|
||||||
|
本项目采用 ISC 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。 |
||||||
|
|
||||||
|
## 联系方式 |
||||||
|
|
||||||
|
- 项目维护者: GoFaster Team |
||||||
|
- 邮箱: support@gofaster.com |
||||||
|
- 项目地址: https://github.com/gofaster/gofaster |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
**注意**: 本项目需要配合Go后端服务使用,请确保后端服务正常运行。 |
@ -0,0 +1,115 @@ |
|||||||
|
# GoFaster 开发指南 |
||||||
|
|
||||||
|
## 解决Cursor终端中文乱码问题 |
||||||
|
|
||||||
|
由于PowerShell的编码问题,在运行`npm run dev`时可能会出现中文乱码。我们提供了多种解决方案: |
||||||
|
|
||||||
|
### 方案1:使用稳定开发脚本(推荐) |
||||||
|
|
||||||
|
```bash |
||||||
|
npm run dev:stable |
||||||
|
``` |
||||||
|
|
||||||
|
这个命令会: |
||||||
|
- 自动设置控制台编码为UTF-8 |
||||||
|
- 设置正确的环境变量 |
||||||
|
- 构建Vue应用 |
||||||
|
- 使用稳定的Electron配置启动 |
||||||
|
- 包含错误处理和重试机制 |
||||||
|
|
||||||
|
### 方案2:使用批处理文件 |
||||||
|
|
||||||
|
```bash |
||||||
|
npm run dev:bat |
||||||
|
``` |
||||||
|
|
||||||
|
这个命令会: |
||||||
|
- 自动设置控制台编码为UTF-8 |
||||||
|
- 设置环境变量 |
||||||
|
- 构建并启动应用 |
||||||
|
|
||||||
|
### 方案3:使用PowerShell脚本 |
||||||
|
|
||||||
|
```bash |
||||||
|
npm run dev:ps |
||||||
|
``` |
||||||
|
|
||||||
|
这个命令会: |
||||||
|
- 设置PowerShell编码为UTF-8 |
||||||
|
- 设置环境变量 |
||||||
|
- 构建并启动应用 |
||||||
|
|
||||||
|
### 方案4:分步执行 |
||||||
|
|
||||||
|
如果上述方案仍有问题,可以分步执行: |
||||||
|
|
||||||
|
```bash |
||||||
|
# 第一步:构建Vue应用 |
||||||
|
npm run build:vue |
||||||
|
|
||||||
|
# 第二步:启动Electron |
||||||
|
electron . |
||||||
|
``` |
||||||
|
|
||||||
|
## 解决热加载问题 |
||||||
|
|
||||||
|
### 常见热加载错误 |
||||||
|
|
||||||
|
1. **JavaScript注入失败**:`An object could not be cloned` |
||||||
|
- 原因:注入的JavaScript包含无法序列化的对象 |
||||||
|
- 解决:使用`npm run dev:stable`启动 |
||||||
|
|
||||||
|
2. **页面重载失败**:频繁的文件变化导致重载问题 |
||||||
|
- 解决:已添加500ms防抖机制 |
||||||
|
|
||||||
|
3. **渲染进程崩溃**:开发环境不稳定 |
||||||
|
- 解决:使用稳定的Electron启动参数 |
||||||
|
|
||||||
|
### 稳定开发配置 |
||||||
|
|
||||||
|
`dev:stable`脚本包含以下稳定配置: |
||||||
|
- `--disable-gpu`:禁用GPU加速,提高稳定性 |
||||||
|
- `--disable-software-rasterizer`:禁用软件光栅化 |
||||||
|
- `--disable-dev-shm-usage`:禁用开发共享内存 |
||||||
|
|
||||||
|
## 环境变量说明 |
||||||
|
|
||||||
|
- `VUE_CLI_BABEL_TRANSPILE_MODULES=false`: 禁用Babel模块转译 |
||||||
|
- `VUE_CLI_MODERN_BUILD=false`: 禁用现代构建模式 |
||||||
|
- `NODE_ENV=development`: 设置开发环境 |
||||||
|
|
||||||
|
## 故障排除 |
||||||
|
|
||||||
|
### 如果仍然出现乱码: |
||||||
|
|
||||||
|
1. **检查PowerShell版本**:确保使用PowerShell 5.1或更高版本 |
||||||
|
2. **设置执行策略**:`Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser` |
||||||
|
3. **使用Windows Terminal**:Windows Terminal对UTF-8支持更好 |
||||||
|
4. **检查系统区域设置**:确保系统支持UTF-8 |
||||||
|
|
||||||
|
### 如果热加载失败: |
||||||
|
|
||||||
|
1. **使用稳定脚本**:`npm run dev:stable` |
||||||
|
2. **清理构建缓存**:删除`dist`目录后重新构建 |
||||||
|
3. **检查文件权限**:确保有足够的文件读写权限 |
||||||
|
4. **重启开发环境**:完全关闭后重新启动 |
||||||
|
|
||||||
|
### 如果构建失败: |
||||||
|
|
||||||
|
1. **清理缓存**:`npm run clean` 或删除 `node_modules` 和 `dist` 目录 |
||||||
|
2. **重新安装依赖**:`npm install` |
||||||
|
3. **检查Node.js版本**:确保使用Node.js 16或更高版本 |
||||||
|
|
||||||
|
## 开发流程 |
||||||
|
|
||||||
|
1. 使用 `npm run dev:stable` 启动开发环境(推荐) |
||||||
|
2. 修改代码后,应用会自动重新加载 |
||||||
|
3. 使用 `Ctrl+C` 停止开发服务器 |
||||||
|
|
||||||
|
## 注意事项 |
||||||
|
|
||||||
|
- 所有控制台输出都已改为英文,避免编码问题 |
||||||
|
- 应用界面仍然支持中文显示 |
||||||
|
- 字体配置已优化,确保中文正常显示 |
||||||
|
- 热加载已优化,包含错误处理和防抖机制 |
||||||
|
- 提供多种启动方式,适应不同环境需求 |
@ -0,0 +1,41 @@ |
|||||||
|
@echo off |
||||||
|
chcp 65001 >nul |
||||||
|
setlocal enabledelayedexpansion |
||||||
|
|
||||||
|
echo Starting GoFaster development with stable configuration... |
||||||
|
echo Setting environment variables... |
||||||
|
|
||||||
|
set VUE_CLI_BABEL_TRANSPILE_MODULES=false |
||||||
|
set VUE_CLI_MODERN_BUILD=false |
||||||
|
set NODE_ENV=development |
||||||
|
|
||||||
|
echo VUE_CLI_BABEL_TRANSPILE_MODULES: %VUE_CLI_BABEL_TRANSPILE_MODULES% |
||||||
|
echo VUE_CLI_MODERN_BUILD: %VUE_CLI_MODERN_BUILD% |
||||||
|
echo NODE_ENV: %NODE_ENV% |
||||||
|
|
||||||
|
echo Building Vue application... |
||||||
|
call vue-cli-service build --mode development |
||||||
|
|
||||||
|
if %ERRORLEVEL% EQU 0 ( |
||||||
|
echo Vue build successful, starting Electron... |
||||||
|
echo Starting with stable configuration... |
||||||
|
electron . --disable-gpu --disable-software-rasterizer --disable-dev-shm-usage |
||||||
|
) else ( |
||||||
|
echo Vue build failed! |
||||||
|
echo Attempting to clean and rebuild... |
||||||
|
|
||||||
|
echo Cleaning dist directory... |
||||||
|
if exist dist rmdir /s /q dist |
||||||
|
|
||||||
|
echo Rebuilding Vue application... |
||||||
|
call vue-cli-service build --mode development |
||||||
|
|
||||||
|
if %ERRORLEVEL% EQU 0 ( |
||||||
|
echo Rebuild successful, starting Electron... |
||||||
|
electron . --disable-gpu --disable-software-rasterizer --disable-dev-shm-usage |
||||||
|
) else ( |
||||||
|
echo Rebuild failed! Please check your code for errors. |
||||||
|
pause |
||||||
|
exit /b 1 |
||||||
|
) |
||||||
|
) |
@ -0,0 +1,24 @@ |
|||||||
|
@echo off |
||||||
|
chcp 65001 >nul |
||||||
|
setlocal enabledelayedexpansion |
||||||
|
|
||||||
|
echo Starting GoFaster development with UTF-8 encoding... |
||||||
|
echo Setting environment variables... |
||||||
|
|
||||||
|
set VUE_CLI_BABEL_TRANSPILE_MODULES=false |
||||||
|
set VUE_CLI_MODERN_BUILD=false |
||||||
|
|
||||||
|
echo VUE_CLI_BABEL_TRANSPILE_MODULES: %VUE_CLI_BABEL_TRANSPILE_MODULES% |
||||||
|
echo VUE_CLI_MODERN_BUILD: %VUE_CLI_MODERN_BUILD% |
||||||
|
|
||||||
|
echo Building Vue application... |
||||||
|
call vue-cli-service build --mode development |
||||||
|
|
||||||
|
if %ERRORLEVEL% EQU 0 ( |
||||||
|
echo Vue build successful, starting Electron... |
||||||
|
electron . |
||||||
|
) else ( |
||||||
|
echo Vue build failed! |
||||||
|
pause |
||||||
|
exit /b 1 |
||||||
|
) |
@ -0,0 +1,25 @@ |
|||||||
|
# PowerShell开发脚本 - 设置正确的编码 |
||||||
|
# 设置控制台编码为UTF-8 |
||||||
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 |
||||||
|
[Console]::InputEncoding = [System.Text.Encoding]::UTF8 |
||||||
|
|
||||||
|
# 设置环境变量 |
||||||
|
$env:VUE_CLI_BABEL_TRANSPILE_MODULES = "false" |
||||||
|
$env:VUE_CLI_MODERN_BUILD = "false" |
||||||
|
|
||||||
|
Write-Host "Starting GoFaster development with UTF-8 encoding..." -ForegroundColor Green |
||||||
|
Write-Host "VUE_CLI_BABEL_TRANSPILE_MODULES: $env:VUE_CLI_BABEL_TRANSPILE_MODULES" -ForegroundColor Yellow |
||||||
|
Write-Host "VUE_CLI_MODERN_BUILD: $env:VUE_CLI_MODERN_BUILD" -ForegroundColor Yellow |
||||||
|
|
||||||
|
# 构建Vue应用 |
||||||
|
Write-Host "Building Vue application..." -ForegroundColor Cyan |
||||||
|
npm run build:vue |
||||||
|
|
||||||
|
if ($LASTEXITCODE -eq 0) { |
||||||
|
Write-Host "Vue build successful, starting Electron..." -ForegroundColor Green |
||||||
|
# 启动Electron |
||||||
|
electron . |
||||||
|
} else { |
||||||
|
Write-Host "Vue build failed!" -ForegroundColor Red |
||||||
|
exit 1 |
||||||
|
} |
Before Width: | Height: | Size: 2.3 MiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,302 @@ |
|||||||
|
(globalThis["webpackChunkGoFaster"] = globalThis["webpackChunkGoFaster"] || []).push([["src_renderer_components_SpeedTest_vue"],{ |
||||||
|
|
||||||
|
/***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css": |
||||||
|
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ |
||||||
|
!*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css ***! |
||||||
|
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ |
||||||
|
/***/ ((module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
||||||
|
/* harmony export */ }); |
||||||
|
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ "./node_modules/css-loader/dist/runtime/noSourceMaps.js"); |
||||||
|
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); |
||||||
|
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); |
||||||
|
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); |
||||||
|
// Imports
|
||||||
|
|
||||||
|
|
||||||
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); |
||||||
|
// Module
|
||||||
|
___CSS_LOADER_EXPORT___.push([module.id, ` |
||||||
|
.speed-test[data-v-373f173a] { |
||||||
|
padding: 20px; |
||||||
|
max-width: 600px; |
||||||
|
margin: 0 auto; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
button[data-v-373f173a] { |
||||||
|
padding: 10px 20px; |
||||||
|
font-size: 16px; |
||||||
|
background-color: #42b983; |
||||||
|
color: white; |
||||||
|
border: none; |
||||||
|
border-radius: 4px; |
||||||
|
cursor: pointer; |
||||||
|
margin: 20px 0; |
||||||
|
} |
||||||
|
button[data-v-373f173a]:disabled { |
||||||
|
background-color: #cccccc; |
||||||
|
cursor: not-allowed; |
||||||
|
} |
||||||
|
.results[data-v-373f173a] { |
||||||
|
margin-top: 20px; |
||||||
|
padding: 15px; |
||||||
|
background-color: #f5f5f5; |
||||||
|
border-radius: 4px; |
||||||
|
text-align: left; |
||||||
|
} |
||||||
|
.result-item[data-v-373f173a] { |
||||||
|
margin: 10px 0; |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; |
||||||
|
} |
||||||
|
.label[data-v-373f173a] { |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
.value[data-v-373f173a] { |
||||||
|
color: #42b983; |
||||||
|
} |
||||||
|
`, ""]);
|
||||||
|
// Exports
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); |
||||||
|
|
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=script&lang=js": |
||||||
|
/*!**********************************************************************************************************************************!*\ |
||||||
|
!*** ./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=script&lang=js ***! |
||||||
|
\**********************************************************************************************************************************/ |
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
||||||
|
/* harmony export */ }); |
||||||
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.runtime.esm-bundler.js"); |
||||||
|
/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm-bundler.js"); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ |
||||||
|
name: 'SpeedTest', |
||||||
|
setup() { |
||||||
|
const store = (0,vuex__WEBPACK_IMPORTED_MODULE_1__.useStore)() |
||||||
|
const testing = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false) |
||||||
|
const result = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null) |
||||||
|
|
||||||
|
const startTest = async () => { |
||||||
|
testing.value = true |
||||||
|
result.value = null |
||||||
|
|
||||||
|
// 模拟网络测试 (替换为真实测试逻辑)
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 2000)) |
||||||
|
|
||||||
|
const testResult = { |
||||||
|
download: (Math.random() * 100).toFixed(2), |
||||||
|
upload: (Math.random() * 50).toFixed(2), |
||||||
|
ping: (Math.random() * 100).toFixed(2), |
||||||
|
timestamp: new Date().toISOString() |
||||||
|
} |
||||||
|
|
||||||
|
// 保存结果
|
||||||
|
await store.dispatch('saveTestResult', testResult) |
||||||
|
result.value = testResult |
||||||
|
testing.value = false |
||||||
|
} |
||||||
|
|
||||||
|
return { testing, result, startTest } |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=template&id=373f173a&scoped=true": |
||||||
|
/*!**************************************************************************************************************************************************************************************************************************!*\ |
||||||
|
!*** ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=template&id=373f173a&scoped=true ***! |
||||||
|
\**************************************************************************************************************************************************************************************************************************/ |
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
||||||
|
/* harmony export */ render: () => (/* binding */ render) |
||||||
|
/* harmony export */ }); |
||||||
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.runtime.esm-bundler.js"); |
||||||
|
|
||||||
|
|
||||||
|
const _hoisted_1 = { class: "speed-test" } |
||||||
|
const _hoisted_2 = ["disabled"] |
||||||
|
const _hoisted_3 = { |
||||||
|
key: 0, |
||||||
|
class: "results" |
||||||
|
} |
||||||
|
const _hoisted_4 = { class: "result-item" } |
||||||
|
const _hoisted_5 = { class: "value" } |
||||||
|
const _hoisted_6 = { class: "result-item" } |
||||||
|
const _hoisted_7 = { class: "value" } |
||||||
|
const _hoisted_8 = { class: "result-item" } |
||||||
|
const _hoisted_9 = { class: "value" } |
||||||
|
|
||||||
|
function render(_ctx, _cache, $props, $setup, $data, $options) { |
||||||
|
return ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [ |
||||||
|
_cache[5] || (_cache[5] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "GoFaster Speed Test", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", { |
||||||
|
onClick: _cache[0] || (_cache[0] = (...args) => ($setup.startTest && $setup.startTest(...args))), |
||||||
|
disabled: $setup.testing |
||||||
|
}, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.testing ? 'Testing...' : 'Start Test'), 9 /* TEXT, PROPS */, _hoisted_2), |
||||||
|
($setup.result) |
||||||
|
? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_3, [ |
||||||
|
_cache[4] || (_cache[4] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", null, "Test Results:", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [ |
||||||
|
_cache[1] || (_cache[1] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", { class: "label" }, "Download:", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_5, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.result.download) + " Mbps", 1 /* TEXT */) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [ |
||||||
|
_cache[2] || (_cache[2] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", { class: "label" }, "Upload:", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_7, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.result.upload) + " Mbps", 1 /* TEXT */) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [ |
||||||
|
_cache[3] || (_cache[3] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", { class: "label" }, "Ping:", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_9, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.result.ping) + " ms", 1 /* TEXT */) |
||||||
|
]) |
||||||
|
])) |
||||||
|
: (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true) |
||||||
|
])) |
||||||
|
} |
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./node_modules/vue-style-loader/index.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css": |
||||||
|
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ |
||||||
|
!*** ./node_modules/vue-style-loader/index.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css ***! |
||||||
|
\************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ |
||||||
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
||||||
|
|
||||||
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
||||||
|
|
||||||
|
// load the styles
|
||||||
|
var content = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css"); |
||||||
|
if(content.__esModule) content = content.default; |
||||||
|
if(typeof content === 'string') content = [[module.id, content, '']]; |
||||||
|
if(content.locals) module.exports = content.locals; |
||||||
|
// add the styles to the DOM
|
||||||
|
var add = (__webpack_require__(/*! !../../../node_modules/vue-style-loader/lib/addStylesClient.js */ "./node_modules/vue-style-loader/lib/addStylesClient.js")["default"]) |
||||||
|
var update = add("220dc05d", content, false, {"sourceMap":false,"shadowMode":false}); |
||||||
|
// Hot Module Replacement
|
||||||
|
if(true) { |
||||||
|
// When the styles change, update the <style> tags
|
||||||
|
if(!content.locals) { |
||||||
|
module.hot.accept(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css", function() { |
||||||
|
var newContent = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css"); |
||||||
|
if(newContent.__esModule) newContent = newContent.default; |
||||||
|
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; |
||||||
|
update(newContent); |
||||||
|
}); |
||||||
|
} |
||||||
|
// When the module is disposed, remove the <style> tags
|
||||||
|
module.hot.dispose(function() { update(); }); |
||||||
|
} |
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./src/renderer/components/SpeedTest.vue": |
||||||
|
/*!***********************************************!*\ |
||||||
|
!*** ./src/renderer/components/SpeedTest.vue ***! |
||||||
|
\***********************************************/ |
||||||
|
/***/ ((module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
||||||
|
/* harmony export */ }); |
||||||
|
/* harmony import */ var _SpeedTest_vue_vue_type_template_id_373f173a_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SpeedTest.vue?vue&type=template&id=373f173a&scoped=true */ "./src/renderer/components/SpeedTest.vue?vue&type=template&id=373f173a&scoped=true"); |
||||||
|
/* harmony import */ var _SpeedTest_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SpeedTest.vue?vue&type=script&lang=js */ "./src/renderer/components/SpeedTest.vue?vue&type=script&lang=js"); |
||||||
|
/* harmony import */ var _SpeedTest_vue_vue_type_style_index_0_id_373f173a_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css */ "./src/renderer/components/SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css"); |
||||||
|
/* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; |
||||||
|
|
||||||
|
|
||||||
|
const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_SpeedTest_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_SpeedTest_vue_vue_type_template_id_373f173a_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-373f173a"],['__file',"src/renderer/components/SpeedTest.vue"]]) |
||||||
|
/* hot reload */ |
||||||
|
if (true) { |
||||||
|
__exports__.__hmrId = "373f173a" |
||||||
|
const api = __VUE_HMR_RUNTIME__ |
||||||
|
module.hot.accept() |
||||||
|
if (!api.createRecord('373f173a', __exports__)) { |
||||||
|
api.reload('373f173a', __exports__) |
||||||
|
} |
||||||
|
|
||||||
|
module.hot.accept(/*! ./SpeedTest.vue?vue&type=template&id=373f173a&scoped=true */ "./src/renderer/components/SpeedTest.vue?vue&type=template&id=373f173a&scoped=true", __WEBPACK_OUTDATED_DEPENDENCIES__ => { /* harmony import */ _SpeedTest_vue_vue_type_template_id_373f173a_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SpeedTest.vue?vue&type=template&id=373f173a&scoped=true */ "./src/renderer/components/SpeedTest.vue?vue&type=template&id=373f173a&scoped=true"); |
||||||
|
return (() => { |
||||||
|
api.rerender('373f173a', _SpeedTest_vue_vue_type_template_id_373f173a_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render) |
||||||
|
})(__WEBPACK_OUTDATED_DEPENDENCIES__); }) |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); |
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./src/renderer/components/SpeedTest.vue?vue&type=script&lang=js": |
||||||
|
/*!***********************************************************************!*\ |
||||||
|
!*** ./src/renderer/components/SpeedTest.vue?vue&type=script&lang=js ***! |
||||||
|
\***********************************************************************/ |
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
||||||
|
/* harmony export */ "default": () => (/* reexport safe */ _node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SpeedTest_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]) |
||||||
|
/* harmony export */ }); |
||||||
|
/* harmony import */ var _node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SpeedTest_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SpeedTest.vue?vue&type=script&lang=js */ "./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=script&lang=js"); |
||||||
|
|
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./src/renderer/components/SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css": |
||||||
|
/*!*******************************************************************************************************!*\ |
||||||
|
!*** ./src/renderer/components/SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css ***! |
||||||
|
\*******************************************************************************************************/ |
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony import */ var _node_modules_vue_style_loader_index_js_clonedRuleSet_12_use_0_node_modules_css_loader_dist_cjs_js_clonedRuleSet_12_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_12_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SpeedTest_vue_vue_type_style_index_0_id_373f173a_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-style-loader/index.js??clonedRuleSet-12.use[0]!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css */ "./node_modules/vue-style-loader/index.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=style&index=0&id=373f173a&scoped=true&lang=css"); |
||||||
|
/* harmony import */ var _node_modules_vue_style_loader_index_js_clonedRuleSet_12_use_0_node_modules_css_loader_dist_cjs_js_clonedRuleSet_12_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_12_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SpeedTest_vue_vue_type_style_index_0_id_373f173a_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_clonedRuleSet_12_use_0_node_modules_css_loader_dist_cjs_js_clonedRuleSet_12_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_12_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SpeedTest_vue_vue_type_style_index_0_id_373f173a_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__); |
||||||
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; |
||||||
|
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_clonedRuleSet_12_use_0_node_modules_css_loader_dist_cjs_js_clonedRuleSet_12_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_12_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SpeedTest_vue_vue_type_style_index_0_id_373f173a_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _node_modules_vue_style_loader_index_js_clonedRuleSet_12_use_0_node_modules_css_loader_dist_cjs_js_clonedRuleSet_12_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_12_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SpeedTest_vue_vue_type_style_index_0_id_373f173a_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] |
||||||
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); |
||||||
|
|
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./src/renderer/components/SpeedTest.vue?vue&type=template&id=373f173a&scoped=true": |
||||||
|
/*!*****************************************************************************************!*\ |
||||||
|
!*** ./src/renderer/components/SpeedTest.vue?vue&type=template&id=373f173a&scoped=true ***! |
||||||
|
\*****************************************************************************************/ |
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
||||||
|
/* harmony export */ render: () => (/* reexport safe */ _node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SpeedTest_vue_vue_type_template_id_373f173a_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render) |
||||||
|
/* harmony export */ }); |
||||||
|
/* harmony import */ var _node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SpeedTest_vue_vue_type_template_id_373f173a_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SpeedTest.vue?vue&type=template&id=373f173a&scoped=true */ "./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/components/SpeedTest.vue?vue&type=template&id=373f173a&scoped=true"); |
||||||
|
|
||||||
|
|
||||||
|
/***/ }) |
||||||
|
|
||||||
|
}]); |
@ -0,0 +1,670 @@ |
|||||||
|
(globalThis["webpackChunkGoFaster"] = globalThis["webpackChunkGoFaster"] || []).push([["src_renderer_views_Settings_vue"],{ |
||||||
|
|
||||||
|
/***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css": |
||||||
|
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ |
||||||
|
!*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css ***! |
||||||
|
\************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ |
||||||
|
/***/ ((module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
||||||
|
/* harmony export */ }); |
||||||
|
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ "./node_modules/css-loader/dist/runtime/noSourceMaps.js"); |
||||||
|
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); |
||||||
|
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); |
||||||
|
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); |
||||||
|
// Imports
|
||||||
|
|
||||||
|
|
||||||
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default())); |
||||||
|
// Module
|
||||||
|
___CSS_LOADER_EXPORT___.push([module.id, ` |
||||||
|
.settings[data-v-a5c10072] { |
||||||
|
padding: 20px; |
||||||
|
height: 100%; |
||||||
|
overflow-y: auto; |
||||||
|
} |
||||||
|
.page-header[data-v-a5c10072] { |
||||||
|
margin-bottom: 30px; |
||||||
|
} |
||||||
|
.page-header h2[data-v-a5c10072] { |
||||||
|
margin: 0; |
||||||
|
color: #333; |
||||||
|
font-size: 24px; |
||||||
|
} |
||||||
|
.settings-content[data-v-a5c10072] { |
||||||
|
max-width: 800px; |
||||||
|
} |
||||||
|
.settings-section[data-v-a5c10072] { |
||||||
|
background: white; |
||||||
|
border-radius: 8px; |
||||||
|
padding: 24px; |
||||||
|
margin-bottom: 24px; |
||||||
|
box-shadow: 0 2px 8px rgba(0,0,0,0.1); |
||||||
|
} |
||||||
|
.settings-section h3[data-v-a5c10072] { |
||||||
|
margin: 0 0 20px 0; |
||||||
|
color: #333; |
||||||
|
font-size: 18px; |
||||||
|
border-bottom: 2px solid #e0e0e0; |
||||||
|
padding-bottom: 8px; |
||||||
|
} |
||||||
|
.setting-item[data-v-a5c10072] { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: space-between; |
||||||
|
margin-bottom: 20px; |
||||||
|
padding: 16px 0; |
||||||
|
border-bottom: 1px solid #f5f5f5; |
||||||
|
} |
||||||
|
.setting-item[data-v-a5c10072]:last-child { |
||||||
|
border-bottom: none; |
||||||
|
margin-bottom: 0; |
||||||
|
} |
||||||
|
.setting-item label[data-v-a5c10072] { |
||||||
|
font-weight: 500; |
||||||
|
color: #333; |
||||||
|
min-width: 200px; |
||||||
|
} |
||||||
|
.setting-item input[type="text"][data-v-a5c10072], |
||||||
|
.setting-item input[type="number"][data-v-a5c10072], |
||||||
|
.setting-item select[data-v-a5c10072] { |
||||||
|
padding: 8px 12px; |
||||||
|
border: 1px solid #ddd; |
||||||
|
border-radius: 4px; |
||||||
|
font-size: 14px; |
||||||
|
min-width: 200px; |
||||||
|
} |
||||||
|
.setting-item input[type="text"][data-v-a5c10072]:focus, |
||||||
|
.setting-item input[type="number"][data-v-a5c10072]:focus, |
||||||
|
.setting-item select[data-v-a5c10072]:focus { |
||||||
|
outline: none; |
||||||
|
border-color: #1976d2; |
||||||
|
box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2); |
||||||
|
} |
||||||
|
|
||||||
|
/* 开关样式 */ |
||||||
|
.toggle-switch[data-v-a5c10072] { |
||||||
|
position: relative; |
||||||
|
display: inline-block; |
||||||
|
} |
||||||
|
.toggle-switch input[type="checkbox"][data-v-a5c10072] { |
||||||
|
opacity: 0; |
||||||
|
width: 0; |
||||||
|
height: 0; |
||||||
|
} |
||||||
|
.toggle-label[data-v-a5c10072] { |
||||||
|
display: block; |
||||||
|
width: 50px; |
||||||
|
height: 24px; |
||||||
|
background: #ccc; |
||||||
|
border-radius: 12px; |
||||||
|
cursor: pointer; |
||||||
|
position: relative; |
||||||
|
transition: background-color 0.3s; |
||||||
|
} |
||||||
|
.toggle-label[data-v-a5c10072]:before { |
||||||
|
content: ''; |
||||||
|
position: absolute; |
||||||
|
width: 20px; |
||||||
|
height: 20px; |
||||||
|
border-radius: 50%; |
||||||
|
background: white; |
||||||
|
top: 2px; |
||||||
|
left: 2px; |
||||||
|
transition: transform 0.3s; |
||||||
|
} |
||||||
|
.toggle-switch input[type="checkbox"]:checked + .toggle-label[data-v-a5c10072] { |
||||||
|
background: #1976d2; |
||||||
|
} |
||||||
|
.toggle-switch input[type="checkbox"]:checked + .toggle-label[data-v-a5c10072]:before { |
||||||
|
transform: translateX(26px); |
||||||
|
} |
||||||
|
|
||||||
|
/* 操作按钮 */ |
||||||
|
.settings-actions[data-v-a5c10072] { |
||||||
|
display: flex; |
||||||
|
gap: 16px; |
||||||
|
justify-content: flex-end; |
||||||
|
margin-top: 30px; |
||||||
|
} |
||||||
|
.btn[data-v-a5c10072] { |
||||||
|
padding: 12px 24px; |
||||||
|
border: none; |
||||||
|
border-radius: 6px; |
||||||
|
cursor: pointer; |
||||||
|
font-size: 14px; |
||||||
|
font-weight: 500; |
||||||
|
transition: all 0.2s; |
||||||
|
} |
||||||
|
.btn-primary[data-v-a5c10072] { |
||||||
|
background: #1976d2; |
||||||
|
color: white; |
||||||
|
} |
||||||
|
.btn-primary[data-v-a5c10072]:hover { |
||||||
|
background: #1565c0; |
||||||
|
} |
||||||
|
.btn-secondary[data-v-a5c10072] { |
||||||
|
background: #757575; |
||||||
|
color: white; |
||||||
|
} |
||||||
|
.btn-secondary[data-v-a5c10072]:hover { |
||||||
|
background: #616161; |
||||||
|
} |
||||||
|
|
||||||
|
/* 响应式设计 */ |
||||||
|
@media (max-width: 768px) { |
||||||
|
.setting-item[data-v-a5c10072] { |
||||||
|
flex-direction: column; |
||||||
|
align-items: flex-start; |
||||||
|
gap: 12px; |
||||||
|
} |
||||||
|
.setting-item label[data-v-a5c10072] { |
||||||
|
min-width: auto; |
||||||
|
} |
||||||
|
.setting-item input[type="text"][data-v-a5c10072], |
||||||
|
.setting-item input[type="number"][data-v-a5c10072], |
||||||
|
.setting-item select[data-v-a5c10072] { |
||||||
|
min-width: 100%; |
||||||
|
} |
||||||
|
.settings-actions[data-v-a5c10072] { |
||||||
|
flex-direction: column; |
||||||
|
} |
||||||
|
} |
||||||
|
`, ""]);
|
||||||
|
// Exports
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); |
||||||
|
|
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=script&lang=js": |
||||||
|
/*!****************************************************************************************************************************!*\ |
||||||
|
!*** ./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=script&lang=js ***! |
||||||
|
\****************************************************************************************************************************/ |
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
||||||
|
/* harmony export */ }); |
||||||
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.runtime.esm-bundler.js"); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ |
||||||
|
name: 'Settings', |
||||||
|
setup() { |
||||||
|
const settings = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)({ |
||||||
|
// 基本设置
|
||||||
|
appName: 'GoFaster', |
||||||
|
language: 'zh-CN', |
||||||
|
theme: 'light', |
||||||
|
|
||||||
|
// 网络设置
|
||||||
|
apiUrl: 'http://localhost:8080', |
||||||
|
timeout: 10, |
||||||
|
retryCount: 3, |
||||||
|
|
||||||
|
// 用户设置
|
||||||
|
autoLogin: false, |
||||||
|
rememberPassword: false, |
||||||
|
sessionTimeout: 30, |
||||||
|
|
||||||
|
// 通知设置
|
||||||
|
desktopNotifications: true, |
||||||
|
soundNotifications: true, |
||||||
|
notificationInterval: 10, |
||||||
|
|
||||||
|
// 数据设置
|
||||||
|
cacheSize: 100, |
||||||
|
autoCleanCache: true, |
||||||
|
backupFrequency: 'weekly' |
||||||
|
}) |
||||||
|
|
||||||
|
const loadSettings = () => { |
||||||
|
const savedSettings = localStorage.getItem('gofaster-settings') |
||||||
|
if (savedSettings) { |
||||||
|
Object.assign(settings, JSON.parse(savedSettings)) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
const saveSettings = () => { |
||||||
|
try { |
||||||
|
localStorage.setItem('gofaster-settings', JSON.stringify(settings)) |
||||||
|
// 这里可以添加保存成功的提示
|
||||||
|
console.log('设置已保存') |
||||||
|
} catch (error) { |
||||||
|
console.error('保存设置失败:', error) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
const resetSettings = () => { |
||||||
|
if (confirm('确定要重置所有设置吗?此操作不可撤销。')) { |
||||||
|
localStorage.removeItem('gofaster-settings') |
||||||
|
location.reload() |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
;(0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(() => { |
||||||
|
loadSettings() |
||||||
|
}) |
||||||
|
|
||||||
|
return { |
||||||
|
settings, |
||||||
|
saveSettings, |
||||||
|
resetSettings |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=template&id=a5c10072&scoped=true": |
||||||
|
/*!********************************************************************************************************************************************************************************************************************!*\ |
||||||
|
!*** ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=template&id=a5c10072&scoped=true ***! |
||||||
|
\********************************************************************************************************************************************************************************************************************/ |
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
||||||
|
/* harmony export */ render: () => (/* binding */ render) |
||||||
|
/* harmony export */ }); |
||||||
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.runtime.esm-bundler.js"); |
||||||
|
|
||||||
|
|
||||||
|
const _hoisted_1 = { class: "settings" } |
||||||
|
const _hoisted_2 = { class: "settings-content" } |
||||||
|
const _hoisted_3 = { class: "settings-section" } |
||||||
|
const _hoisted_4 = { class: "setting-item" } |
||||||
|
const _hoisted_5 = { class: "setting-item" } |
||||||
|
const _hoisted_6 = { class: "setting-item" } |
||||||
|
const _hoisted_7 = { class: "settings-section" } |
||||||
|
const _hoisted_8 = { class: "setting-item" } |
||||||
|
const _hoisted_9 = { class: "setting-item" } |
||||||
|
const _hoisted_10 = { class: "setting-item" } |
||||||
|
const _hoisted_11 = { class: "settings-section" } |
||||||
|
const _hoisted_12 = { class: "setting-item" } |
||||||
|
const _hoisted_13 = { class: "toggle-switch" } |
||||||
|
const _hoisted_14 = { class: "setting-item" } |
||||||
|
const _hoisted_15 = { class: "toggle-switch" } |
||||||
|
const _hoisted_16 = { class: "setting-item" } |
||||||
|
const _hoisted_17 = { class: "settings-section" } |
||||||
|
const _hoisted_18 = { class: "setting-item" } |
||||||
|
const _hoisted_19 = { class: "toggle-switch" } |
||||||
|
const _hoisted_20 = { class: "setting-item" } |
||||||
|
const _hoisted_21 = { class: "toggle-switch" } |
||||||
|
const _hoisted_22 = { class: "setting-item" } |
||||||
|
const _hoisted_23 = { class: "settings-section" } |
||||||
|
const _hoisted_24 = { class: "setting-item" } |
||||||
|
const _hoisted_25 = { class: "setting-item" } |
||||||
|
const _hoisted_26 = { class: "toggle-switch" } |
||||||
|
const _hoisted_27 = { class: "setting-item" } |
||||||
|
const _hoisted_28 = { class: "settings-actions" } |
||||||
|
|
||||||
|
function render(_ctx, _cache, $props, $setup, $data, $options) { |
||||||
|
return ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [ |
||||||
|
_cache[45] || (_cache[45] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", { class: "page-header" }, [ |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, "系统设置") |
||||||
|
], -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [ |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" 基本设置 "), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [ |
||||||
|
_cache[22] || (_cache[22] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", null, "基本设置", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [ |
||||||
|
_cache[17] || (_cache[17] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "应用名称", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { |
||||||
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($setup.settings.appName) = $event)), |
||||||
|
type: "text", |
||||||
|
placeholder: "GoFaster" |
||||||
|
}, null, 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelText, $setup.settings.appName] |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [ |
||||||
|
_cache[19] || (_cache[19] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "语言", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("select", { |
||||||
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($setup.settings.language) = $event)) |
||||||
|
}, _cache[18] || (_cache[18] = [ |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("option", { value: "zh-CN" }, "简体中文", -1 /* CACHED */), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("option", { value: "en-US" }, "English", -1 /* CACHED */) |
||||||
|
]), 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelSelect, $setup.settings.language] |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [ |
||||||
|
_cache[21] || (_cache[21] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "主题", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("select", { |
||||||
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (($setup.settings.theme) = $event)) |
||||||
|
}, _cache[20] || (_cache[20] = [ |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("option", { value: "light" }, "浅色主题", -1 /* CACHED */), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("option", { value: "dark" }, "深色主题", -1 /* CACHED */), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("option", { value: "auto" }, "跟随系统", -1 /* CACHED */) |
||||||
|
]), 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelSelect, $setup.settings.theme] |
||||||
|
]) |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" 网络设置 "), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [ |
||||||
|
_cache[26] || (_cache[26] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", null, "网络设置", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [ |
||||||
|
_cache[23] || (_cache[23] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "API服务器地址", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { |
||||||
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = $event => (($setup.settings.apiUrl) = $event)), |
||||||
|
type: "text", |
||||||
|
placeholder: "http://localhost:8080" |
||||||
|
}, null, 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelText, $setup.settings.apiUrl] |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_9, [ |
||||||
|
_cache[24] || (_cache[24] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "请求超时时间 (秒)", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { |
||||||
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = $event => (($setup.settings.timeout) = $event)), |
||||||
|
type: "number", |
||||||
|
min: "5", |
||||||
|
max: "60" |
||||||
|
}, null, 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelText, $setup.settings.timeout] |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_10, [ |
||||||
|
_cache[25] || (_cache[25] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "自动重试次数", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { |
||||||
|
"onUpdate:modelValue": _cache[5] || (_cache[5] = $event => (($setup.settings.retryCount) = $event)), |
||||||
|
type: "number", |
||||||
|
min: "0", |
||||||
|
max: "5" |
||||||
|
}, null, 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelText, $setup.settings.retryCount] |
||||||
|
]) |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" 用户设置 "), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_11, [ |
||||||
|
_cache[32] || (_cache[32] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", null, "用户设置", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_12, [ |
||||||
|
_cache[28] || (_cache[28] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "自动登录", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_13, [ |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { |
||||||
|
"onUpdate:modelValue": _cache[6] || (_cache[6] = $event => (($setup.settings.autoLogin) = $event)), |
||||||
|
type: "checkbox", |
||||||
|
id: "autoLogin" |
||||||
|
}, null, 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelCheckbox, $setup.settings.autoLogin] |
||||||
|
]), |
||||||
|
_cache[27] || (_cache[27] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", { |
||||||
|
for: "autoLogin", |
||||||
|
class: "toggle-label" |
||||||
|
}, null, -1 /* CACHED */)) |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_14, [ |
||||||
|
_cache[30] || (_cache[30] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "记住密码", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_15, [ |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { |
||||||
|
"onUpdate:modelValue": _cache[7] || (_cache[7] = $event => (($setup.settings.rememberPassword) = $event)), |
||||||
|
type: "checkbox", |
||||||
|
id: "rememberPassword" |
||||||
|
}, null, 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelCheckbox, $setup.settings.rememberPassword] |
||||||
|
]), |
||||||
|
_cache[29] || (_cache[29] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", { |
||||||
|
for: "rememberPassword", |
||||||
|
class: "toggle-label" |
||||||
|
}, null, -1 /* CACHED */)) |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_16, [ |
||||||
|
_cache[31] || (_cache[31] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "会话超时时间 (分钟)", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { |
||||||
|
"onUpdate:modelValue": _cache[8] || (_cache[8] = $event => (($setup.settings.sessionTimeout) = $event)), |
||||||
|
type: "number", |
||||||
|
min: "15", |
||||||
|
max: "1440" |
||||||
|
}, null, 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelText, $setup.settings.sessionTimeout] |
||||||
|
]) |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" 通知设置 "), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_17, [ |
||||||
|
_cache[38] || (_cache[38] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", null, "通知设置", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_18, [ |
||||||
|
_cache[34] || (_cache[34] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "桌面通知", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_19, [ |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { |
||||||
|
"onUpdate:modelValue": _cache[9] || (_cache[9] = $event => (($setup.settings.desktopNotifications) = $event)), |
||||||
|
type: "checkbox", |
||||||
|
id: "desktopNotifications" |
||||||
|
}, null, 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelCheckbox, $setup.settings.desktopNotifications] |
||||||
|
]), |
||||||
|
_cache[33] || (_cache[33] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", { |
||||||
|
for: "desktopNotifications", |
||||||
|
class: "toggle-label" |
||||||
|
}, null, -1 /* CACHED */)) |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_20, [ |
||||||
|
_cache[36] || (_cache[36] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "声音提醒", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_21, [ |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { |
||||||
|
"onUpdate:modelValue": _cache[10] || (_cache[10] = $event => (($setup.settings.soundNotifications) = $event)), |
||||||
|
type: "checkbox", |
||||||
|
id: "soundNotifications" |
||||||
|
}, null, 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelCheckbox, $setup.settings.soundNotifications] |
||||||
|
]), |
||||||
|
_cache[35] || (_cache[35] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", { |
||||||
|
for: "soundNotifications", |
||||||
|
class: "toggle-label" |
||||||
|
}, null, -1 /* CACHED */)) |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_22, [ |
||||||
|
_cache[37] || (_cache[37] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "消息提醒间隔 (秒)", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { |
||||||
|
"onUpdate:modelValue": _cache[11] || (_cache[11] = $event => (($setup.settings.notificationInterval) = $event)), |
||||||
|
type: "number", |
||||||
|
min: "5", |
||||||
|
max: "300" |
||||||
|
}, null, 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelText, $setup.settings.notificationInterval] |
||||||
|
]) |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" 数据设置 "), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_23, [ |
||||||
|
_cache[44] || (_cache[44] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", null, "数据设置", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_24, [ |
||||||
|
_cache[39] || (_cache[39] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "数据缓存大小 (MB)", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { |
||||||
|
"onUpdate:modelValue": _cache[12] || (_cache[12] = $event => (($setup.settings.cacheSize) = $event)), |
||||||
|
type: "number", |
||||||
|
min: "50", |
||||||
|
max: "1000" |
||||||
|
}, null, 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelText, $setup.settings.cacheSize] |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_25, [ |
||||||
|
_cache[41] || (_cache[41] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "自动清理缓存", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_26, [ |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("input", { |
||||||
|
"onUpdate:modelValue": _cache[13] || (_cache[13] = $event => (($setup.settings.autoCleanCache) = $event)), |
||||||
|
type: "checkbox", |
||||||
|
id: "autoCleanCache" |
||||||
|
}, null, 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelCheckbox, $setup.settings.autoCleanCache] |
||||||
|
]), |
||||||
|
_cache[40] || (_cache[40] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", { |
||||||
|
for: "autoCleanCache", |
||||||
|
class: "toggle-label" |
||||||
|
}, null, -1 /* CACHED */)) |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_27, [ |
||||||
|
_cache[43] || (_cache[43] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", null, "数据备份频率", -1 /* CACHED */)), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("select", { |
||||||
|
"onUpdate:modelValue": _cache[14] || (_cache[14] = $event => (($setup.settings.backupFrequency) = $event)) |
||||||
|
}, _cache[42] || (_cache[42] = [ |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("option", { value: "daily" }, "每日", -1 /* CACHED */), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("option", { value: "weekly" }, "每周", -1 /* CACHED */), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("option", { value: "monthly" }, "每月", -1 /* CACHED */), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("option", { value: "never" }, "从不", -1 /* CACHED */) |
||||||
|
]), 512 /* NEED_PATCH */), [ |
||||||
|
[vue__WEBPACK_IMPORTED_MODULE_0__.vModelSelect, $setup.settings.backupFrequency] |
||||||
|
]) |
||||||
|
]) |
||||||
|
]), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" 操作按钮 "), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_28, [ |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", { |
||||||
|
class: "btn btn-secondary", |
||||||
|
onClick: _cache[15] || (_cache[15] = (...args) => ($setup.resetSettings && $setup.resetSettings(...args))) |
||||||
|
}, " 重置设置 "), |
||||||
|
(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", { |
||||||
|
class: "btn btn-primary", |
||||||
|
onClick: _cache[16] || (_cache[16] = (...args) => ($setup.saveSettings && $setup.saveSettings(...args))) |
||||||
|
}, " 保存设置 ") |
||||||
|
]) |
||||||
|
]) |
||||||
|
])) |
||||||
|
} |
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./node_modules/vue-style-loader/index.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css": |
||||||
|
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ |
||||||
|
!*** ./node_modules/vue-style-loader/index.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css ***! |
||||||
|
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ |
||||||
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
||||||
|
|
||||||
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
||||||
|
|
||||||
|
// load the styles
|
||||||
|
var content = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css"); |
||||||
|
if(content.__esModule) content = content.default; |
||||||
|
if(typeof content === 'string') content = [[module.id, content, '']]; |
||||||
|
if(content.locals) module.exports = content.locals; |
||||||
|
// add the styles to the DOM
|
||||||
|
var add = (__webpack_require__(/*! !../../../node_modules/vue-style-loader/lib/addStylesClient.js */ "./node_modules/vue-style-loader/lib/addStylesClient.js")["default"]) |
||||||
|
var update = add("57cdd173", content, false, {"sourceMap":false,"shadowMode":false}); |
||||||
|
// Hot Module Replacement
|
||||||
|
if(true) { |
||||||
|
// When the styles change, update the <style> tags
|
||||||
|
if(!content.locals) { |
||||||
|
module.hot.accept(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css", function() { |
||||||
|
var newContent = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css"); |
||||||
|
if(newContent.__esModule) newContent = newContent.default; |
||||||
|
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; |
||||||
|
update(newContent); |
||||||
|
}); |
||||||
|
} |
||||||
|
// When the module is disposed, remove the <style> tags
|
||||||
|
module.hot.dispose(function() { update(); }); |
||||||
|
} |
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./src/renderer/views/Settings.vue": |
||||||
|
/*!*****************************************!*\ |
||||||
|
!*** ./src/renderer/views/Settings.vue ***! |
||||||
|
\*****************************************/ |
||||||
|
/***/ ((module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
||||||
|
/* harmony export */ }); |
||||||
|
/* harmony import */ var _Settings_vue_vue_type_template_id_a5c10072_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Settings.vue?vue&type=template&id=a5c10072&scoped=true */ "./src/renderer/views/Settings.vue?vue&type=template&id=a5c10072&scoped=true"); |
||||||
|
/* harmony import */ var _Settings_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Settings.vue?vue&type=script&lang=js */ "./src/renderer/views/Settings.vue?vue&type=script&lang=js"); |
||||||
|
/* harmony import */ var _Settings_vue_vue_type_style_index_0_id_a5c10072_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css */ "./src/renderer/views/Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css"); |
||||||
|
/* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; |
||||||
|
|
||||||
|
|
||||||
|
const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_Settings_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Settings_vue_vue_type_template_id_a5c10072_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-a5c10072"],['__file',"src/renderer/views/Settings.vue"]]) |
||||||
|
/* hot reload */ |
||||||
|
if (true) { |
||||||
|
__exports__.__hmrId = "a5c10072" |
||||||
|
const api = __VUE_HMR_RUNTIME__ |
||||||
|
module.hot.accept() |
||||||
|
if (!api.createRecord('a5c10072', __exports__)) { |
||||||
|
api.reload('a5c10072', __exports__) |
||||||
|
} |
||||||
|
|
||||||
|
module.hot.accept(/*! ./Settings.vue?vue&type=template&id=a5c10072&scoped=true */ "./src/renderer/views/Settings.vue?vue&type=template&id=a5c10072&scoped=true", __WEBPACK_OUTDATED_DEPENDENCIES__ => { /* harmony import */ _Settings_vue_vue_type_template_id_a5c10072_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Settings.vue?vue&type=template&id=a5c10072&scoped=true */ "./src/renderer/views/Settings.vue?vue&type=template&id=a5c10072&scoped=true"); |
||||||
|
return (() => { |
||||||
|
api.rerender('a5c10072', _Settings_vue_vue_type_template_id_a5c10072_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render) |
||||||
|
})(__WEBPACK_OUTDATED_DEPENDENCIES__); }) |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); |
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./src/renderer/views/Settings.vue?vue&type=script&lang=js": |
||||||
|
/*!*****************************************************************!*\ |
||||||
|
!*** ./src/renderer/views/Settings.vue?vue&type=script&lang=js ***! |
||||||
|
\*****************************************************************/ |
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
||||||
|
/* harmony export */ "default": () => (/* reexport safe */ _node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Settings_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]) |
||||||
|
/* harmony export */ }); |
||||||
|
/* harmony import */ var _node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Settings_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Settings.vue?vue&type=script&lang=js */ "./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=script&lang=js"); |
||||||
|
|
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./src/renderer/views/Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css": |
||||||
|
/*!*************************************************************************************************!*\ |
||||||
|
!*** ./src/renderer/views/Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css ***! |
||||||
|
\*************************************************************************************************/ |
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony import */ var _node_modules_vue_style_loader_index_js_clonedRuleSet_12_use_0_node_modules_css_loader_dist_cjs_js_clonedRuleSet_12_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_12_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Settings_vue_vue_type_style_index_0_id_a5c10072_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-style-loader/index.js??clonedRuleSet-12.use[0]!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css */ "./node_modules/vue-style-loader/index.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=style&index=0&id=a5c10072&scoped=true&lang=css"); |
||||||
|
/* harmony import */ var _node_modules_vue_style_loader_index_js_clonedRuleSet_12_use_0_node_modules_css_loader_dist_cjs_js_clonedRuleSet_12_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_12_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Settings_vue_vue_type_style_index_0_id_a5c10072_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_clonedRuleSet_12_use_0_node_modules_css_loader_dist_cjs_js_clonedRuleSet_12_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_12_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Settings_vue_vue_type_style_index_0_id_a5c10072_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__); |
||||||
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; |
||||||
|
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_clonedRuleSet_12_use_0_node_modules_css_loader_dist_cjs_js_clonedRuleSet_12_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_12_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Settings_vue_vue_type_style_index_0_id_a5c10072_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _node_modules_vue_style_loader_index_js_clonedRuleSet_12_use_0_node_modules_css_loader_dist_cjs_js_clonedRuleSet_12_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_12_use_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Settings_vue_vue_type_style_index_0_id_a5c10072_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] |
||||||
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); |
||||||
|
|
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./src/renderer/views/Settings.vue?vue&type=template&id=a5c10072&scoped=true": |
||||||
|
/*!***********************************************************************************!*\ |
||||||
|
!*** ./src/renderer/views/Settings.vue?vue&type=template&id=a5c10072&scoped=true ***! |
||||||
|
\***********************************************************************************/ |
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, { |
||||||
|
/* harmony export */ render: () => (/* reexport safe */ _node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Settings_vue_vue_type_template_id_a5c10072_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render) |
||||||
|
/* harmony export */ }); |
||||||
|
/* harmony import */ var _node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Settings_vue_vue_type_template_id_a5c10072_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Settings.vue?vue&type=template&id=a5c10072&scoped=true */ "./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/renderer/views/Settings.vue?vue&type=template&id=a5c10072&scoped=true"); |
||||||
|
|
||||||
|
|
||||||
|
/***/ }) |
||||||
|
|
||||||
|
}]); |
@ -0,0 +1,62 @@ |
|||||||
|
/* 中文字体配置文件 */ |
||||||
|
|
||||||
|
/* 定义字体族变量 */ |
||||||
|
:root { |
||||||
|
--font-family-chinese: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'WenQuanYi Micro Hei', 'SimHei', 'SimSun', Avenir, Helvetica, Arial, sans-serif; |
||||||
|
--font-family-english: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; |
||||||
|
} |
||||||
|
|
||||||
|
/* 全局字体设置 */ |
||||||
|
* { |
||||||
|
font-family: var(--font-family-chinese), var(--font-family-english); |
||||||
|
} |
||||||
|
|
||||||
|
/* 确保所有文本元素都使用中文字体 */ |
||||||
|
body, html, #app { |
||||||
|
font-family: var(--font-family-chinese), var(--font-family-english); |
||||||
|
} |
||||||
|
|
||||||
|
/* 特定组件的字体设置 */ |
||||||
|
.main-layout, |
||||||
|
.status-bar, |
||||||
|
.home, |
||||||
|
.user-management, |
||||||
|
.settings { |
||||||
|
font-family: var(--font-family-chinese), var(--font-family-english); |
||||||
|
} |
||||||
|
|
||||||
|
/* 标题和重要文本的字体设置 */ |
||||||
|
h1, h2, h3, h4, h5, h6 { |
||||||
|
font-family: var(--font-family-chinese), var(--font-family-english); |
||||||
|
font-weight: 500; |
||||||
|
} |
||||||
|
|
||||||
|
/* 按钮和输入框的字体设置 */ |
||||||
|
button, input, select, textarea { |
||||||
|
font-family: var(--font-family-chinese), var(--font-family-english); |
||||||
|
} |
||||||
|
|
||||||
|
/* 表格内容的字体设置 */ |
||||||
|
table, th, td { |
||||||
|
font-family: var(--font-family-chinese), var(--font-family-english); |
||||||
|
} |
||||||
|
|
||||||
|
/* 状态栏文本的字体设置 */ |
||||||
|
.status-item { |
||||||
|
font-family: var(--font-family-chinese), var(--font-family-english); |
||||||
|
} |
||||||
|
|
||||||
|
/* 响应式字体大小 */ |
||||||
|
@media (max-width: 768px) { |
||||||
|
:root { |
||||||
|
--font-size-base: 14px; |
||||||
|
--font-size-small: 12px; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@media (min-width: 769px) { |
||||||
|
:root { |
||||||
|
--font-size-base: 16px; |
||||||
|
--font-size-small: 14px; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,196 @@ |
|||||||
|
import axios from 'axios' |
||||||
|
|
||||||
|
// 配置axios基础URL
|
||||||
|
const API_BASE_URL = 'http://localhost:8080/api' |
||||||
|
|
||||||
|
// 创建axios实例
|
||||||
|
const api = axios.create({ |
||||||
|
baseURL: API_BASE_URL, |
||||||
|
timeout: 10000, |
||||||
|
headers: { |
||||||
|
'Content-Type': 'application/json' |
||||||
|
} |
||||||
|
}) |
||||||
|
|
||||||
|
// 请求拦截器
|
||||||
|
api.interceptors.request.use( |
||||||
|
config => { |
||||||
|
// 可以在这里添加token等认证信息
|
||||||
|
const token = localStorage.getItem('token') |
||||||
|
if (token) { |
||||||
|
config.headers.Authorization = `Bearer ${token}` |
||||||
|
} |
||||||
|
return config |
||||||
|
}, |
||||||
|
error => { |
||||||
|
return Promise.reject(error) |
||||||
|
} |
||||||
|
) |
||||||
|
|
||||||
|
// 响应拦截器
|
||||||
|
api.interceptors.response.use( |
||||||
|
response => { |
||||||
|
return response.data |
||||||
|
}, |
||||||
|
error => { |
||||||
|
console.error('API请求错误:', error) |
||||||
|
if (error.response) { |
||||||
|
// 服务器返回错误状态码
|
||||||
|
const { status, data } = error.response |
||||||
|
switch (status) { |
||||||
|
case 400: |
||||||
|
throw new Error(data.error || '请求参数错误') |
||||||
|
case 401: |
||||||
|
throw new Error('未授权,请重新登录') |
||||||
|
case 403: |
||||||
|
throw new Error('权限不足') |
||||||
|
case 404: |
||||||
|
throw new Error('请求的资源不存在') |
||||||
|
case 500: |
||||||
|
throw new Error(data.error || '服务器内部错误') |
||||||
|
default: |
||||||
|
throw new Error(data.error || `请求失败 (${status})`) |
||||||
|
} |
||||||
|
} else if (error.request) { |
||||||
|
// 请求已发出但没有收到响应
|
||||||
|
throw new Error('网络连接失败,请检查网络设置') |
||||||
|
} else { |
||||||
|
// 其他错误
|
||||||
|
throw new Error(error.message || '请求失败') |
||||||
|
} |
||||||
|
} |
||||||
|
) |
||||||
|
|
||||||
|
export const userService = { |
||||||
|
// 获取用户列表
|
||||||
|
async getUsers(page = 1, pageSize = 10) { |
||||||
|
try { |
||||||
|
const response = await api.get('/users', { |
||||||
|
params: { page, pageSize } |
||||||
|
}) |
||||||
|
return response |
||||||
|
} catch (error) { |
||||||
|
throw error |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
// 获取单个用户
|
||||||
|
async getUser(id) { |
||||||
|
try { |
||||||
|
const response = await api.get(`/users/${id}`) |
||||||
|
return response |
||||||
|
} catch (error) { |
||||||
|
throw error |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
// 创建用户
|
||||||
|
async createUser(userData) { |
||||||
|
try { |
||||||
|
const response = await api.post('/users', userData) |
||||||
|
return response |
||||||
|
} catch (error) { |
||||||
|
throw error |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
// 更新用户
|
||||||
|
async updateUser(id, userData) { |
||||||
|
try { |
||||||
|
const response = await api.put(`/users/${id}`, userData) |
||||||
|
return response |
||||||
|
} catch (error) { |
||||||
|
throw error |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
// 删除用户
|
||||||
|
async deleteUser(id) { |
||||||
|
try { |
||||||
|
await api.delete(`/users/${id}`) |
||||||
|
return true |
||||||
|
} catch (error) { |
||||||
|
throw error |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
// 获取角色列表
|
||||||
|
async getRoles() { |
||||||
|
try { |
||||||
|
const response = await api.get('/roles') |
||||||
|
return response |
||||||
|
} catch (error) { |
||||||
|
throw error |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
// 获取权限列表
|
||||||
|
async getPermissions() { |
||||||
|
try { |
||||||
|
const response = await api.get('/permissions') |
||||||
|
return response |
||||||
|
} catch (error) { |
||||||
|
throw error |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
// 用户登录
|
||||||
|
async login(credentials) { |
||||||
|
try { |
||||||
|
const response = await api.post('/auth/login', credentials) |
||||||
|
// 保存token到localStorage
|
||||||
|
if (response.token) { |
||||||
|
localStorage.setItem('token', response.token) |
||||||
|
localStorage.setItem('user', JSON.stringify(response.user)) |
||||||
|
} |
||||||
|
return response |
||||||
|
} catch (error) { |
||||||
|
throw error |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
// 用户登出
|
||||||
|
async logout() { |
||||||
|
try { |
||||||
|
await api.post('/auth/logout') |
||||||
|
// 清除本地存储的认证信息
|
||||||
|
localStorage.removeItem('token') |
||||||
|
localStorage.removeItem('user') |
||||||
|
return true |
||||||
|
} catch (error) { |
||||||
|
throw error |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
// 获取当前用户信息
|
||||||
|
async getCurrentUser() { |
||||||
|
try { |
||||||
|
const response = await api.get('/auth/me') |
||||||
|
return response |
||||||
|
} catch (error) { |
||||||
|
throw error |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
// 修改密码
|
||||||
|
async changePassword(passwordData) { |
||||||
|
try { |
||||||
|
const response = await api.post('/auth/change-password', passwordData) |
||||||
|
return response |
||||||
|
} catch (error) { |
||||||
|
throw error |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
// 重置密码
|
||||||
|
async resetPassword(email) { |
||||||
|
try { |
||||||
|
const response = await api.post('/auth/reset-password', { email }) |
||||||
|
return response |
||||||
|
} catch (error) { |
||||||
|
throw error |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
export default userService |
@ -0,0 +1,399 @@ |
|||||||
|
<template> |
||||||
|
<div class="settings"> |
||||||
|
<div class="page-header"> |
||||||
|
<h2>系统设置</h2> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="settings-content"> |
||||||
|
<!-- 基本设置 --> |
||||||
|
<div class="settings-section"> |
||||||
|
<h3>基本设置</h3> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>应用名称</label> |
||||||
|
<input v-model="settings.appName" type="text" placeholder="GoFaster" /> |
||||||
|
</div> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>语言</label> |
||||||
|
<select v-model="settings.language"> |
||||||
|
<option value="zh-CN">简体中文</option> |
||||||
|
<option value="en-US">English</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>主题</label> |
||||||
|
<select v-model="settings.theme"> |
||||||
|
<option value="light">浅色主题</option> |
||||||
|
<option value="dark">深色主题</option> |
||||||
|
<option value="auto">跟随系统</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- 网络设置 --> |
||||||
|
<div class="settings-section"> |
||||||
|
<h3>网络设置</h3> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>API服务器地址</label> |
||||||
|
<input v-model="settings.apiUrl" type="text" placeholder="http://localhost:8080" /> |
||||||
|
</div> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>请求超时时间 (秒)</label> |
||||||
|
<input v-model="settings.timeout" type="number" min="5" max="60" /> |
||||||
|
</div> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>自动重试次数</label> |
||||||
|
<input v-model="settings.retryCount" type="number" min="0" max="5" /> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- 用户设置 --> |
||||||
|
<div class="settings-section"> |
||||||
|
<h3>用户设置</h3> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>自动登录</label> |
||||||
|
<div class="toggle-switch"> |
||||||
|
<input |
||||||
|
v-model="settings.autoLogin" |
||||||
|
type="checkbox" |
||||||
|
id="autoLogin" |
||||||
|
/> |
||||||
|
<label for="autoLogin" class="toggle-label"></label> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>记住密码</label> |
||||||
|
<div class="toggle-switch"> |
||||||
|
<input |
||||||
|
v-model="settings.rememberPassword" |
||||||
|
type="checkbox" |
||||||
|
id="rememberPassword" |
||||||
|
/> |
||||||
|
<label for="rememberPassword" class="toggle-label"></label> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>会话超时时间 (分钟)</label> |
||||||
|
<input v-model="settings.sessionTimeout" type="number" min="15" max="1440" /> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- 通知设置 --> |
||||||
|
<div class="settings-section"> |
||||||
|
<h3>通知设置</h3> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>桌面通知</label> |
||||||
|
<div class="toggle-switch"> |
||||||
|
<input |
||||||
|
v-model="settings.desktopNotifications" |
||||||
|
type="checkbox" |
||||||
|
id="desktopNotifications" |
||||||
|
/> |
||||||
|
<label for="desktopNotifications" class="toggle-label"></label> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>声音提醒</label> |
||||||
|
<div class="toggle-switch"> |
||||||
|
<input |
||||||
|
v-model="settings.soundNotifications" |
||||||
|
type="checkbox" |
||||||
|
id="soundNotifications" |
||||||
|
/> |
||||||
|
<label for="soundNotifications" class="toggle-label"></label> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>消息提醒间隔 (秒)</label> |
||||||
|
<input v-model="settings.notificationInterval" type="number" min="5" max="300" /> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- 数据设置 --> |
||||||
|
<div class="settings-section"> |
||||||
|
<h3>数据设置</h3> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>数据缓存大小 (MB)</label> |
||||||
|
<input v-model="settings.cacheSize" type="number" min="50" max="1000" /> |
||||||
|
</div> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>自动清理缓存</label> |
||||||
|
<div class="toggle-switch"> |
||||||
|
<input |
||||||
|
v-model="settings.autoCleanCache" |
||||||
|
type="checkbox" |
||||||
|
id="autoCleanCache" |
||||||
|
/> |
||||||
|
<label for="autoCleanCache" class="toggle-label"></label> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="setting-item"> |
||||||
|
<label>数据备份频率</label> |
||||||
|
<select v-model="settings.backupFrequency"> |
||||||
|
<option value="daily">每日</option> |
||||||
|
<option value="weekly">每周</option> |
||||||
|
<option value="monthly">每月</option> |
||||||
|
<option value="never">从不</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- 操作按钮 --> |
||||||
|
<div class="settings-actions"> |
||||||
|
<button class="btn btn-secondary" @click="resetSettings"> |
||||||
|
重置设置 |
||||||
|
</button> |
||||||
|
<button class="btn btn-primary" @click="saveSettings"> |
||||||
|
保存设置 |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import { ref, reactive, onMounted } from 'vue' |
||||||
|
|
||||||
|
export default { |
||||||
|
name: 'Settings', |
||||||
|
setup() { |
||||||
|
const settings = reactive({ |
||||||
|
// 基本设置 |
||||||
|
appName: 'GoFaster', |
||||||
|
language: 'zh-CN', |
||||||
|
theme: 'light', |
||||||
|
|
||||||
|
// 网络设置 |
||||||
|
apiUrl: 'http://localhost:8080', |
||||||
|
timeout: 10, |
||||||
|
retryCount: 3, |
||||||
|
|
||||||
|
// 用户设置 |
||||||
|
autoLogin: false, |
||||||
|
rememberPassword: false, |
||||||
|
sessionTimeout: 30, |
||||||
|
|
||||||
|
// 通知设置 |
||||||
|
desktopNotifications: true, |
||||||
|
soundNotifications: true, |
||||||
|
notificationInterval: 10, |
||||||
|
|
||||||
|
// 数据设置 |
||||||
|
cacheSize: 100, |
||||||
|
autoCleanCache: true, |
||||||
|
backupFrequency: 'weekly' |
||||||
|
}) |
||||||
|
|
||||||
|
const loadSettings = () => { |
||||||
|
const savedSettings = localStorage.getItem('gofaster-settings') |
||||||
|
if (savedSettings) { |
||||||
|
Object.assign(settings, JSON.parse(savedSettings)) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
const saveSettings = () => { |
||||||
|
try { |
||||||
|
localStorage.setItem('gofaster-settings', JSON.stringify(settings)) |
||||||
|
// 这里可以添加保存成功的提示 |
||||||
|
console.log('设置已保存') |
||||||
|
} catch (error) { |
||||||
|
console.error('保存设置失败:', error) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
const resetSettings = () => { |
||||||
|
if (confirm('确定要重置所有设置吗?此操作不可撤销。')) { |
||||||
|
localStorage.removeItem('gofaster-settings') |
||||||
|
location.reload() |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
onMounted(() => { |
||||||
|
loadSettings() |
||||||
|
}) |
||||||
|
|
||||||
|
return { |
||||||
|
settings, |
||||||
|
saveSettings, |
||||||
|
resetSettings |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style scoped> |
||||||
|
.settings { |
||||||
|
padding: 20px; |
||||||
|
height: 100%; |
||||||
|
overflow-y: auto; |
||||||
|
} |
||||||
|
|
||||||
|
.page-header { |
||||||
|
margin-bottom: 30px; |
||||||
|
} |
||||||
|
|
||||||
|
.page-header h2 { |
||||||
|
margin: 0; |
||||||
|
color: #333; |
||||||
|
font-size: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.settings-content { |
||||||
|
max-width: 800px; |
||||||
|
} |
||||||
|
|
||||||
|
.settings-section { |
||||||
|
background: white; |
||||||
|
border-radius: 8px; |
||||||
|
padding: 24px; |
||||||
|
margin-bottom: 24px; |
||||||
|
box-shadow: 0 2px 8px rgba(0,0,0,0.1); |
||||||
|
} |
||||||
|
|
||||||
|
.settings-section h3 { |
||||||
|
margin: 0 0 20px 0; |
||||||
|
color: #333; |
||||||
|
font-size: 18px; |
||||||
|
border-bottom: 2px solid #e0e0e0; |
||||||
|
padding-bottom: 8px; |
||||||
|
} |
||||||
|
|
||||||
|
.setting-item { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: space-between; |
||||||
|
margin-bottom: 20px; |
||||||
|
padding: 16px 0; |
||||||
|
border-bottom: 1px solid #f5f5f5; |
||||||
|
} |
||||||
|
|
||||||
|
.setting-item:last-child { |
||||||
|
border-bottom: none; |
||||||
|
margin-bottom: 0; |
||||||
|
} |
||||||
|
|
||||||
|
.setting-item label { |
||||||
|
font-weight: 500; |
||||||
|
color: #333; |
||||||
|
min-width: 200px; |
||||||
|
} |
||||||
|
|
||||||
|
.setting-item input[type="text"], |
||||||
|
.setting-item input[type="number"], |
||||||
|
.setting-item select { |
||||||
|
padding: 8px 12px; |
||||||
|
border: 1px solid #ddd; |
||||||
|
border-radius: 4px; |
||||||
|
font-size: 14px; |
||||||
|
min-width: 200px; |
||||||
|
} |
||||||
|
|
||||||
|
.setting-item input[type="text"]:focus, |
||||||
|
.setting-item input[type="number"]:focus, |
||||||
|
.setting-item select:focus { |
||||||
|
outline: none; |
||||||
|
border-color: #1976d2; |
||||||
|
box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2); |
||||||
|
} |
||||||
|
|
||||||
|
/* 开关样式 */ |
||||||
|
.toggle-switch { |
||||||
|
position: relative; |
||||||
|
display: inline-block; |
||||||
|
} |
||||||
|
|
||||||
|
.toggle-switch input[type="checkbox"] { |
||||||
|
opacity: 0; |
||||||
|
width: 0; |
||||||
|
height: 0; |
||||||
|
} |
||||||
|
|
||||||
|
.toggle-label { |
||||||
|
display: block; |
||||||
|
width: 50px; |
||||||
|
height: 24px; |
||||||
|
background: #ccc; |
||||||
|
border-radius: 12px; |
||||||
|
cursor: pointer; |
||||||
|
position: relative; |
||||||
|
transition: background-color 0.3s; |
||||||
|
} |
||||||
|
|
||||||
|
.toggle-label:before { |
||||||
|
content: ''; |
||||||
|
position: absolute; |
||||||
|
width: 20px; |
||||||
|
height: 20px; |
||||||
|
border-radius: 50%; |
||||||
|
background: white; |
||||||
|
top: 2px; |
||||||
|
left: 2px; |
||||||
|
transition: transform 0.3s; |
||||||
|
} |
||||||
|
|
||||||
|
.toggle-switch input[type="checkbox"]:checked + .toggle-label { |
||||||
|
background: #1976d2; |
||||||
|
} |
||||||
|
|
||||||
|
.toggle-switch input[type="checkbox"]:checked + .toggle-label:before { |
||||||
|
transform: translateX(26px); |
||||||
|
} |
||||||
|
|
||||||
|
/* 操作按钮 */ |
||||||
|
.settings-actions { |
||||||
|
display: flex; |
||||||
|
gap: 16px; |
||||||
|
justify-content: flex-end; |
||||||
|
margin-top: 30px; |
||||||
|
} |
||||||
|
|
||||||
|
.btn { |
||||||
|
padding: 12px 24px; |
||||||
|
border: none; |
||||||
|
border-radius: 6px; |
||||||
|
cursor: pointer; |
||||||
|
font-size: 14px; |
||||||
|
font-weight: 500; |
||||||
|
transition: all 0.2s; |
||||||
|
} |
||||||
|
|
||||||
|
.btn-primary { |
||||||
|
background: #1976d2; |
||||||
|
color: white; |
||||||
|
} |
||||||
|
|
||||||
|
.btn-primary:hover { |
||||||
|
background: #1565c0; |
||||||
|
} |
||||||
|
|
||||||
|
.btn-secondary { |
||||||
|
background: #757575; |
||||||
|
color: white; |
||||||
|
} |
||||||
|
|
||||||
|
.btn-secondary:hover { |
||||||
|
background: #616161; |
||||||
|
} |
||||||
|
|
||||||
|
/* 响应式设计 */ |
||||||
|
@media (max-width: 768px) { |
||||||
|
.setting-item { |
||||||
|
flex-direction: column; |
||||||
|
align-items: flex-start; |
||||||
|
gap: 12px; |
||||||
|
} |
||||||
|
|
||||||
|
.setting-item label { |
||||||
|
min-width: auto; |
||||||
|
} |
||||||
|
|
||||||
|
.setting-item input[type="text"], |
||||||
|
.setting-item input[type="number"], |
||||||
|
.setting-item select { |
||||||
|
min-width: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
.settings-actions { |
||||||
|
flex-direction: column; |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
Loading…
Reference in new issue