2020-05-12 17:42:24 +08:00
<!DOCTYPE html>
2022-07-10 17:02:48 +08:00
< html lang = "zh" >
2020-05-12 17:42:24 +08:00
< 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" >
2022-05-07 23:05:23 +08:00
< link rel = "stylesheet" href = "/css/my.css" >
2020-05-12 17:42:24 +08:00
< / head >
< body >
2020-10-21 18:05:33 +08:00
< div class = "layui-layout layui-layout-admin" >
< div id = "header" > < / div >
2020-05-12 17:42:24 +08:00
2022-07-09 16:30:46 +08:00
< div class = "layui-body body2" >
2020-10-21 18:05:33 +08:00
< div id = "side" > < / div >
2022-07-09 16:30:46 +08:00
< 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-05-12 17:42:24 +08:00
2020-10-21 18:05:33 +08:00
< / ul >
< div class = "layui-tab-content" >
2020-05-12 17:42:24 +08:00
< / div >
2020-10-21 18:05:33 +08:00
< / div >
2022-07-09 16:30:46 +08:00
< 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 >
2020-05-12 17:42:24 +08:00
< 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" > R A W < / 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 >
2020-05-12 17:42:24 +08:00
< / 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" > 天月動漫& 發佈組< / 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" > 紫音動漫& 發佈組< / 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& 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 >
2020-05-12 17:42:24 +08:00
< / 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-05-12 17:42:24 +08:00
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" >
2022-05-07 23:05:23 +08:00
< 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" >
2022-05-07 23:05:23 +08:00
< a class = "layui-btn layui-btn-warm layui-btn-xs" lay-event = "src" > 原地址< / a >
2022-07-10 17:02:48 +08:00
< a class = "layui-btn layui-btn-warm layui-btn-xs" lay-event = "bgm_src" > 番剧计划< / a >
2021-05-18 18:29:55 +08:00
< 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 >
2021-05-18 18:29:55 +08:00
< 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 >
2021-05-18 18:29:55 +08:00
{{# } 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 >
2021-05-18 18:29:55 +08:00
{{# }}}
< / script >
2022-07-10 17:02:48 +08:00
< script type = "text/html" id = "animUpdateState" >
2022-07-14 13:56:04 +08:00
{{# if(d.updateDay=='今天更新'){}}
2022-07-10 17:02:48 +08:00
< div > < input type = "checkbox" name = "update" lay-text = "今天更新|不更新" lay-filter = "stateCheckbox" lay-skin = "switch"
value="{{d.id}}" checked disabled>< / div >
{{# } else { }}
2022-07-14 13:56:04 +08:00
< div > < input type = "checkbox" name = "update" lay-text = "{{d.updateDay}}|{{d.updateDay}}" lay-filter = "stateCheckbox" lay-skin = "switch"
2022-07-10 17:02:48 +08:00
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");
2022-03-28 18:38:32 +08:00
2020-10-21 18:05:33 +08:00
let tabid = -1;
$.get("/login/check.do", function (data) {
let json = JSON.parse(data);
2021-05-18 18:29:55 +08:00
if (json.code !== 0) {
2020-10-21 18:05:33 +08:00
window.location.href = "/"
}
})
2020-05-12 17:42:24 +08:00
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: ' ',
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);
2021-05-18 18:29:55 +08:00
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
2021-05-18 18:29:55 +08:00
, content: '< table id = "passwordlist' + ret.id + '" lay-filter = "adminTable" > < / table > '
2020-10-21 18:05:33 +08:00
, id: ret.id
2020-05-12 17:42:24 +08:00
})
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: [[
2022-07-10 17:02:48 +08:00
{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'}
2022-07-09 16:30:46 +08:00
, {field: 'categories', title: '类型', width: 80}
, {field: 'author', title: '字幕组', width: 100}
2022-07-10 17:02:48 +08:00
, {field: 'titlekey', title: '搜索关键词', width: 200, edit: 'text'}
2022-07-09 16:30:46 +08:00
, {field: 'enable', title: '状态', width: 80, templet: '#animState'}
2022-07-10 17:02:48 +08:00
, {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}
2022-07-10 17:02:48 +08:00
} 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);
}
})
2022-07-09 16:30:46 +08:00
} else if (obj.event === 'src') {
window.open("https://share.dmhy.org/topics/list?keyword=" + encodeURI(obj.data.titlekey))
2022-07-10 17:02:48 +08:00
} 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') {
2022-07-09 16:30:46 +08:00
let option = '';
for (let i = 0; i < 20 ; i + + ) {
if (i === 1) {
option += '< option selected > ' + i + '< / option > '
} else {
option += '< option > ' + i + '< / option > '
}
}
2022-07-10 17:02:48 +08:00
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 > '
2022-07-09 16:30:46 +08:00
layer.open({
type: 0,
area: ['500px', '600px'],
2021-05-20 16:28:27 +08:00
title: '订阅这个RSS结果,并加入到第' + tabid + '个分类中',
2022-07-09 16:30:46 +08:00
content: html,
2022-07-10 17:02:48 +08:00
success: function () {
2022-07-09 16:30:46 +08:00
form.render('select');
},
yes: function (index, elem) {
2022-07-10 17:02:48 +08:00
let value = $('#rss_value')[0].value + '/Season ' + $('#rss_select')[0].value
let bgmId = $('#bgmId')[0].value
2022-07-09 16:30:46 +08:00
$.post("/anim/rss/add.do", {
title: value
2022-07-10 17:02:48 +08:00
, bgmId: bgmId
2022-07-09 16:30:46 +08:00
, 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
})
2022-07-09 16:30:46 +08:00
} else if (obj.event === "rss_src") {
2022-05-07 23:05:23 +08:00
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;
2022-07-09 16:30:46 +08:00
$.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'}
2022-07-09 16:30:46 +08:00
, {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
2021-05-18 18:29:55 +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-05-12 17:42:24 +08:00
})
2020-10-21 18:05:33 +08:00
layer.close(index)
})
})
$('#search').click(function () {
searchClick()
})
2022-07-10 17:02:48 +08:00
$('#searchBgmId').click(function () {
let url = "https://bgm.tv/subject_search/" + encodeURIComponent($('#title')[0].value) + "?cat=2"
window.open(url)
})
2020-05-12 17:42:24 +08:00
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-05-12 17:42:24 +08:00
}
2020-10-21 18:05:33 +08:00
})
}
2022-07-10 17:02:48 +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;
}
2022-07-14 13:09:17 +08:00
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'
});
})
}
2022-07-10 17:02:48 +08:00
2020-10-21 18:05:33 +08:00
});
2020-05-13 17:39:29 +08:00
2022-07-10 17:02:48 +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 >
2020-05-12 17:42:24 +08:00
< / body >
< style >
#icon {
float: right;
}
2020-10-21 18:05:33 +08:00
#rss + .layui-table-view tbody > tr > td > .layui-table-cell {
2020-05-12 17:42:24 +08:00
height: 100px;
line-height: 100px;
}
< / style >
< / html >