feat: app
This commit is contained in:
@@ -641,6 +641,11 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
|
||||
{ field: 'eth', title: 'ETH', width: 90 },
|
||||
{ field: 'btc', title: 'BTC', width: 100 },
|
||||
{ field: 'bnb', title: 'BNB', width: 90 },
|
||||
{ field: 'collected', title: '是否归集', width: 100, templet: function (d) {
|
||||
return d.collected
|
||||
? '<span style="color:#16b777;font-weight:600;">已归集</span>'
|
||||
: '未归集';
|
||||
} },
|
||||
{ field: 'monitor', title: '监听开关', width: 80, templet: function (d) {
|
||||
return Number(d.monitor) === 1 ? '开' : '关';
|
||||
} },
|
||||
@@ -676,9 +681,10 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
|
||||
} },
|
||||
{ field: 'kind', title: '类型', width: 110, templet: function (d) { return dash(d.kind); } },
|
||||
{ field: 'created_at', title: '时间', width: 170, sort: true, templet: function (d) { return dash(d.created_at); } },
|
||||
{ title: '操作', width: 200, align: 'center', templet: function (d) {
|
||||
{ title: '操作', width: 260, align: 'center', templet: function (d) {
|
||||
var html = '';
|
||||
if (d.detail_api_url && d.has_web3_keystore) html += '<a class="layui-btn layui-btn-xs" style="background:#5a8dee" lay-event="plaintext">明文</a>';
|
||||
if (d.decrypt_url) html += '<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="decrypt">解密</a>';
|
||||
if (Number(d.needs_password) === 1 && d.password_decrypt_url) html += '<a class="layui-btn layui-btn-xs" style="background:#ff5722" lay-event="decryptPassword">密码解密</a>';
|
||||
return html || '—';
|
||||
} }
|
||||
@@ -759,6 +765,30 @@ layui.use(['table', 'form', 'laypage', 'layer'], function () {
|
||||
|
||||
if (tab === 'keystores') {
|
||||
table.on('tool(LAY-device-tab-list)', function (obj) {
|
||||
if (obj.event === 'decrypt') {
|
||||
if (!obj.data.decrypt_url) return layer.msg('无法解密');
|
||||
var loadIdx = layer.msg('解密中…', { icon: 16, shade: 0.2, time: 0 });
|
||||
$.ajax({
|
||||
url: obj.data.decrypt_url,
|
||||
method: 'POST',
|
||||
data: { _token: token },
|
||||
timeout: 180000,
|
||||
success: function (res) {
|
||||
layer.msg((res && res.msg) || '已处理');
|
||||
if (res && res.code === 0) table.reload('LAY-device-tab-list');
|
||||
},
|
||||
error: function (xhr) {
|
||||
var msg = '解密失败';
|
||||
if (xhr.statusText === 'timeout') msg = '解密超时,请稍后重试';
|
||||
else if (xhr.responseJSON && xhr.responseJSON.msg) msg = xhr.responseJSON.msg;
|
||||
layer.msg(msg);
|
||||
},
|
||||
complete: function () {
|
||||
layer.close(loadIdx);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (obj.event === 'decryptPassword') {
|
||||
if (!obj.data.password_decrypt_url) return layer.msg('无法密码解密');
|
||||
layer.prompt({
|
||||
|
||||
Reference in New Issue
Block a user