From 40fd3738f75ba174dd280cc0595af4c12c78c2a6 Mon Sep 17 00:00:00 2001 From: x1ao4 Date: Sun, 14 Sep 2025 01:36:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E6=B5=B7=E6=8A=A5=E8=A7=86=E5=9B=BE=E8=A1=A5=E5=85=A8?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8A=9F=E8=83=BD=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/css/main.css | 135 ++++++++++++++++++++++++++++++++-- app/templates/index.html | 154 +++++++++++++++++++++++++++++++++++---- 2 files changed, 271 insertions(+), 18 deletions(-) diff --git a/app/static/css/main.css b/app/static/css/main.css index 8e45ab4..b62f75e 100644 --- a/app/static/css/main.css +++ b/app/static/css/main.css @@ -1402,13 +1402,13 @@ button.close:focus, align-items: center; justify-content: center; border-radius: 6px !important; - border: 1px solid #ffc107 !important; + border: 1px solid #efb30a !important; } /* 任务列表中的警告按钮图标样式 */ .task .btn-warning .bi-exclamation-circle { font-size: 1.04rem; - color: #ffc107 !important; + color: #efb30a !important; margin-right: 0; } @@ -6538,7 +6538,7 @@ body .selectable-files tr.selected-file:has([style*="white-space: normal"]) .fil color: white; } -/* 内容管理视图刷新按钮样式 */ +/* 内容管理视图刷新元数据按钮样式 */ .discovery-refresh-metadata { position: absolute; top: 8px; @@ -6556,7 +6556,7 @@ body .selectable-files tr.selected-file:has([style*="white-space: normal"]) .fil transition: all 0.3s ease; z-index: 10; color: white; - font-size: 0.8rem; + font-size: 0.82rem; /* 使用多向阴影模拟加粗(图标为字体,font-weight不生效) */ text-shadow: 0 0 0 currentColor, @@ -7945,6 +7945,7 @@ div:has(> .collapse:not(.show)):has(+ .row.title[title^="资源搜索"]) { font-size: 0.94rem; } +/* 任务列表删除此任务按钮图标大小 */ .tasklist-delete-btn i { font-size: 0.73rem; position: relative; @@ -7953,12 +7954,19 @@ div:has(> .collapse:not(.show)):has(+ .row.title[title^="资源搜索"]) { /* 任务列表编辑元数据按钮图标大小 */ .tasklist-edit-metadata-btn i { - font-size: 0.82rem; + font-size: 0.81rem; position: relative; top: 0.5px; left: 0.5px; } +/* 任务列表编辑此任务按钮图标大小 */ +.tasklist-edit-task-btn i { + font-size: 0.69rem; + position: relative; + top: 0.5px; +} + /* 任务列表视图切换按钮的图标大小,统一为与追剧日历相同 */ .tasklist-view-toggle-btn i.bi-grid-3x3-gap { /* 切换至海报视图图标 */ color: var(--dark-text-color); @@ -7993,4 +8001,121 @@ div:has(> .collapse:not(.show)):has(+ .row.title[title^="资源搜索"]) { display: inline-block; font-size: 0.8em; /* 与任务列表相同的斜杠缩小比例 */ font-weight: 600; /* 适度加粗,与列表视觉一致 */ +} + +/* 任务列表删除按钮悬停颜色 */ +.tasklist-delete-btn:hover { + background-color: #dc3545 !important; + border-color: #dc3545 !important; + color: white !important; +} + +/* 编辑任务模态框警告信息底部边距 */ +#createTaskModal .alert-warning { + margin-bottom: 8px; +} + +/* 海报视图资源失效警告按钮样式 */ +.discovery-warning-btn { + position: relative; + top: 0; + left: 0; + width: 22px; + height: 22px; + background-color: rgba(0, 0, 0, 0.8); + border: none; + border-radius: 6px; + display: flex; + align-items: center; + justify-content: center; + color: #efb30a; + cursor: default; + opacity: 1; + z-index: 10; + /* 使用多向阴影模拟加粗(图标为字体,font-weight不生效) */ + text-shadow: + 0 0 0 currentColor, + 0 0.2px 0 currentColor, + 0 -0.2px 0 currentColor, + 0.2px 0 0 currentColor, + -0.2px 0 0 currentColor; +} + +/* 资源失效警告按钮图标样式 */ +.discovery-warning-btn i { + font-size: 0.68rem; + position: relative; + top: 0.5px; +} + +/* 任务列表Plex按钮图标样式 */ +.tasklist-plex-btn .plex-icon { + position: relative; + top: 0px; + opacity: 1 !important; + visibility: visible !important; + /* 使用与其他Plex按钮相同的尺寸设置 */ + width: 7.2px; + height: auto; + object-fit: contain; + /* 移除可能导致加粗效果的阴影 */ + text-shadow: none; + box-shadow: none; + /* 恢复简单的滤镜 */ + filter: brightness(0) invert(1); + -webkit-filter: brightness(0) invert(1); +} + +/* 任务列表AList按钮图标样式 */ +.tasklist-alist-btn .alist-icon { + position: relative; + top: -0.5px; + opacity: 1 !important; + visibility: visible !important; + /* 使用与其他AList按钮相同的尺寸设置 */ + width: 12.6px; + height: auto; + object-fit: contain; + /* 移除可能导致加粗效果的阴影 */ + text-shadow: none; + box-shadow: none; + /* 恢复简单的滤镜 */ + filter: brightness(0) invert(1); + -webkit-filter: brightness(0) invert(1); +} + +/* 海报视图Plex按钮悬停样式 */ +.tasklist-plex-btn:hover { + background-color: #EBAF00 !important; + border-color: #EBAF00 !important; + color: #fff !important; +} + +.tasklist-plex-btn:hover .plex-icon { + filter: brightness(0) invert(1) !important; + -webkit-filter: brightness(0) invert(1) !important; +} + +/* 海报视图AList按钮悬停样式 */ +.tasklist-alist-btn:hover { + background-color: #70C6BE !important; + border-color: #70C6BE !important; + color: #fff !important; +} + +.tasklist-alist-btn:hover .alist-icon { + filter: brightness(0) invert(1) !important; + -webkit-filter: brightness(0) invert(1) !important; +} + +/* 强制确保SVG图标在所有状态下都保持白色和可见 */ +.discovery-poster:hover .tasklist-plex-btn .plex-icon, +.discovery-poster:hover .tasklist-alist-btn .alist-icon, +.discovery-poster .tasklist-plex-btn .plex-icon, +.discovery-poster .tasklist-alist-btn .alist-icon { + filter: brightness(0) invert(1) !important; + -webkit-filter: brightness(0) invert(1) !important; + opacity: 1 !important; + visibility: visible !important; + display: block !important; } \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html index 73e9449..00a4b5e 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -1247,12 +1247,20 @@
-
@@ -1994,11 +2010,11 @@
- @@ -2444,7 +2460,7 @@
@@ -3151,6 +3174,8 @@ loading: false, error: null, movieData: null, // 存储当前要创建任务的影视作品数据 + isEditMode: false, // 是否为编辑模式 + editTaskIndex: null, // 编辑的任务索引 taskData: { taskname: "", shareurl: "", @@ -11372,6 +11397,9 @@ try { // 清空影视数据 this.createTask.movieData = null; + // 重置编辑模式状态 + this.createTask.isEditMode = false; + this.createTask.editTaskIndex = null; // 重置任务数据为默认值,使用 newTask 的完整结构 this.createTask.taskData = { ...this.newTask }; @@ -11399,6 +11427,39 @@ console.error('打开创建任务模态框时出错:', error); } }, + // 打开编辑任务模态框 + openEditTaskModal(taskIndex) { + try { + if (taskIndex === null || taskIndex === undefined || !this.formData.tasklist || !this.formData.tasklist[taskIndex]) { + this.showToast('任务不存在'); + return; + } + + const task = this.formData.tasklist[taskIndex]; + + // 设置编辑模式 + this.createTask.isEditMode = true; + this.createTask.editTaskIndex = taskIndex; + this.createTask.movieData = null; + this.createTask.error = null; + + // 复制任务数据到编辑表单 + this.createTask.taskData = { ...task }; + + // 确保所有必要字段都有默认值 + this.createTask.taskData.runweek = task.runweek || [1, 2, 3, 4, 5, 6, 7]; + this.createTask.taskData.addition = task.addition || {}; + this.createTask.taskData.ignore_extension = task.ignore_extension || false; + this.createTask.taskData.use_sequence_naming = task.use_sequence_naming || false; + this.createTask.taskData.use_episode_naming = task.use_episode_naming || false; + + // 打开模态框 + $('#createTaskModal').modal('show'); + } catch (error) { + console.error('打开编辑任务模态框时出错:', error); + this.showToast('打开编辑任务失败'); + } + }, // 更新任务列表的元数据(用于热更新TMDB匹配信息) async updateTasklistMetadata(delay = 0) { const updateMetadata = async () => { @@ -12008,6 +12069,9 @@ $('#createTaskModal').modal('hide'); this.createTask.movieData = null; this.createTask.error = null; + // 重置编辑模式状态 + this.createTask.isEditMode = false; + this.createTask.editTaskIndex = null; // 重置任务数据,使用 newTask 的完整结构 this.createTask.taskData = { ...this.newTask }; }, @@ -12076,6 +12140,70 @@ this.createTask.loading = false; }); }, + confirmEditTask() { + // 确认编辑任务 + if (this.createTask.loading) return; + + // 验证必填字段 + if (!this.createTask.taskData.taskname.trim()) { + this.createTask.error = '任务名称不能为空'; + return; + } + if (!this.createTask.taskData.shareurl.trim()) { + this.createTask.error = '分享链接不能为空'; + return; + } + if (!this.createTask.taskData.savepath.trim()) { + this.createTask.error = '保存路径不能为空'; + return; + } + + this.createTask.loading = true; + this.createTask.error = null; + + // 更新任务数据 + const updatedTask = { ...this.createTask.taskData }; + + // 应用全局插件配置 + this.applyGlobalPluginConfig(updatedTask); + + // 处理命名模式 + if (updatedTask.use_sequence_naming) { + updatedTask.pattern = updatedTask.sequence_naming; + } else if (updatedTask.use_episode_naming) { + updatedTask.pattern = updatedTask.episode_naming; + } + + // 更新任务列表中的任务 + if (this.createTask.editTaskIndex !== null && this.formData.tasklist && this.formData.tasklist[this.createTask.editTaskIndex]) { + this.$set(this.formData.tasklist, this.createTask.editTaskIndex, updatedTask); + } + + // 保存配置(不显示配置更新消息) + axios.post('/update', this.formData) + .then(response => { + if (response.data.success) { + this.configModified = false; + // 显示任务编辑成功消息 + this.showToast('任务编辑成功', 'success'); + // 保存成功后更新用户信息 + this.fetchUserInfo(); + // 更新任务列表元数据,确保海报视图能显示TMDB匹配信息 + this.updateTasklistMetadata(); + this.createTask.loading = false; + this.cancelCreateTask(); + } else { + // 错误信息使用alert,确保用户看到 + alert(response.data.message); + this.createTask.loading = false; + } + }) + .catch(error => { + // 错误处理 + alert("保存失败: " + (error.response?.data?.message || error.message || "未知错误")); + this.createTask.loading = false; + }); + }, confirmCreateAndRunTask() { // 确认创建并运行任务 if (this.createTask.loading) return;