新增下载模式选择;新增下载前查看预览图;去除链接伪装;优化下载完成逻辑判断;仅允许下载里站链接(同步更新)
This commit is contained in:
parent
746837659d
commit
85b8a8c2a3
@ -47,12 +47,15 @@
|
||||
</span><br>
|
||||
<picture>
|
||||
<el-image :src="thumbnailGallery.url" :preview-src-list="[thumbnailGallery.images[0], ]" :initial-index="0" class="preview"
|
||||
style="width: 300px; height: 300px" fit="contain"/>
|
||||
style="width: 300px; height: 250px" fit="contain"/>
|
||||
</picture>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="查询本子" v-model="chosenGallery">
|
||||
<el-image v-show='chosenGallery.thumb_link !== undefined'
|
||||
style="float: right; width: 250px; height: 250px" fit="contain"
|
||||
:src="'https://downloader.lionwebsite.xyz/GalleryManage/ehThumbnail?path=' + chosenGallery.thumb_link"/>
|
||||
<table>
|
||||
<tr>本子名字:{{chosenGallery.name}}</tr>
|
||||
<tr>本子页数:{{chosenGallery.pages}}</tr>
|
||||
@ -67,9 +70,16 @@
|
||||
</el-select>
|
||||
</tr>
|
||||
<tr v-if="chosenGallery.availableResolution">
|
||||
下载模式:<el-select v-model="targetDownloadMode" style="width: 200px" default-first-option>
|
||||
<el-option :value="1" label="仅下载"/>
|
||||
<el-option :value="2" label="仅在线看"/>
|
||||
<el-option :value="3" label="在线看并下载"/>
|
||||
</el-select>
|
||||
</tr>
|
||||
<tr>
|
||||
标签:<el-tag v-for="tid in paramForTags" closable @close="removeQueryTag(tid)">
|
||||
{{store.state.tags.get(tid).tag}}
|
||||
</el-tag>
|
||||
{{store.state.tags.get(tid).tag}}
|
||||
</el-tag>
|
||||
<el-autocomplete v-model="param" :fetch-suggestions="completeQueryTag" @select="handleTagSelect" ref="tagInputForSubmit"/>
|
||||
</tr>
|
||||
</table>
|
||||
@ -194,6 +204,7 @@ let param = ref("")
|
||||
let paramForTags = ref([]) //tidS
|
||||
|
||||
let targetResolution = ref("")
|
||||
let targetDownloadMode = ref("")
|
||||
let tag = ref("")
|
||||
let tagKeyWord = ref("") //查询tag的关键字
|
||||
|
||||
@ -278,10 +289,14 @@ function postTask(){
|
||||
ElMessage("请选择分辨率再提交")
|
||||
return
|
||||
}
|
||||
let tempLink = coverLink(chosenGallery.value.link)
|
||||
if(targetDownloadMode.value === ''){
|
||||
ElMessage("请选择下载模式再提交")
|
||||
return
|
||||
}
|
||||
store.dispatch("postGalleryTask",
|
||||
{link: tempLink,
|
||||
{link: chosenGallery.value.link,
|
||||
targetResolution: targetResolution.value,
|
||||
mode: targetDownloadMode.value,
|
||||
tags:paramForTags.value})
|
||||
targetResolution.value = ""
|
||||
}
|
||||
@ -292,8 +307,9 @@ function queryRemoteTask(){
|
||||
ElMessage("链接错误")
|
||||
return
|
||||
}
|
||||
let tempLink = coverLink(param.value)
|
||||
store.dispatch("queryGalleryTask", tempLink)
|
||||
if(param.value.includes("e-hentai"))
|
||||
param.value = param.value.replace("e-hentai", "exhentai")
|
||||
store.dispatch("queryGalleryTask", param.value)
|
||||
}
|
||||
function queryLocalTask(){
|
||||
switch (type.value){
|
||||
@ -417,9 +433,6 @@ function validateLink(rawLink){
|
||||
else
|
||||
return false
|
||||
}
|
||||
function coverLink(rawLink){
|
||||
return rawLink.replace("exhentai.org", "element-plus.org").replace("e-hentai.org", "element.org");
|
||||
}
|
||||
|
||||
//在线阅读以及展示缩略图
|
||||
function onlineGalleryReader(gid){
|
||||
|
||||
@ -56,8 +56,7 @@ function queryRemoteTask(){
|
||||
ElMessage("链接错误")
|
||||
return
|
||||
}
|
||||
let tempLink = coverLink(param.value)
|
||||
store.dispatch("queryGalleryTask", tempLink)
|
||||
store.dispatch("queryGalleryTask", param.value)
|
||||
}
|
||||
|
||||
function validateLink(rawLink){
|
||||
@ -69,10 +68,6 @@ function validateLink(rawLink){
|
||||
return false
|
||||
}
|
||||
|
||||
function coverLink(rawLink){
|
||||
return rawLink.replace("exhentai.org", "element-plus.org").replace("e-hentai.org", "element.org");
|
||||
}
|
||||
|
||||
function close(){
|
||||
emit("close")
|
||||
}
|
||||
@ -85,8 +80,8 @@ function close(){
|
||||
</div>
|
||||
<el-scrollbar height="75vh" ref="scrollBar">
|
||||
<div style="height: 251px; width: 100%; " v-for="gallery in galleries">
|
||||
<el-image alt="picture" :preview-src-list="['https://downloader.lionwebsite.xyz/GalleryManage/ehThumbnail?path=' + gallery.thumbnailUrl.replace('/t', ''),]"
|
||||
:src="'https://downloader.lionwebsite.xyz/GalleryManage/ehThumbnail?path=' + gallery.thumbnailUrl.replace('/t', '') "
|
||||
<el-image alt="picture" :preview-src-list="['https://downloader.lionwebsite.xyz/GalleryManage/ehThumbnail?path=' + gallery.thumbnailUrl,]"
|
||||
:src="'https://downloader.lionwebsite.xyz/GalleryManage/ehThumbnail?path=' + gallery.thumbnailUrl"
|
||||
style="height:250px;width:250px;float: left;"
|
||||
fit="contain"
|
||||
loading="lazy"
|
||||
@ -97,7 +92,7 @@ function close(){
|
||||
<span>页数:{{gallery.page}}</span><br>
|
||||
<span class="ct6">类型:{{gallery.type}}</span><br>
|
||||
<a :href="gallery.link">链接</a><br>
|
||||
<el-button style=" margin-left: 80%; margin-top: -5vh" @click="param=gallery.link; queryRemoteTask()">下载</el-button>
|
||||
<el-button style=" margin-left: 80%; margin-top: -5vh" @click="param=gallery.link; queryRemoteTask()">查看</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
|
||||
@ -23,10 +23,10 @@
|
||||
downloader:{{props.row.downloader}}
|
||||
</span>
|
||||
|
||||
<el-button @click="deleteGallery(props.row.gid)" :disabled="props.row.download === undefined">删除</el-button>
|
||||
<el-button @click="deleteGallery(props.row.gid)" :disabled="props.row.status !== '下载完成'">删除</el-button>
|
||||
<el-button @click="editGalleryTag(props.row)">编辑标签</el-button>
|
||||
<el-button @click="updateGallery(props.row.link)" :disabled="props.row.download === undefined">更新</el-button>
|
||||
<el-button @click="shareGallery({gid:props.row.gid, shortName:props.row.shortName + '.zip'})" v-show="isLion">分享</el-button>
|
||||
<el-button @click="updateGallery(props.row.link)" :disabled="props.row.status !== '下载完成'">更新</el-button>
|
||||
<el-button @click="shareGallery({gid:props.row.gid, shortName:props.row.shortName + '.zip'})" v-show="isLion" :disabled="props.row.status !== '下载完成'">分享</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -39,9 +39,9 @@
|
||||
<el-table-column label="操作" width="300vw">
|
||||
<template #default="scoped">
|
||||
<span>
|
||||
<el-button @click="downloadTask(scoped.row.download)" :disabled="scoped.row.download === undefined">下载</el-button>
|
||||
<el-button @click="downloadTask(scoped.row.download)" :disabled="scoped.row.status !== '下载完成' || scoped.row.mode === 2">下载</el-button>
|
||||
<el-button @click="changeGalleryCollect(scoped.row.gid, scoped.row.isCollect)">{{scoped.row.isCollect ? '取消收藏' : '收藏'}}</el-button>
|
||||
<el-button @click="onlineGalleryReader(scoped.row)" :disabled="scoped.row.download === undefined">在线看</el-button>
|
||||
<el-button @click="onlineGalleryReader(scoped.row)" :disabled="scoped.row.status !== '下载完成' || scoped.row.mode === 1">在线看</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -37,9 +37,7 @@ const actions = {
|
||||
postGalleryTask(context, data){
|
||||
axios.post(GalleryManageUrl + '?' + qs.stringify({
|
||||
AuthCode: state.AuthCode,
|
||||
link: data.link,
|
||||
targetResolution: data.targetResolution,
|
||||
tags: data.tags
|
||||
...data
|
||||
}, {indices:false})).then((res) => {
|
||||
if(res.data.result === "success") {
|
||||
ElMessage("提交成功")
|
||||
@ -293,12 +291,15 @@ const mutations = {
|
||||
break;
|
||||
case "下载完成":
|
||||
task.progress = "下载完成"
|
||||
task.download = GalleryManageUrl + "/file/" + encodeURI(task.name) + ".zip?AuthCode=" + state.AuthCode + "&gid=" + task.gid
|
||||
let links = []
|
||||
for(let i=1; i<=task.pages; i++)
|
||||
links.push(GalleryManageUrl + "/onlineImage/" + i + "?gid=" + task.gid);
|
||||
if(task.mode === 1 || task.mode === 3)
|
||||
task.download = GalleryManageUrl + "/file/" + encodeURI(task.name) + ".zip?AuthCode=" + state.AuthCode + "&gid=" + task.gid
|
||||
|
||||
task.images = links
|
||||
if(task.mode === 2 || task.mode === 3) {
|
||||
let links = []
|
||||
for (let i = 1; i <= task.pages; i++)
|
||||
links.push(GalleryManageUrl + "/onlineImage/" + i + "?gid=" + task.gid);
|
||||
task.images = links
|
||||
}
|
||||
break;
|
||||
case "压缩中":
|
||||
task.progress = "压缩中"
|
||||
@ -559,8 +560,14 @@ const mutations = {
|
||||
state.length = state.defaultLength
|
||||
},
|
||||
_changeThumbnailGallery(state, gallery){
|
||||
state.thumbnailGallery = gallery
|
||||
state.thumbnailGallery.url = GalleryManageUrl + "/onlineImage/1?gid="+gallery.gid
|
||||
if(gallery.mode === 2 || gallery.mode === 3) {
|
||||
state.thumbnailGallery = gallery
|
||||
state.thumbnailGallery.url = GalleryManageUrl + "/onlineImage/1?gid=" + gallery.gid
|
||||
} else if(gallery.thumb_link !== undefined){
|
||||
state.thumbnailGallery = gallery
|
||||
state.thumbnailGallery.url = GalleryManageUrl + "/ehThumbnail?path=" + gallery.thumb_link
|
||||
state.thumbnailGallery.images = [GalleryManageUrl + "/ehThumbnail?path=" + gallery.thumb_link,]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user