调整缓存列表样式,缓存时间在Key右上角,支持删除指定缓存

This commit is contained in:
Argo-Lenovo 2016-11-04 17:42:14 +08:00
parent e6f310fe89
commit dd67c1b360
2 changed files with 217 additions and 200 deletions

View File

@ -30,7 +30,6 @@
.tasks-widget .task-list > li {
position: relative;
padding: 10px 5px;
border-bottom: 1px dashed #eaeaea;
}
@ -50,6 +49,7 @@
.tasks-widget .task-list li > .task-title {
overflow: hidden;
margin-right: 10px;
height: 46px;
}
.tasks-widget .task-list li > .task-title .task-value {
@ -59,20 +59,26 @@
position: absolute;
left: 190px;
right: 40px;
top: 16px;
display: inline-block;
padding-left: 16px;
}
.tasks-widget .task-list li > .task-title .badge {
position: absolute;
position: relative;
display: inline-block;
left: 25px;
top: 2px;
top: -19px;
left: -12px;
}
.tasks-widget .task-list li > .task-title .label-success {
background-color: #5cb85c;
}
.tasks-widget .task-list li > .task-title .hidden-phone {
padding-top: 14px;
}
.tasks-widget .task-list li > .task-config {
position: absolute;
top: 10px;
@ -86,6 +92,7 @@
white-space: nowrap;
text-overflow: ellipsis;
display: inline-block;
padding-top: 17px;
}
.tasks-widget .task-list li.task-done .task-title-sp {
@ -129,7 +136,7 @@
#sortable li i {
position: absolute;
left: 6px;
padding: 4px 10px 0 10px;
padding: 19px 10px;
cursor: pointer;
}
@ -138,7 +145,7 @@
}
.ui-sortable > li {
padding: 18px 0 15px 35px !important;
padding-left: 35px !important;
position: relative;
background: #f5f6f8;
margin-bottom: 2px;

View File

@ -1,7 +1,9 @@
$(function () {
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><span class="task-value">{3}</span><div class="pull-right hidden-phone"><button class="btn btn-danger btn-xs fa fa-trash-o" data-val="{1}"></button></div></div></li>';
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><span class="task-value tooltips" data-placement="top" data-original-title="{3}">{3}</span><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>';
function listCache(options) {
$.ajax({
url: '../../CacheList.axd',
url: options.url,
type: 'GET',
success: function (result) {
if (result) {
@ -10,7 +12,12 @@
var content = result.map(function (ele) {
return $.format(html, ele.Interval, ele.Key, ele.Desc, ele.Value);
}).join('');
$('#sortable').append(content);
$('#sortable').html(content);
$('.tooltips').tooltip();
$('#sortable .btn').click(function () {
var key = $(this).attr('data-key');
listCache({ url: $.format('../../CacheList.axd?cacheKey={0}', key) });
});
}
}
else {
@ -19,4 +26,7 @@
error: function (XMLHttpRequest, textStatus, errorThrown) {
}
});
}
listCache({ url: '../../CacheList.axd' });
});