2016-11-04 16:06:40 +08:00
|
|
|
|
$(function () {
|
2016-11-10 00:47:23 +08:00
|
|
|
|
var bsa = new BootstrapAdmin({
|
|
|
|
|
url: '../api/Profiles',
|
|
|
|
|
bootstrapTable: null,
|
|
|
|
|
validateForm: null,
|
|
|
|
|
modal: null,
|
|
|
|
|
dataEntity: new DataEntity({
|
|
|
|
|
map: {
|
|
|
|
|
Title: "sysName",
|
|
|
|
|
Footer: "sysFoot"
|
2016-11-08 15:35:14 +08:00
|
|
|
|
}
|
2016-11-10 00:47:23 +08:00
|
|
|
|
}),
|
|
|
|
|
click: {
|
|
|
|
|
assign: [{
|
|
|
|
|
id: 'sysSave',
|
|
|
|
|
click: function (row, data) {
|
2016-11-10 01:27:58 +08:00
|
|
|
|
if (data.Title == "") {
|
|
|
|
|
swal("请输入网站标题内容", "保存操作", "error");
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-11-10 00:47:23 +08:00
|
|
|
|
Profiles.saveWebSite({ name: '网站标题', code: data.Title, category: '网站设置' });
|
2016-11-08 15:35:14 +08:00
|
|
|
|
}
|
2016-11-10 00:47:23 +08:00
|
|
|
|
}, {
|
|
|
|
|
id: 'footSave',
|
|
|
|
|
click: function (row, data) {
|
2016-11-10 01:27:58 +08:00
|
|
|
|
if (data.Title == "") {
|
|
|
|
|
swal("请输入网站页脚内容", "保存操作", "error");
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-11-10 00:47:23 +08:00
|
|
|
|
Profiles.saveWebSite({ name: '网站页脚', code: data.Footer, category: '网站设置' });
|
2016-11-08 15:35:14 +08:00
|
|
|
|
}
|
2016-11-10 00:47:23 +08:00
|
|
|
|
}]
|
|
|
|
|
}
|
2016-11-08 15:35:14 +08:00
|
|
|
|
});
|
|
|
|
|
|
2016-11-05 10:56:34 +08:00
|
|
|
|
var html = '<li class="list-primary"><i class="fa fa-ellipsis-v"></i><div class="task-title"><span class="task-title-sp">{2}</span><span class="badge badge-sm label-success">{0}</span><div class="task-wrapper"><span class="task-value tooltips" data-placement="top" data-original-title="{3}">{3}</span></div><div class="pull-right hidden-phone"><button class="btn btn-danger btn-xs fa fa-trash-o tooltips" data-key="{1}" data-placement="left" data-original-title="{1}"></button></div></div></li>';
|
2016-11-04 17:42:14 +08:00
|
|
|
|
|
|
|
|
|
function listCache(options) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: options.url,
|
|
|
|
|
type: 'GET',
|
|
|
|
|
success: function (result) {
|
|
|
|
|
if (result) {
|
|
|
|
|
result = $.parseJSON(result);
|
|
|
|
|
if ($.isArray(result)) {
|
|
|
|
|
var content = result.map(function (ele) {
|
|
|
|
|
return $.format(html, ele.Interval, ele.Key, ele.Desc, ele.Value);
|
|
|
|
|
}).join('');
|
|
|
|
|
$('#sortable').html(content);
|
|
|
|
|
$('.tooltips').tooltip();
|
|
|
|
|
$('#sortable .btn').click(function () {
|
|
|
|
|
var key = $(this).attr('data-key');
|
|
|
|
|
listCache({ url: $.format('../../CacheList.axd?cacheKey={0}', key) });
|
|
|
|
|
});
|
|
|
|
|
}
|
2016-11-04 16:06:40 +08:00
|
|
|
|
}
|
2016-11-04 17:42:14 +08:00
|
|
|
|
else {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
2016-11-04 16:06:40 +08:00
|
|
|
|
}
|
2016-11-04 17:42:14 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
listCache({ url: '../../CacheList.axd' });
|
2016-11-05 10:56:34 +08:00
|
|
|
|
$('a.fa-refresh').click(function () { listCache({ url: '../../CacheList.axd' }); });
|
2016-11-08 15:35:14 +08:00
|
|
|
|
})
|