#9334 Fixed satellite host 2

This commit is contained in:
Daniel Maya 2022-09-29 16:17:41 +02:00
parent 6babb50608
commit ee83cbf155

View File

@ -291,8 +291,9 @@ class SatelliteAgent extends HTML
$agents_db = db_get_all_rows_sql( $agents_db = db_get_all_rows_sql(
sprintf( sprintf(
'SELECT id_agente, alias AS name, direccion AS address, 'SELECT id_agente, alias AS name, direccion AS address,
IF(disabled = 0, INSERT("add_host", 0 , 0, ""), INSERT("ignore_host", 0 , 0, "")) AS type IF(disabled = 0, INSERT("add_host", 0 , 0, ""),
FROM tagente WHERE `satellite_server` = %d AND modo = 1', IF(modo = 1, INSERT("ignore_host", 0 , 0, ""), INSERT("delete_host", 0, 0, ""))) AS type
FROM tagente WHERE `satellite_server` = %d',
$this->satellite_server $this->satellite_server
) )
); );
@ -1279,6 +1280,7 @@ class SatelliteAgent extends HTML
$.each(checks, function(i, val) { $.each(checks, function(i, val) {
const params = val.value.split(","); const params = val.value.split(",");
if (action === '0') { if (action === '0') {
if (params[2] === '0') {
$.ajax({ $.ajax({
method: 'post', method: 'post',
async: false, async: false,
@ -1300,7 +1302,9 @@ class SatelliteAgent extends HTML
console.error(e); console.error(e);
} }
}); });
}
} else { } else {
if (params[3] === '0') {
$.ajax({ $.ajax({
method: 'post', method: 'post',
async: false, async: false,
@ -1323,6 +1327,7 @@ class SatelliteAgent extends HTML
} }
}); });
} }
}
}); });
var dt_satellite_agents = $("#satellite_agents").DataTable(); var dt_satellite_agents = $("#satellite_agents").DataTable();