pandorafms/pandora_console/godmode/setup/os.list.php

100 lines
3.6 KiB
PHP
Raw Normal View History

<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
2020-11-27 13:52:35 +01:00
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
global $config;
check_login();
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
include 'general/noaccess.php';
return;
}
2015-06-25 10:07:53 +02:00
$table = new stdClass();
2015-06-16 16:09:50 +02:00
$table->width = '100%';
$table->class = 'info_table';
2015-06-16 16:09:50 +02:00
$table->head[0] = '';
$table->head[1] = __('ID');
$table->head[2] = __('Name');
$table->head[3] = __('Description');
$table->head[4] = '';
$table->align[0] = 'center';
$table->align[4] = 'center';
$table->size[0] = '20px';
$table->size[4] = '20px';
// Prepare pagination.
$offset = (int) get_parameter('offset');
$limit = $config['block_size'];
$count_osList = db_get_value('count(*)', 'tconfig_os');
$osList = db_get_all_rows_filter(
'tconfig_os',
[
'offset' => $offset,
'limit' => $limit,
]
);
2012-06-14 Miguel de Dios <miguel.dedios@artica.es> * include/functions_html.php, include/functions_reporting.php, include/functions_groups.php, include/functions_visual_map.php, include/ajax/reporting.ajax.php, include/functions_ui.php, extensions/agents_modules.php, extensions/module_groups.php, operation/incidents/incident.php, operation/incidents/incident_detail.php, operation/agentes/status_monitor.php, operation/agentes/estado_ultimopaquete.php, operation/agentes/estado_agente.php, operation/agentes/ver_agente.php, operation/snmpconsole/snmp_view.php. operation/integria_incidents/incident.incident.php, mobile/operation/agents/monitor_status.php, mobile/operation/agents/view_agents.php, mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php, godmode/groups/modu_group_list.php, godmode/groups/group_list.php, godmode/agentes/module_manager.php, godmode/agentes/modificar_agente.php, godmode/agentes/configurar_agente.php, godmode/alerts/alert_list.list.php, godmode/setup/os.list.php, godmode/users/configure_user.php, godmode/modules/manage_network_templates.php, godmode/reporting/reporting_builder.list_items.php, godmode/tag/tag.php: changed the calls of "ui_print_truncate_text" now we are trying that more easy and standar, now the string name of agent have the equal number of characters in all code...but there are two styles, small and medium size for agents text name, modules text name, but description is only size. You can set this sizes in the visual setup page into your Pandora. MERGED from 4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-06-14 18:23:23 +02:00
if ($osList === false) {
$osList = [];
}
$table->data = [];
foreach ($osList as $os) {
$data = [];
$data[] = ui_print_os_icon($os['id_os'], false, true);
$data[] = $os['id_os'];
if (is_metaconsole()) {
$data[] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=edit&tab2=builder&id_os='.$os['id_os'].'">'.io_safe_output($os['name']).'</a>';
} else {
$data[] = '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&action=edit&tab=builder&id_os='.$os['id_os'].'">'.io_safe_output($os['name']).'</a>';
}
$data[] = ui_print_truncate_text(io_safe_output($os['description']), 'description', true, true);
$table->cellclass[][4] = 'action_buttons';
if ($os['id_os'] > 16) {
if (is_metaconsole()) {
$data[] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=delete&tab2=list&id_os='.$os['id_os'].'">'.html_print_image('images/cross.png', true).'</a>';
} else {
$data[] = '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&action=delete&tab=list&id_os='.$os['id_os'].'">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
}
} else {
// The original icons of pandora don't delete.
$data[] = '';
}
$table->data[] = $data;
}
2012-06-14 Miguel de Dios <miguel.dedios@artica.es> * include/functions_html.php, include/functions_reporting.php, include/functions_groups.php, include/functions_visual_map.php, include/ajax/reporting.ajax.php, include/functions_ui.php, extensions/agents_modules.php, extensions/module_groups.php, operation/incidents/incident.php, operation/incidents/incident_detail.php, operation/agentes/status_monitor.php, operation/agentes/estado_ultimopaquete.php, operation/agentes/estado_agente.php, operation/agentes/ver_agente.php, operation/snmpconsole/snmp_view.php. operation/integria_incidents/incident.incident.php, mobile/operation/agents/monitor_status.php, mobile/operation/agents/view_agents.php, mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php, godmode/groups/modu_group_list.php, godmode/groups/group_list.php, godmode/agentes/module_manager.php, godmode/agentes/modificar_agente.php, godmode/agentes/configurar_agente.php, godmode/alerts/alert_list.list.php, godmode/setup/os.list.php, godmode/users/configure_user.php, godmode/modules/manage_network_templates.php, godmode/reporting/reporting_builder.list_items.php, godmode/tag/tag.php: changed the calls of "ui_print_truncate_text" now we are trying that more easy and standar, now the string name of agent have the equal number of characters in all code...but there are two styles, small and medium size for agents text name, modules text name, but description is only size. You can set this sizes in the visual setup page into your Pandora. MERGED from 4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-06-14 18:23:23 +02:00
if (isset($data)) {
ui_pagination($count_osList, ui_get_url_refresh(['message' => false]), $offset);
html_print_table($table);
ui_pagination($count_osList, ui_get_url_refresh(['message' => false]), $offset, 0, false, 'offset', true, 'pagination-bottom');
} else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined operating systems') ]);
}
if (is_metaconsole()) {
echo '<form method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=builder">';
echo "<div style='text-align:right;width:".$table->width."'>";
html_print_submit_button(__('Create OS'), '', false, 'class="sub next"');
echo '</div>';
echo '</form>';
}