add:新增临时rss订阅地址
This commit is contained in:
@@ -173,6 +173,11 @@
|
||||
<a class="layui-btn layui-btn-xs" lay-event="show">查看</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
</script>
|
||||
<script type="text/html" id="RsslistTools">
|
||||
<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="mikan">MiKan</a>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="tmp_rss_show">查看</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="tmp_rss_del">删除</a>
|
||||
</script>
|
||||
<script type="text/html" id="animState">
|
||||
{{# if(d.enable==1){}}
|
||||
<div><input type="checkbox" name="state" lay-text="启用|关闭" lay-filter="stateCheckbox" lay-skin="switch"
|
||||
@@ -202,7 +207,22 @@
|
||||
window.location.href = "/"
|
||||
}
|
||||
})
|
||||
|
||||
function addTmpRss(def) {
|
||||
layer.prompt({
|
||||
formType: 0,
|
||||
value: '',
|
||||
title: '请输入RSS地址'
|
||||
}, function(value, index, elem){
|
||||
$.post('/anim/rss/add.do',{
|
||||
title: value,
|
||||
bid:-1
|
||||
},function (json) {
|
||||
console.log(json)
|
||||
layer.msg(json.msg)
|
||||
layer.close(index);
|
||||
})
|
||||
});
|
||||
}
|
||||
layui.use(['layer', 'form', 'element', 'table', 'util'], function () {
|
||||
let layer = layui.layer
|
||||
, util = layui.util
|
||||
@@ -220,24 +240,34 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.get("/anim/type/list.do", function (data) {
|
||||
let json = JSON.parse(data);
|
||||
if (json.code === 0) {
|
||||
for (let index = 0; index < json.data.length; index++) {
|
||||
const ret = json.data[index];
|
||||
let ret = json.data[index];
|
||||
let content;
|
||||
if(ret.id===-1){
|
||||
content='<button type="button" class="layui-btn layui-btn-xs" onclick="addTmpRss(this)">添加临时订阅地址</button>'
|
||||
}else{
|
||||
content=''
|
||||
}
|
||||
element.tabAdd('animType', {
|
||||
title: ret.title
|
||||
, content: '<table id="passwordlist' + ret.id + '" lay-filter="adminTable"></table>'
|
||||
, content: content+'<table id="passwordlist' + ret.id + '" lay-filter="adminTable"></table>'
|
||||
, id: ret.id
|
||||
})
|
||||
}
|
||||
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: [[
|
||||
let cols;
|
||||
if(tabid==='-1'){
|
||||
cols=[[
|
||||
{field: 'title', title: '地址'}
|
||||
,{field: "right", toolbar: '#RsslistTools'}
|
||||
]]
|
||||
}else{
|
||||
cols=[[
|
||||
{field: "id", title: "id", width: 60, sort: true, fixed: 'left'}
|
||||
, {field: 'bgmid', title: 'bgmId', width: 80, edit: 'text'}
|
||||
, {field: 'title', title: '标题', edit: 'text'}
|
||||
@@ -248,6 +278,12 @@
|
||||
, {field: 'update', title: '更新', width: 110, templet: '#animUpdateState'}
|
||||
, {field: "right", toolbar: '#listTools'}
|
||||
]]
|
||||
}
|
||||
table.render({
|
||||
elem: "#passwordlist" + tabid
|
||||
, url: '/anim/rss/list.do?type=' + tabid
|
||||
, page: true
|
||||
, cols: cols
|
||||
});
|
||||
})
|
||||
table.on('edit(adminTable)', function (obj) {
|
||||
@@ -306,8 +342,7 @@
|
||||
, content: "删除操作无法回滚,是否确认删除:" + obj.data.title
|
||||
, btn: ['确认', '取消']
|
||||
, yes: function (index) {
|
||||
$.post('/anim/rss/del.do', {id: obj.data.id}, function (data) {
|
||||
let json = JSON.parse(data);
|
||||
$.post('/anim/rss/del.do', {id: obj.data.id}, function (json) {
|
||||
layer.msg(json.msg)
|
||||
layer.close(index)
|
||||
})
|
||||
@@ -321,6 +356,15 @@
|
||||
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)
|
||||
} else if (obj.event==='mikan'){
|
||||
console.log(getParam('bangumiId',obj.data.title))
|
||||
window.open('https://mikanani.me/Home/Bangumi/'+getParam('bangumiId',obj.data.title)+'#'+getParam('subgroupid',obj.data.title))
|
||||
} else if (obj.event==='tmp_rss_show'){
|
||||
window.open(obj.data.title)
|
||||
} else if (obj.event==='tmp_rss_del'){
|
||||
$.post('/anim/rss/del.do', {id: obj.data.title}, function (json) {
|
||||
layer.msg(json.msg)
|
||||
})
|
||||
}
|
||||
})
|
||||
table.on('tool(rssTools)', function (obj) {
|
||||
@@ -354,8 +398,7 @@
|
||||
, categories: data.categories[0]
|
||||
, titleKey: $('#title').val()
|
||||
, bid: tabid
|
||||
}, function (data) {
|
||||
let json = JSON.parse(data);
|
||||
}, function (json) {
|
||||
layer.msg(json.msg)
|
||||
layer.close(index)
|
||||
})
|
||||
@@ -456,7 +499,6 @@
|
||||
|
||||
function setTitle(_this) {
|
||||
let url = "https://bgm.tv/subject_search/" + encodeURIComponent(_this.value) + "?cat=2"
|
||||
console.log(url)
|
||||
$('#bgmUrl')[0].href = url;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user