console.log();
let fsl_list = JSON.parse('{{mod.fsl_account_list|json_encode|raw}}');
let uchip = null;
let fsl_table = null;
$(document).ready(function() {
uchip = new Uchip();
list();
});
function list() {
$.ajax({
type: "POST",
url: "?module=files_system_lock&acc=listprotect",
contentType: "application/json",
complete: function (datos) {
var linejson = JSON.parse( datos.responseText );
//alert(linejson.aaData);
var str = linejson.aaData;
//console.log(Object.keys(str));
var trtable='';
$.each(str, function( index, value ) {
var domain = value.domain;
var type = value.type;
var path = value.path;
var st = value.st;
var code = value.code;
if (st == 0){
var newst='
{{ langmod.FPLABEL11 }}
';
}else{
var newst='
{{ langmod.FPLABEL12 }}
';
}
var addbtn='';
if(type=='file'){
addbtn='';
}
trtable+='
\n' +
'
'+domain+'
\n' +
'
'+type+'
\n' +
'
'+path+'
\n' +
'
'+newst+'
\n' +
'
\n' +
'' +addbtn+
'
\n' +
'
';
//alert( index + ": " + value +" "+value.domain);
});
$('#tbfsl').DataTable().destroy();
$("#table_tbody_fsl").html(trtable);
$('#tbfsl').DataTable();
$("#table_fsl_container").hide();
return false;
}
});
}
function sendPath(){
var path =Base64.encode($("#pathdomain").val());
var name =$("#desc").val();
if (path==''){
noti_bubble('Cannot lock home directory','','error',false,false,'3000',true);
return false;
}else{
$(".btn-save-fsl").attr('disabled',true);
$(".btn-save-fsl").addClass('disabled');
var text=$("#sendPath").text();
$(".btn-save-fsl").html(' '+text);
uchip.call('module=files_system_lock&acc=savefiles', {
data: 'path='+path+"&name="+name,
callback: function(response){
list();
cancelForm();
$(".btn-save-fsl").attr('disabled',fale);
$(".btn-save-fsl").removeClass('disabled');
$(".btn-save-fsl").html(text);hhh,
}
});
}
}
function displaynewForm(){
$('#fsl_list_wrapper').slideUp('fast', function(){
$('#fsl_form').slideDown('fast');
});
}
function cancelForm(){
$('#fsl_form').slideUp('fast', function(){
$('#directoryfsl').val('public_html');
$('#fsl_list_wrapper').slideDown('fast');
});
}
function changest(path,indice){
$("#stbtn_"+indice).attr('disabled',true);
$("#stbtn_"+indice).addClass('disabled');
$("#stbtn_"+indice).html('');
$.ajax({
type: "POST",
data: "path="+path,
url: "?module=files_system_lock&acc=changest",
complete: function (datos) {
noti_bubble('Action executed successfully','','success',false,false,'3000',true);
//console.log(datos);
list();
}
});
}
function showExplorer(){
$('#dir_explorer_domain .modal-body').html('
');
$('#dir_explorer_domain').modal('show');
callDirList($('#dirsel').text());
}
function callDirList(directory){
uchip.handleButton('#sel_path_btn', 'fa-thumb-tack');
$('#dir_explorer_domain .modal-body').html('