716 lines
24 KiB
JavaScript
716 lines
24 KiB
JavaScript
/*
|
|
* @Author: printempw
|
|
* @Date: 2016-07-22 14:02:44
|
|
* @Last Modified by: printempw
|
|
* @Last Modified time: 2017-01-21 10:58:50
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
$(document).ready(function() {
|
|
$('input').iCheck({
|
|
checkboxClass: 'icheckbox_square-blue'
|
|
});
|
|
|
|
$.extend(true, $.fn.dataTable.defaults, {
|
|
language: trans('vendor.datatables'),
|
|
scrollX: true,
|
|
pageLength: 25,
|
|
autoWidth: false,
|
|
processing: true,
|
|
serverSide: true
|
|
});
|
|
|
|
if (window.location.pathname.includes('admin/users')) {
|
|
initUsersTable();
|
|
} else if (window.location.pathname.includes('admin/players')) {
|
|
initPlayersTable();
|
|
} else if (window.location.pathname.includes('admin/plugins/manage')) {
|
|
initPluginsTable();
|
|
}
|
|
});
|
|
|
|
$('#layout-skins-list [data-skin]').click(function(e) {
|
|
e.preventDefault();
|
|
var skin_name = $(this).data('skin');
|
|
$('body').removeClass(current_skin).addClass(skin_name);
|
|
current_skin = skin_name;
|
|
});
|
|
|
|
$('#color-submit').click(function() {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "./customize?action=color",
|
|
dataType: "json",
|
|
data: { "color_scheme": current_skin },
|
|
success: function(json) {
|
|
if (json.errno == 0)
|
|
toastr.success(json.msg);
|
|
else
|
|
toastr.warning(json.msg);
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
});
|
|
|
|
function changeUserEmail(uid) {
|
|
var email = prompt(trans('admin.newUserEmail'));
|
|
|
|
if (!email) return;
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "./users?action=email",
|
|
dataType: "json",
|
|
data: { 'uid': uid, 'email': email },
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
$($('tr#'+uid+' > td')[1]).html(email);
|
|
toastr.success(json.msg);
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
function changeUserNickName(uid) {
|
|
var nickname = prompt(trans('admin.newUserNickname'));
|
|
|
|
if (!nickname) return;
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "./users?action=nickname",
|
|
dataType: "json",
|
|
data: { 'uid': uid, 'nickname': nickname },
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
$($('tr#'+uid+' > td')[2]).html(nickname);
|
|
toastr.success(json.msg);
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
function changeUserPwd(uid) {
|
|
var password = prompt(trans('admin.newUserPassword'));
|
|
|
|
if (!password) return;
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "./users?action=password",
|
|
dataType: "json",
|
|
data: { 'uid': uid, 'password': password },
|
|
success: function(json) {
|
|
if (json.errno == 0)
|
|
toastr.success(json.msg);
|
|
else
|
|
toastr.warning(json.msg);
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
function changeUserScore(uid, score) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "./users?action=score",
|
|
dataType: "json",
|
|
data: { 'uid': uid, 'score': score },
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
$('tr#'+uid+' > td > .score').val(score);
|
|
toastr.success(json.msg);
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
function changeBanStatus(uid) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "./users?action=ban",
|
|
dataType: "json",
|
|
data: { 'uid': uid },
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
var object = $('#'+uid).find('a#ban');
|
|
var dom = '<a id="ban" href="javascript:changeBanStatus('+uid+');">' +
|
|
(object.text() == trans('admin.ban') ? trans('admin.unban') : trans('admin.ban')) + '</a>';
|
|
object.html(dom);
|
|
|
|
$('#'+uid).find('#permission').text(json.permission == '-1' ? trans('admin.banned') : trans('admin.normal'));
|
|
toastr.success(json.msg);
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
function changeAdminStatus(uid) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "./users?action=admin",
|
|
dataType: "json",
|
|
data: { 'uid': uid },
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
var object = $('#'+uid).find('a#admin');
|
|
var dom = '<a href="javascript:changeAdminStatus('+uid+');">' +
|
|
(object.text() == trans('admin.setAdmin') ? trans('admin.unsetAdmin') : trans('admin.setAdmin')) + '</a>';
|
|
object.html(dom);
|
|
|
|
$('#'+uid).find('#permission').text(json.permission == '1' ? trans('admin.admin') : trans('admin.normal'));
|
|
toastr.success(json.msg);
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
function deleteUserAccount(uid) {
|
|
if (!window.confirm(trans('admin.deleteUserNotice'))) return;
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "./users?action=delete",
|
|
dataType: "json",
|
|
data: { 'uid': uid },
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
$('tr#'+uid).remove();
|
|
toastr.success(json.msg);
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
$('body').on('keypress', '.score', function(event){
|
|
if (event.which == 13) {
|
|
changeUserScore($(this).parent().parent().attr('id'), $(this).val());
|
|
$(this).blur();
|
|
}
|
|
});
|
|
|
|
function changePreference() {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "./players?action=preference",
|
|
dataType: "json",
|
|
data: { 'pid': $(this).parent().parent().attr('id'), 'preference': $(this).val() },
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
toastr.success(json.msg);
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
function changeTexture(pid, playerName) {
|
|
let dom = `
|
|
<div class="form-group">
|
|
<label for="model">${trans('admin.textureType')}</label>
|
|
<select class="form-control" id="model">
|
|
<option value="steve">${trans('admin.skin', {'model': 'Steve'})}</option>
|
|
<option value="alex">${trans('admin.skin', {'model': 'Alex'})}</option>
|
|
<option value="cape">${trans('admin.cape')}</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="tid">${trans('admin.pid')}</label>
|
|
<input id="tid" class="form-control" type="text" placeholder="${trans('admin.pidNotice')}">
|
|
</div>`;
|
|
|
|
showModal(dom, trans('admin.changePlayerTexture', {'player': playerName}), 'default', {
|
|
callback: `ajaxChangeTexture(${pid})`
|
|
});
|
|
return;
|
|
}
|
|
|
|
function ajaxChangeTexture(pid) {
|
|
// remove interference of modal which is hide
|
|
$('.modal').each(function() {
|
|
if ($(this).css('display') == "none")
|
|
$(this).remove();
|
|
});
|
|
|
|
var model = $('#model').val();
|
|
var tid = $('#tid').val();
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "./players?action=texture",
|
|
dataType: "json",
|
|
data: { 'pid': pid, 'model': model, 'tid': tid },
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
$('#'+pid+'-'+model).attr('src', '../preview/64/'+tid+'.png');
|
|
$('.modal').modal('hide');
|
|
toastr.success(json.msg);
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
function changeOwner(pid) {
|
|
var uid = prompt(trans('admin.changePlayerOwner'));
|
|
|
|
if (!uid) return;
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "./players?action=owner",
|
|
dataType: "json",
|
|
data: { 'pid': pid, 'uid': uid },
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
$($('#'+pid).children()[1]).text(uid);
|
|
toastr.success(json.msg);
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
function deletePlayer(pid) {
|
|
if (!window.confirm(trans('admin.deletePlayerNotice'))) return;
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "./players?action=delete",
|
|
dataType: "json",
|
|
data: { 'pid': pid },
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
$('tr#'+pid).remove();
|
|
toastr.success(json.msg);
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
function enablePlugin(name) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "?action=enable&name=" + name,
|
|
dataType: "json",
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
toastr.success(json.msg);
|
|
|
|
table.ajax.reload(null, false);
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
function disablePlugin(name) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "?action=disable&name=" + name,
|
|
dataType: "json",
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
toastr.warning(json.msg);
|
|
|
|
table.ajax.reload(null, false);
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
|
|
function deletePlugin(name) {
|
|
swal({
|
|
text: trans('admin.confirmDeletion'),
|
|
type: 'warning',
|
|
showCancelButton: true
|
|
}).then(function() {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "?action=delete&name=" + name,
|
|
dataType: "json",
|
|
success: function(json) {
|
|
if (json.errno == 0) {
|
|
toastr.success(json.msg);
|
|
|
|
$('tr[id=plugin-'+name+']').remove();
|
|
} else {
|
|
toastr.warning(json.msg);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
});
|
|
}
|
|
|
|
function downloadUpdates() {
|
|
var file_size = 0;
|
|
var progress = 0;
|
|
|
|
console.log("Prepared to download");
|
|
|
|
$.ajax({
|
|
url: './update/download?action=prepare-download',
|
|
type: 'GET',
|
|
dataType: 'json',
|
|
beforeSend: function() {
|
|
$('#update-button').html('<i class="fa fa-spinner fa-spin"></i> '+trans('admin.preparing')).prop('disabled', 'disabled');
|
|
},
|
|
})
|
|
.done(function(json) {
|
|
console.log(json);
|
|
|
|
file_size = json.file_size;
|
|
|
|
$('#file-size').html(file_size);
|
|
|
|
$('#modal-start-download').modal({
|
|
'backdrop': 'static',
|
|
'keyboard': false
|
|
});
|
|
|
|
console.log("started downloading");
|
|
$.ajax({
|
|
url: './update/download?action=start-download',
|
|
type: 'POST',
|
|
dataType: 'json'
|
|
})
|
|
.done(function(json) {
|
|
// set progress to 100 when got the response
|
|
progress = 100;
|
|
|
|
console.log("Downloading finished");
|
|
console.log(json);
|
|
})
|
|
.fail(showAjaxError);
|
|
|
|
var interval_id = window.setInterval(function() {
|
|
|
|
$('#imported-progress').html(progress);
|
|
$('.progress-bar').css('width', progress+'%').attr('aria-valuenow', progress);
|
|
|
|
if (progress == 100) {
|
|
clearInterval(interval_id);
|
|
|
|
$('.modal-title').html('<i class="fa fa-spinner fa-spin"></i> ' + trans('admin.extracting'));
|
|
$('.modal-body').append('<p>'+trans('admin.downloadCompleted')+'</p>')
|
|
|
|
console.log("Start extracting");
|
|
$.ajax({
|
|
url: './update/download?action=extract',
|
|
type: 'POST',
|
|
dataType: 'json'
|
|
})
|
|
.done(function(json) {
|
|
console.log("Package extracted and files are covered");
|
|
$('#modal-start-download').modal('toggle');
|
|
|
|
swal({
|
|
type: 'success',
|
|
html: json.msg
|
|
}).then(function() {
|
|
window.location = "../";
|
|
}, function(dismiss) {
|
|
window.location = "../";
|
|
});
|
|
})
|
|
.fail(showAjaxError);
|
|
|
|
} else {
|
|
$.ajax({
|
|
url: './update/download?action=get-file-size',
|
|
type: 'GET'
|
|
})
|
|
.done(function(json) {
|
|
progress = (json.size / file_size * 100).toFixed(2);
|
|
|
|
console.log("Progress: "+progress);
|
|
})
|
|
.fail(showAjaxError);
|
|
}
|
|
|
|
}, 300);
|
|
|
|
})
|
|
.fail(showAjaxError);
|
|
|
|
}
|
|
|
|
function initUsersTable() {
|
|
const rootPath = /(^https?:.*)\/admin\/users/.exec(window.location.href)[1];
|
|
$('#user-table').DataTable({
|
|
ajax: `${rootPath}/admin/user-data`,
|
|
scrollY: ($('.content-wrapper').height() - $('.content-header').outerHeight()) * 0.7,
|
|
columnDefs: [
|
|
{
|
|
targets: 0,
|
|
data: 'uid',
|
|
width: '1%'
|
|
},
|
|
{
|
|
targets: 1,
|
|
data: 'email'
|
|
},
|
|
{
|
|
targets: 2,
|
|
data: 'nickname'
|
|
},
|
|
{
|
|
targets: 3,
|
|
data: 'score',
|
|
render: data => {
|
|
return `<input type="number" class="form-control score" value="${data}" title="${trans('admin.scoreTip')}" data-toggle="tooltip" data-placement="right">`;
|
|
}
|
|
},
|
|
{
|
|
targets: 4,
|
|
data: 'permission',
|
|
render: data => {
|
|
switch (data) {
|
|
case -1:
|
|
return trans('admin.banned');
|
|
case 0:
|
|
return trans('admin.normal');
|
|
case 1:
|
|
return trans('admin.admin');
|
|
case 2:
|
|
return trans('admin.superAdmin');
|
|
}
|
|
}
|
|
},
|
|
{
|
|
targets: 5,
|
|
data: 'register_at'
|
|
},
|
|
{
|
|
targets: 6,
|
|
data: 'operations',
|
|
searchable: false,
|
|
orderable: false,
|
|
render: (data, type, row) => {
|
|
let operationsHtml, adminOption = '', bannedOption = '', deleteUserButton;
|
|
if (row.permission !== 2) {
|
|
if (data === 2) {
|
|
if (row.permission === 1) {
|
|
adminOption = `<li class="divider"></li>
|
|
<li><a id="admin" href="javascript:changeAdminStatus(${row.uid});">${trans('admin.unsetAdmin')}</a></li>`;
|
|
} else {
|
|
adminOption = `<li class="divider"></li>
|
|
<li><a id="admin" href="javascript:changeAdminStatus(${row.uid});">${trans('admin.setAdmin')}</a></li>`;
|
|
}
|
|
}
|
|
if (row.permission === -1) {
|
|
bannedOption = `<li class="divider"></li>
|
|
<li><a id="ban" href="javascript:changeBanStatus(${row.uid});">${trans('admin.unban')}</a></li>`;
|
|
} else {
|
|
bannedOption = `<li class="divider"></li>
|
|
<li><a id="ban" href="javascript:changeBanStatus(${row.uid});">${trans('admin.ban')}</a></li>`;
|
|
}
|
|
}
|
|
|
|
if (data === 2) {
|
|
if (row.permission === 2) {
|
|
deleteUserButton = `
|
|
<a class="btn btn-danger btn-sm" disabled="disabled" data-toggle="tooltip" data-placement="bottom" title="${trans('admin.cannotDeleteSuperAdmin')}">${trans('admin.deleteUser')}</a>`;
|
|
} else {
|
|
deleteUserButton = `
|
|
<a class="btn btn-danger btn-sm" href="javascript:deleteUserAccount(${row.uid});">${trans('admin.deleteUser')}</a>`;
|
|
}
|
|
} else {
|
|
if (row.permission === 1 || row.permission === 2) {
|
|
deleteUserButton = `
|
|
<a class="btn btn-danger btn-sm" disabled="disabled" data-toggle="tooltip" data-placement="bottom" title="${trans('admin.cannotDeleteAdmin')}">${trans('admin.deleteUser')}</a>`;
|
|
} else {
|
|
deleteUserButton = `
|
|
<a class="btn btn-danger btn-sm" href="javascript:deleteUserAccount(${row.uid});">${trans('admin.deleteUser')}</a>`;
|
|
}
|
|
}
|
|
|
|
return `
|
|
<div class="btn-group">
|
|
<button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
${trans('admin.operationsTitle')} <span class="caret"></span></button>
|
|
<ul class="dropdown-menu">
|
|
<li><a href="javascript:changeUserEmail(${row.uid});">${trans('admin.changeEmail')}</a></li>
|
|
<li><a href="javascript:changeUserNickName(${row.uid});">${trans('admin.changeNickName')}</a></li>
|
|
<li><a href="javascript:changeUserPwd(${row.uid});">${trans('admin.changePassword')}</a></li>
|
|
${adminOption}${bannedOption}
|
|
</ul>
|
|
</div>
|
|
${deleteUserButton}`;
|
|
}
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
function initPlayersTable() {
|
|
const rootPath = /(^https?:.*)\/admin\/players/.exec(window.location.href)[1];
|
|
$('#player-table').DataTable({
|
|
ajax: `${rootPath}/admin/player-data`,
|
|
scrollY: ($('.content-wrapper').height() - $('.content-header').outerHeight()) * 0.7,
|
|
columnDefs: [
|
|
{
|
|
targets: 0,
|
|
data: 'pid',
|
|
width: '1%'
|
|
},
|
|
{
|
|
targets: 1,
|
|
data: 'uid'
|
|
},
|
|
{
|
|
targets: 2,
|
|
data: 'player_name'
|
|
},
|
|
{
|
|
targets: 3,
|
|
data: 'preference',
|
|
render: data => {
|
|
return `
|
|
<select class="form-control" onchange="changePreference.call(this)">
|
|
<option ${(data == "default") ? 'selected=selected' : ''} value="default">Default</option>
|
|
<option ${(data == "slim") ? 'selected=selected' : ''} value="slim">Slim</option>
|
|
</select>`;
|
|
}
|
|
},
|
|
{
|
|
targets: 4,
|
|
searchable: false,
|
|
orderable: false,
|
|
render: (data, type, row) => {
|
|
let html = { steve: '', alex: '', cape: '' };
|
|
['steve', 'alex', 'cape'].forEach(textureType => {
|
|
if (row['tid_' + textureType] === 0) {
|
|
html[textureType] = `<img id="${row.pid}-${row['tid_' + textureType]}" width="64" />`;
|
|
} else {
|
|
html[textureType] = `
|
|
<a href="${rootPath}/skinlib/show/${row['tid_' + textureType]}">
|
|
<img id="${row.pid}-${row['tid_' + textureType]}" width="64" src="${rootPath}/preview/64/${row['tid_' + textureType]}.png" />
|
|
</a>`;
|
|
}
|
|
});
|
|
return html.steve + html.alex + html.cape;
|
|
}
|
|
},
|
|
{
|
|
targets: 5,
|
|
data: 'last_modified'
|
|
},
|
|
{
|
|
targets: 6,
|
|
searchable: false,
|
|
orderable: false,
|
|
render: (data, type, row) => {
|
|
return `
|
|
<div class="btn-group">
|
|
<button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
${trans('admin.operationsTitle')} <span class="caret"></span></button>
|
|
<ul class="dropdown-menu">
|
|
<li><a href="javascript:changeTexture(${row.pid}, '${row.player_name}');">${trans('admin.changeTexture')}</a></li>
|
|
<li><a href="javascript:changeOwner(${row.pid});">${trans('admin.changeOwner')}</a></li>
|
|
</ul>
|
|
</div>
|
|
<a class="btn btn-danger btn-sm" href="javascript:deletePlayer(${row.pid});">${trans('admin.deletePlayer')}</a>`;
|
|
}
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
function initPluginsTable() {
|
|
const rootPath = /(^https?:.*)\/admin\/plugins\/manage/.exec(window.location.href)[1];
|
|
$('#plugin-table').DataTable({
|
|
ajax: `${rootPath}/admin/plugins/data`,
|
|
columnDefs: [
|
|
{
|
|
targets: 0,
|
|
data: 'title'
|
|
},
|
|
{
|
|
targets: 1,
|
|
data: 'description',
|
|
width: '35%'
|
|
},
|
|
{
|
|
targets: 2,
|
|
data: 'author',
|
|
render: data => {
|
|
if (data.url === '' || data.url === null) {
|
|
return data.author;
|
|
} else {
|
|
return `<a href="${data.url}" target="_blank">${data.author}</a>`;
|
|
}
|
|
}
|
|
},
|
|
{
|
|
targets: 3,
|
|
data: 'version'
|
|
},
|
|
{
|
|
targets: 4,
|
|
data: 'status'
|
|
},
|
|
{
|
|
targets: 5,
|
|
data: 'operations',
|
|
searchable: false,
|
|
orderable: false,
|
|
render: (data, type, row) => {
|
|
let switchEnableButton, configViewButton, deletePluginButton;
|
|
if (data.enabled) {
|
|
switchEnableButton = `
|
|
<a class="btn btn-warning btn-sm" href="javascript:disablePlugin('${row.name}');">${trans('admin.disablePlugin')}</a>`;
|
|
} else {
|
|
switchEnableButton = `
|
|
<a class="btn btn-primary btn-sm" href="javascript:enablePlugin('${row.name}');">${trans('admin.enablePlugin')}</a>`;
|
|
}
|
|
if (data.enabled && data.hasConfigView) {
|
|
configViewButton = `
|
|
<a class="btn btn-default btn-sm" href="${rootPath}/admin/plugins/config/${row.name}">${trans('admin.configurePlugin')}</a>`;
|
|
} else {
|
|
configViewButton = `
|
|
<a class="btn btn-default btn-sm" disabled="disabled" title="${trans('admin.noPluginConfigNotice')}" data-toggle="tooltip" data-placement="top">${trans('admin.configurePlugin')}</a>`;
|
|
}
|
|
deletePluginButton = `
|
|
<a class="btn btn-danger btn-sm" href="javascript:deletePlugin('${row.name}');">${trans('admin.deletePlugin')}</a>`;
|
|
return switchEnableButton + configViewButton + deletePluginButton;
|
|
}
|
|
}
|
|
]
|
|
});
|
|
}
|