var dtLang = { "sProcessing": "处理中...", "lengthMenu": '显示 项结果', "sZeroRecords": "没有匹配结果", "sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项", "sInfoEmpty": "显示第 0 至 0 项结果,共 0 项", "sInfoFiltered": "(由 _MAX_ 项结果过滤)", "sInfoPostFix": "", "sSearch": "搜索:", "sUrl": "", "sEmptyTable": "表中数据为空", "sLoadingRecords": "载入中...", "sInfoThousands": ",", "oPaginate": { "sFirst": "首页", "sPrevious": "上页", "sNext": "下页", "sLast": "末页" } , "oAria": { "sSortAscending": ": 以升序排列此列", "sSortDescending": ": 以降序排列此列" } }; var tableHead = ""; var tableTail = "
序号UUID备注过期时间节点数下载
"; var fillAcceptList = function(data) { console.log("fillAcceptData"); var html = tableHead; var lines = data; for (var i = 0; i < lines.length; i++) { html += ""; html += (i + 1); html += ""; html += lines[i].uuid; html += ""; html += lines[i].remark; html += ""; html += lines[i].expiredDate; html += ""; html += lines[i].nodeCount; html += ""; html += ""; html += ""; } html += tableTail; $("#authoriedDiv").html(html); $("#authoriedDiv").off("click", ":button").on( "click", ":button", function(event) { var acceptInfo = { }; var pos = ($(this).closest("tr").find("td").eq(0) .text() - 1) / 1; var licence = global.acceptList[pos].licence; var uri = "data:text/html,"; uri+=licence var link = document.createElement("a"); link.download = "licence.txt"; link.href = uri; document.body.appendChild(link); link.click(); document.body.removeChild(link); delete link; } ); $("#authorizedUsersTab").DataTable({ "language": dtLang, "rowCallback": function(row, data, displayNum, displayIndex, dataIndex) { } , "headerCallback": function(thead, data, start, end, display) { $(thead).css("background", primaryColor); $(thead).css("color", "white"); $(thead).children().css("background", primaryColor); $(thead).children().css("color", "white"); } , scrollCollapse: false, paging: true, pageLength: 5, order: [[1, 'asc']], "columnDefs": [{ "targets": 3, "render": function(data, type, row, meta) { return new Date(data / 1).toLocaleString(); } } , { "targets": 1, "render": function(data, type, row, meta) { if (data.length > 15) return "" + data.substring(0, 15) + " ..."; else return data; } } ] } ); }; var tableApplyHead = ""; var tableApplyTail = "
序号UUID备注授权过期时间节点数量管理
"; var onAccept = function(data){ console.log("acceptResult"); console.log(data); if (data.result=="true"){ flushApplylist(); flushAcceptlist(); } }; var fillApplyData = function(data) { console.log("fillApplyListData"); var html = tableApplyHead; var lines = data; for (var i = 0; i < lines.length; i++) { html += ""; html += (i + 1); html += ""; html += lines[i].uuid; html += ""; html += lines[i].remark; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; } html += tableTail; $("#unauthoriedDiv").html(html); $("#unauthoriedDiv").off("click", ":button").on( "click", ":button", function(event) { var acceptInfo = { }; var pos = ($(this).closest("tr").find("td").eq(0) .text() - 1) / 1; acceptInfo.uuid = global.applyList[pos].uuid; acceptInfo.expiredDate = $("#timeInput"+pos)[0].value; if (acceptInfo.expiredDate==undefined || acceptInfo.expiredDate