PenetrationTestingScripts/Weak_Password/Fuxi-Scanner/fuxi/static/js/server/plugin-management.js

81 lines
2.5 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

function delete_plugin(nid){
const data = {
"delete": nid,
};
swal({
title: "Are you sure you want to delete?",
text: "If you delete an item, it will be permanently lost",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Delete",
closeOnConfirm: false
},
function(){
$.ajax({
type: 'GET',
url: '/plugin-management',
data: data,
success: function() {
location.href = "/plugin-management";
},
error: function(xhr, type) {}
});
});
}
function plugin_info(nid){
const data = {
"info": nid,
};
$.ajax({
type: 'GET',
url: '/plugin-management',
data: data,
dataType: 'json',
success: function(result) {
$('#plugin_info').html(JSON.stringify(result, null, 4));
},
error: function(xhr, type) {
}
});
}
$('#sampleTable').DataTable();
Dropzone.autoDiscover = false;
$(".dropzone").dropzone({
url: "plugin-upload",
init: function() {
this.on("complete", function (data) {
const res = eval('(' + data.xhr.responseText + ')');
if (res.result === "success") {
swal({
title: "Upload Completed",
text: "",
type: "success",
confirmButtonColor: "#DD6B55",
confirmButtonText: "OK",
closeOnConfirm: false
},
function(){
location.href = "/plugin-management";
});
} else {
swal({
title: "Upload Error",
text: "<p>Plugin Developer Guide: <a href=\"https://github.com/knownsec/Pocsuite/blob/master/docs/CODING.md\" target=\"view_window\">Pocsuite PoC </a></p>",
html: true,
type: "error",
confirmButtonColor: "#DD6B55",
confirmButtonText: "OK",
closeOnConfirm: false
},
function(){
location.href = "/plugin-management";
});
}
});
}
});