web_toolset/web/html/body/nas/animrss.html

476 lines
24 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>NAS</title>
<link rel="stylesheet" href="/layui/css/layui.css">
<link rel="stylesheet" href="/css/my.css">
</head>
<body>
2020-10-21 18:05:33 +08:00
<div class="layui-layout layui-layout-admin">
<div id="header"></div>
<div class="layui-body body2">
2020-10-21 18:05:33 +08:00
<div id="side"></div>
<blockquote class="layui-elem-quote"><span>番剧订阅器</span></blockquote>
2020-10-21 18:05:33 +08:00
<button type="button" id="addType" class="layui-btn layui-btn-normal">新增分类</button>
2021-05-19 18:34:04 +08:00
<div class="layui-tab" lay-filter="animType" lay-allowclose="true">
2020-10-21 18:05:33 +08:00
<ul class="layui-tab-title">
2020-10-21 18:05:33 +08:00
</ul>
<div class="layui-tab-content">
</div>
2020-10-21 18:05:33 +08:00
</div>
<blockquote class="layui-elem-quote"><span>动漫花园RSS</span></blockquote>
2020-10-21 18:05:33 +08:00
<form class="layui-form" action="" lay-filter="formTest">
<div class="layui-form-item">
<label class="layui-form-label"><a type="text" id="search"
class="layui-btn layui-btn-normal">搜索</a></label>
<div class="layui-input-block" style="padding-top: 8px; width: 200px;">
<input type="text" name="title" id="title" required lay-verify="required" placeholder="请输入标题"
autocomplete="off" class="layui-input" style="width: 200px;">
</div>
<div class="layui-form-item">
2020-10-21 18:05:33 +08:00
<label class="layui-form-label">类型</label>
<div class="layui-input-block" style="width: 200px;">
<select name="type" lay-verify="type" id="type">
<option value="0">全部</option>
<option value="2">動畫</option>
<option value="31">季度全集</option>
<option value="3">漫畫</option>
<option value="41">港台原版</option>
<option value="42">日文原版</option>
<option value="4">音樂</option>
<option value="43">動漫音樂</option>
<option value="44">同人音樂</option>
<option value="15">流行音樂</option>
<option value="6">日劇</option>
<option value="7"></option>
<option value="9">遊戲</option>
<option value="17">電腦遊戲</option>
<option value="18">電視遊戲</option>
<option value="19">掌機遊戲</option>
<option value="20">網絡遊戲</option>
<option value="21">遊戲周邊</option>
<option value="12">特攝</option>
<option value="1">其他</option>
</select>
</div>
2020-10-21 18:05:33 +08:00
</div>
<div class="layui-form-item">
<label class="layui-form-label">字幕组</label>
<div class="layui-input-block" style="width: 200px;">
<select name="team" lay-verify="team" id='team'>
<option value="0">全部</option>
<option value="117">動漫花園</option>
<option value="669">喵萌奶茶屋</option>
<option value="648">魔星字幕团</option>
<option value="185">极影字幕社</option>
<option value="619">桜都字幕组</option>
<option value="604">c.c动漫</option>
<option value="241">幻樱字幕组</option>
<option value="151">悠哈C9字幕社</option>
<option value="657">LoliHouse</option>
<option value="283">千夏字幕组</option>
<option value="755">GMTeam</option>
<option value="390">天使动漫</option>
<option value="731">星空字幕组</option>
<option value="303">动漫国字幕组</option>
<option value="563">花園壓制組</option>
<option value="37">雪飄工作室(FLsnow)</option>
<option value="47">爱恋字幕社</option>
<option value="710">咪梦动漫组</option>
<option value="88">动音漫影</option>
<option value="574">梦蓝字幕组</option>
<option value="504">LoveEcho!</option>
<option value="765">爱咕字幕组</option>
<option value="520">豌豆字幕组</option>
<option value="650">SweetSub</option>
<option value="430">幻之字幕组</option>
<option value="407">DHR動研字幕組</option>
<option value="321">轻之国度</option>
<option value="581">VCB-Studio</option>
<option value="703">届恋字幕组</option>
<option value="576">银色子弹字幕组</option>
<option value="454">风车字幕组</option>
<option value="485">天空树双语字幕组</option>
<option value="134">漫游字幕组</option>
<option value="434">风之圣殿</option>
<option value="630">枫叶字幕组</option>
<option value="228">KRL字幕组</option>
<option value="526">东京不够热</option>
<option value="592">未央阁联盟</option>
<option value="288">诸神kamigami字幕组</option>
<option value="767">天月動漫&amp;發佈組</option>
<option value="768">千歲字幕組</option>
<option value="423">漫貓字幕組</option>
<option value="562">129.3字幕組</option>
<option value="447">夢幻戀櫻</option>
<option value="680">Little字幕组</option>
<option value="641">冷番补完字幕组</option>
<option value="31">卡通空間</option>
<option value="649">云光字幕组</option>
<option value="701">狐狸小宮</option>
<option value="459">紫音動漫&amp;發佈組</option>
<option value="699">小花花同盟戰線</option>
<option value="626">驯兽师联盟</option>
<option value="58">澄空学园</option>
<option value="769">动漫萌</option>
<option value="734">TD-RAWS</option>
<option value="225">鈴風字幕組</option>
<option value="673">VRAINSTORM</option>
<option value="741">銀月字幕組</option>
<option value="675">AikatsuFans</option>
<option value="759">红鸟窝字幕组</option>
<option value="764">MCE汉化组</option>
<option value="391">ZERO字幕组</option>
<option value="561">钉铛字幕组</option>
<option value="727">2B4B</option>
<option value="104">动漫先锋</option>
<option value="567">雪梦字幕组</option>
<option value="573">Centaurea-Raws</option>
<option value="652">SFEO-Raws</option>
<option value="666">中肯字幕組</option>
<option value="754">BYYM发布组</option>
<option value="613">AI-Raws</option>
<option value="706">K&amp;W-RAWS</option>
<option value="732">肥猫压制</option>
<option value="424">TSDM字幕組</option>
<option value="739">Clarita 压制组</option>
<option value="432">自由字幕组</option>
<option value="217">AQUA工作室</option>
<option value="753">柠檬水字幕组</option>
<option value="763">光之家族字幕组</option>
<option value="332">CureSub</option>
<option value="537">NEO·QSW</option>
<option value="632">歐克勒亞</option>
<option value="548">Cornflower Studio</option>
<option value="638">LittleBakas!</option>
</select>
</div>
</div>
2020-10-21 18:05:33 +08:00
</div>
</form>
<table id="rss" lay-filter="rssTools"></table>
<div id="footer"></div>
</div>
</div>
2020-10-21 18:05:33 +08:00
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>
<script type="text/html" id="rssTopTools">
<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="rss_src">原地址</a>
2020-10-21 18:05:33 +08:00
<a class="layui-btn layui-btn-xs" lay-event="addRss">订阅</a>
</script>
<script type="text/html" id="listTools">
<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="src">原地址</a>
<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="bgm_src">番剧计划</a>
<a class="layui-btn layui-btn-xs" lay-event="show">查看</a>
2020-10-21 18:05:33 +08:00
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script type="text/html" id="animState">
{{# if(d.enable==1){}}
2021-05-20 16:28:27 +08:00
<div><input type="checkbox" name="state" lay-text="启用|关闭" lay-filter="stateCheckbox" lay-skin="switch"
value="{{d.id}}" checked></div>
{{# } else { }}
2021-05-20 16:28:27 +08:00
<div><input type="checkbox" name="state" lay-text="启用|关闭" lay-filter="stateCheckbox" lay-skin="switch"
value="{{d.id}}"></div>
{{# }}}
</script>
<script type="text/html" id="animUpdateState">
{{# if(d.updateDay=='今天更新'){}}
<div><input type="checkbox" name="update" lay-text="今天更新|不更新" lay-filter="stateCheckbox" lay-skin="switch"
value="{{d.id}}" checked disabled></div>
{{# } else { }}
<div><input type="checkbox" name="update" lay-text="{{d.updateDay}}|{{d.updateDay}}" lay-filter="stateCheckbox" lay-skin="switch"
value="{{d.id}}" disabled></div>
{{# }}}
</script>
2020-10-21 18:05:33 +08:00
<script>
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
2020-10-21 18:05:33 +08:00
let tabid = -1;
$.get("/login/check.do", function (data) {
let json = JSON.parse(data);
if (json.code !== 0) {
2020-10-21 18:05:33 +08:00
window.location.href = "/"
}
})
2022-07-10 18:24:17 +08:00
layui.use(['layer', 'form', 'element', 'table', 'util'], function () {
2021-05-19 18:34:04 +08:00
let layer = layui.layer
2022-07-10 18:24:17 +08:00
, util = layui.util
2020-10-21 18:05:33 +08:00
, form = layui.form
, table = layui.table
, element = layui.element;
2022-07-10 18:24:17 +08:00
util.fixbar({
bar1: '&#xe637;',
bgcolor: '#393D49',
css: {right: 100, bottom: 100},
click: function(type){
console.log(type);
if(type === 'bar1'){
showToDayAnim()
}
}
});
2020-10-21 18:05:33 +08:00
$.get("/anim/type/list.do", function (data) {
let json = JSON.parse(data);
if (json.code === 0) {
2020-10-21 18:05:33 +08:00
for (let index = 0; index < json.data.length; index++) {
const ret = json.data[index];
2021-05-19 18:34:04 +08:00
element.tabAdd('animType', {
2020-10-21 18:05:33 +08:00
title: ret.title
, content: '<table id="passwordlist' + ret.id + '" lay-filter="adminTable"></table>'
2020-10-21 18:05:33 +08:00
, id: ret.id
})
2020-10-21 18:05:33 +08:00
}
2021-05-19 18:34:04 +08:00
element.on('tab(animType)', function (data) {
tabid = $(this).attr('lay-id')
table.render({
elem: "#passwordlist" + tabid
, url: '/anim/rss/list.do?type=' + tabid
, page: true
, cols: [[
{field: "id", title: "id", width: 60, sort: true, fixed: 'left'}
, {field: 'bgmid', title: 'bgmId', width: 80, edit: 'text'}
2021-05-20 16:28:27 +08:00
, {field: 'title', title: '标题', edit: 'text'}
, {field: 'categories', title: '类型', width: 80}
, {field: 'author', title: '字幕组', width: 100}
, {field: 'titlekey', title: '搜索关键词', width: 200, edit: 'text'}
, {field: 'enable', title: '状态', width: 80, templet: '#animState'}
, {field: 'update', title: '更新', width: 110, templet: '#animUpdateState'}
2021-05-19 18:34:04 +08:00
, {field: "right", toolbar: '#listTools'}
]]
});
})
2021-05-20 16:28:27 +08:00
table.on('edit(adminTable)', function (obj) {
let type = obj.field;
let value = obj.value;
let id = obj.data.id;
console.log("id = " + id + " type = " + type + " value = " + value)
let data = {}
if (type === 'title') {
data = {id: id, title: value}
} else if (type === 'bgmid') {
data = {id: id, bgmId: value}
2021-05-20 16:28:27 +08:00
} else {
data = {id: id, titleKey: value}
}
$.post('/anim/rss/edit.do', data, function (json) {
layer.msg(json.msg)
})
})
element.on('tabDelete(animType)', function (data) {
let name = $(data.elem.prevObject.prevObject[0]).text().replace("ဆ", "")
let id = $(data.elem.prevObject.prevObject[0]).attr('lay-id')
layer.open({
title: "警告"
, content: "确认删除 " + name
, btn: ['确认', '取消']
, yes: function (index) {
$.post('/anim/type/del.do', {id: id}, function (data) {
let json = JSON.parse(data);
layer.msg(json.msg);
})
layer.close(index)
}
, btn2: function (index) {
layer.close(index)
}
})
});
table.on('tool(adminTable)', function (obj) {
if (obj.event === 'show') {
$("#type").find("option:contains('" + obj.data.categories + "')").attr("selected", null);
$("#team").find("option:contains('" + obj.data.author + "')").attr("selected", null);
$("#type").find("option:contains('" + obj.data.categories + "')").attr("selected", true);
$("#team").find("option:contains('" + obj.data.author + "')").attr("selected", true);
$('#title').val(obj.data.titlekey);
form.render("select", 'team');
form.render("select", 'type');
searchClick();
} else if (obj.event === 'del') {
layer.open({
title: "警告!"
, content: "删除操作无法回滚,是否确认删除:" + obj.data.title
, btn: ['确认', '取消']
, yes: function (index) {
$.post('/anim/rss/del.do', {id: obj.data.id}, function (data) {
let json = JSON.parse(data);
layer.msg(json.msg)
layer.close(index)
})
},
btn2: function (index) {
layer.close(index);
}
})
} else if (obj.event === 'src') {
window.open("https://share.dmhy.org/topics/list?keyword=" + encodeURI(obj.data.titlekey))
} else if (obj.event === 'bgm_src') {
window.open("https://bgm.tv/subject/" + obj.data.bgmid)
2021-05-20 16:28:27 +08:00
}
})
table.on('tool(rssTools)', function (obj) {
let data = obj.data;
if (obj.event === 'addRss') {
let option = '';
for (let i = 0; i < 20; i++) {
if (i === 1) {
option += '<option selected>' + i + '</option>'
} else {
option += '<option>' + i + '</option>'
}
}
let html = '<form class="layui-form">名字:<div class="layui-form-item"><textarea class="layui-textarea" id="rss_value" onblur="setTitle(this)">' + data.title + '</textarea> 季度:<select lay-search lay-verify="required" id="rss_select">' + option + '</select> <a id="bgmUrl" href="javascript:;" target="_blank">bgmId:</a><input class="layui-input" id="bgmId"/></div></form>'
layer.open({
type: 0,
area: ['500px', '600px'],
2021-05-20 16:28:27 +08:00
title: '订阅这个RSS结果,并加入到第' + tabid + '个分类中',
content: html,
success: function () {
form.render('select');
},
yes: function (index, elem) {
let value = $('#rss_value')[0].value + '/Season ' + $('#rss_select')[0].value
let bgmId = $('#bgmId')[0].value
$.post("/anim/rss/add.do", {
title: value
, bgmId: bgmId
, author: data.author
, categories: data.categories[0]
, titleKey: $('#title').val()
, bid: tabid
}, function (data) {
let json = JSON.parse(data);
layer.msg(json.msg)
layer.close(index)
})
}
2021-05-20 16:28:27 +08:00
})
} else if (obj.event === "rss_src") {
window.open(obj.data.link)
2021-05-20 16:28:27 +08:00
}
})
form.on('switch(stateCheckbox)', function (data) {
let flag = data.elem.checked ? 1 : 0;
let id = data.value;
$.post('/anim/rss/edit.do', {id: id, enable: flag}, function (json) {
2021-05-20 16:28:27 +08:00
layer.msg(json.msg)
})
})
2021-05-19 18:34:04 +08:00
element.tabChange('animType', '1');
2020-10-21 18:05:33 +08:00
}
});
let rssList = table.render({
elem: "#rss",
url: "/anim/rss/data.do?key=&type=" + form.val("formTest").type + "&team=" + form.val("formTest").team,
toolbar: true,
page: true,
cols: [[
{field: "title", title: "标题", sort: true, fixed: 'left'}
, {field: 'author', title: '字幕组', width: 100}
, {field: 'categories', title: '类型', width: 80, templet: '<div><label>{{d.categories[0]}}</label><div>'}
2020-10-21 18:05:33 +08:00
, {field: 'pubDate', title: '发布时间',}
, {field: 'thumbnail', title: '封面', templet: '<div><img src="{{d.thumbnail}}"/><div>'}
, {field: 'title', title: 'magnet', templet: '<div><label >{{d.enclosure.link}}</label ></div>'}
, {field: "right", toolbar: '#rssTopTools'}
]]
})
form.render()
2021-05-19 18:34:04 +08:00
2020-10-21 18:05:33 +08:00
$('#addType').click(function () {
layer.prompt({
title: '新增分类'
}, function (value, index, elem) {
$.post('/anim/type/add.do', {title: value}, function (data) {
window.location.reload()
})
2020-10-21 18:05:33 +08:00
layer.close(index)
})
})
$('#search').click(function () {
searchClick()
})
$('#searchBgmId').click(function () {
let url = "https://bgm.tv/subject_search/" + encodeURIComponent($('#title')[0].value) + "?cat=2"
window.open(url)
})
2020-10-21 18:05:33 +08:00
function searchClick() {
rssList.reload({
where: {
key: $('#title').val(),
type: form.val("formTest").type,
team: form.val("formTest").team
}
2020-10-21 18:05:33 +08:00
})
}
2022-07-10 18:24:17 +08:00
function showToDayAnim() {
$.get("/anim/getToDay.do", function (json) {
let items = json.items;
let _tab = []
let html = '<table class="layui-table"> <colgroup> <col width="150" /> <col width="200" /> <col /> </colgroup> <thead> <tr> <th>标题</th> <th>首更时间</th> <th>图片</th> <th>地址</th> </tr> </thead> <tbody> </tbody>'
items.forEach((item) => {
let name = item.name_cn
if (name === '') {
name = item.name;
}
let img='#'
if(item.images!=null){
img=item.images.small
}
html += '<tr><td>' + name + '</td><td>' + item.air_date + '</td><td><img src="' + img + '"></td><td><a href="' + item.url + '" target="_blank">前往番剧计划</a></td></tr>'
2022-07-10 18:24:17 +08:00
_tab.push({title: item.name, url: '<a href="' + item.url + '">前往番剧计划</a>'})
})
html += "</table>"
layer.open({
title: '今日新番列表',
area: ['700px', '300px'],
content: html,
shade: 0,
offset: 'rb'
});
})
}
2020-10-21 18:05:33 +08:00
});
2020-05-13 17:39:29 +08:00
function setTitle(_this) {
let url = "https://bgm.tv/subject_search/" + encodeURIComponent(_this.value) + "?cat=2"
console.log(url)
$('#bgmUrl')[0].href = url;
}
2020-10-21 18:05:33 +08:00
</script>
</body>
<style>
#icon {
float: right;
}
2020-10-21 18:05:33 +08:00
#rss + .layui-table-view tbody > tr > td > .layui-table-cell {
height: 100px;
line-height: 100px;
}
</style>
</html>