From 9e4ec1d8df0a235aaaffba4512b53ccdcd4a44e6 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 8 Dec 2024 22:39:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B5=E9=9D=A2=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- index.html | 30 +- src/api/task.js | 7 + src/config/api.config.js | 2 +- src/layout/VisitorLayout.vue | 29 +- src/router/index.js | 20 +- src/views/DebugView.vue | 125 +++++++- src/views/visitor/DownloadPage.vue | 439 ++++++++++++++++++++++++++++- 8 files changed, 634 insertions(+), 20 deletions(-) diff --git a/.env.development b/.env.development index 631ed2b..06133ff 100644 --- a/.env.development +++ b/.env.development @@ -1 +1 @@ -VITE_API_BASE_URL=http://admin.gitdl.cn:50050 \ No newline at end of file +VITE_API_BASE_URL=http://api.ifileproxy.gitdl.cn \ No newline at end of file diff --git a/index.html b/index.html index af20025..edff20a 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,35 @@ - 后台管理系统 + + iFileProxy - 文件代理下载系统 + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/api/task.js b/src/api/task.js index 96a284e..037119b 100644 --- a/src/api/task.js +++ b/src/api/task.js @@ -131,5 +131,12 @@ export const TaskAPI = { */ searchTasks(params) { return request.get('/Management/SearchTasks', { params }) + }, + + /** + * 获取IP访问限制数据 + */ + getIPAccessLimitData() { + return request.get('/Management/GetIPAccessLimitData') } } \ No newline at end of file diff --git a/src/config/api.config.js b/src/config/api.config.js index 03fdfb6..4ab691e 100644 --- a/src/config/api.config.js +++ b/src/config/api.config.js @@ -1,5 +1,5 @@ export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://admin.gitdl.cn:50050' - +export const DOWNLOAD_BASE_URL = import.meta.env.VITE_DOWNLOAD_BASE_URL || 'https://gitdl.cn' export const API_ENDPOINTS = { TASK: { LIST: '/Management/GetTaskList', diff --git a/src/layout/VisitorLayout.vue b/src/layout/VisitorLayout.vue index 93aca5b..89e167e 100644 --- a/src/layout/VisitorLayout.vue +++ b/src/layout/VisitorLayout.vue @@ -9,7 +9,7 @@ \ No newline at end of file diff --git a/src/views/visitor/DownloadPage.vue b/src/views/visitor/DownloadPage.vue index 884a763..3909088 100644 --- a/src/views/visitor/DownloadPage.vue +++ b/src/views/visitor/DownloadPage.vue @@ -3,31 +3,64 @@ + + + 离线下载 + 直接下载 + + + + :disabled="loading"> + + - 提交 + 提交离线任务 +
-
+ +
{{ serverLoad.running }} @@ -40,11 +73,11 @@ @@ -54,6 +87,157 @@ type="info" :closable="false" />
+ +
+
主要功能
+ + + + +
    +
  • 离线下载任务
  • +
  • 直接流式下载
  • +
  • 支持内容缓存,节省存储
  • +
  • 断点续传支持
  • +
+
+
+ + + + +
    +
  • GitHub 文件加速
  • +
  • 超大文件代理支持
  • +
  • 通用 HTTP(S) 代理
  • +
  • Git 克隆支持
  • +
+
+
+ + + + +
    +
  • 文件哈希校验
  • +
  • 智能访问控制
  • +
  • HTTPS 加密传输
  • +
  • 设备指纹验证
  • +
+
+
+
+
+ +
+
快速上手
+ + + + +
+
+ + 在任意链接前加上 {{ DOWNLOAD_BASE_URL }} +
+
+
示例链接:
+ + + +
+
+
+
+ + + + +
+
+ + 替换 git clone 命令中的域名为 gitdl.cn +
+
+
原始命令:
+ + +
加速命令:
+ + + +
或者:
+ + + +
+
+
+
+
+
+ +
+
项目信息
+

+ 本服务完全免费,服务器配置 1Gbps 带宽。项目已开源,欢迎贡献代码: +

+ +
@@ -63,6 +247,8 @@ import { ref, onMounted, inject } from 'vue' import { ElMessage } from 'element-plus' import { getRandomTip } from '@/utils/visitorTips' import { VisitorAPI } from '@/api/visitor' +import { Download, Connection, Lock, Link, Document } from '@element-plus/icons-vue' +import { DOWNLOAD_BASE_URL } from '@/config/api.config' const loading = inject('visitorLoading') const downloadUrl = ref('') @@ -72,6 +258,7 @@ const serverLoad = ref({ }) const currentTip = ref(getRandomTip()) +const downloadType = ref('offline') // 获取服务器负载信息 const fetchServerLoad = async () => { @@ -108,6 +295,19 @@ const handleSubmit = async () => { } } +const handleStreamDownload = () => { + if (!downloadUrl.value) { + ElMessage.warning('请输入下载链接') + return + } + window.open(`${DOWNLOAD_BASE_URL}/${downloadUrl.value}`, '_blank') +} + +const copyText = (text) => { + navigator.clipboard.writeText(text) + ElMessage.success('复制成功') +} + onMounted(() => { fetchServerLoad() }) @@ -163,4 +363,229 @@ onMounted(() => { padding: 0 10px; } } + +.features { + margin: 30px 0; +} + +.features-title, +.usage-title, +.info-title { + font-size: 18px; + font-weight: 500; + margin-bottom: 20px; + color: #303133; +} + +.feature-item { + margin-bottom: 20px; +} + +.feature-header { + display: flex; + align-items: center; + gap: 8px; + font-size: 16px; + font-weight: 500; +} + +.feature-item ul { + padding-left: 20px; + margin: 0; +} + +.feature-item li { + margin: 8px 0; + color: #606266; +} + +.usage-content { + padding: 16px; +} + +.usage-content p { + margin-bottom: 12px; + color: #606266; +} + +.project-info { + margin: 30px 0; + padding: 20px; + background: #f8f9fa; + border-radius: 4px; +} + +.repo-links { + margin-top: 12px; + display: flex; + align-items: center; + gap: 12px; +} + +/* 移动端适配 */ +@media screen and (max-width: 768px) { + .feature-item { + margin-bottom: 16px; + } + + .usage-content { + padding: 12px; + } + + .features-title, + .usage-title, + .info-title { + font-size: 16px; + margin-bottom: 16px; + } +} + +.domain-highlight { + margin: 16px 0; + padding: 16px; + background: linear-gradient(135deg, #e6f7ff, #f0f5ff); + border-radius: 8px; + display: inline-flex; + flex-direction: column; + align-items: center; + gap: 12px; +} + +.domain { + font-size: 36px; + font-weight: bold; + font-family: 'Monaco', 'Courier New', monospace; + letter-spacing: 1px; + color: #333; +} + +.dl-text { + color: #f56c6c; + position: relative; + display: inline-block; + transition: all 0.3s ease; + font-weight: bold; +} + +.dl-text:hover { + transform: scale(1.1); + text-shadow: 1px 1px 2px rgba(245,108,108,0.2); +} + +.domain-meaning { + display: flex; + align-items: center; + gap: 12px; + font-size: 14px; + color: #666; +} + +.meaning-item { + display: flex; + align-items: center; + gap: 4px; + padding: 4px 8px; + background: rgba(255, 255, 255, 0.8); + border-radius: 4px; + font-family: 'Monaco', 'Courier New', monospace; + letter-spacing: 0.5px; +} + +.divider { + color: #999; + font-weight: 300; +} + +.domain-desc { + font-size: 14px; + color: #666; +} + +/* 移动端适配 */ +@media screen and (max-width: 768px) { + .domain { + font-size: 32px; + } + + .domain-meaning { + font-size: 13px; + flex-direction: column; + gap: 8px; + } + + .divider { + display: none; + } + + .domain-highlight { + margin: 12px 0; + padding: 12px; + } +} + +.usage-item { + margin-bottom: 20px; +} + +.usage-header { + display: flex; + align-items: center; + gap: 12px; +} + +.usage-desc { + color: #666; + font-size: 14px; +} + +.example-title { + display: flex; + align-items: center; + gap: 8px; + margin-bottom: 16px; + color: #303133; + font-weight: 500; +} + +.example-title code { + background: #f5f7fa; + padding: 2px 6px; + border-radius: 4px; + color: #f56c6c; + font-family: 'Monaco', 'Courier New', monospace; +} + +.example-box { + background: #f8f9fa; + padding: 16px; + border-radius: 4px; +} + +.example-label { + color: #909399; + margin-bottom: 8px; + font-size: 13px; +} + +.original-command { + margin-bottom: 16px; + opacity: 0.6; +} + +/* 移动端适配 */ +@media screen and (max-width: 768px) { + .usage-header { + flex-direction: column; + align-items: flex-start; + gap: 8px; + } + + .example-box { + padding: 12px; + } + + .usage-desc { + font-size: 13px; + } +} \ No newline at end of file