{# # --------------------------------------------------------------------- # # GLPI - Gestionnaire Libre de Parc Informatique # # http://glpi-project.org # # @copyright 2015-2024 Teclib' and contributors. # @copyright 2003-2014 by the INDEPNET Development Team. # @licence https://www.gnu.org/licenses/gpl-3.0.html # # --------------------------------------------------------------------- # # LICENSE # # This file is part of GLPI. # # 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, either version 3 of the License, or # (at your option) any later version. # # 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. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # --------------------------------------------------------------------- #} {% import 'components/form/fields_macros.html.twig' as fields %} {% set no_header = no_header|default(not item.isNewItem() and not _get._in_modal|default(false)) %} {% set bg = '' %} {% if item.isDeleted() %} {% set bg = 'asset-deleted' %} {% endif %}
{{ include('components/form/header.html.twig', {'in_twig': true}) }} {% set rand = random() %} {% set params = params ?? [] %} {% set target = params['target'] ?? item.getFormURL() %} {% set withtemplate = params['withtemplate'] ?? '' %} {% set item_type = item.getType() %} {% set field_options = { 'locked_fields': item.getLockedFields(), 'rand': rand, } %}
{{ fields.htmlField( 'name', item.fields['name'], __('Name'), field_options ) }} {{ fields.htmlField( 'agenttypes_id', get_item_name('AgentType', item.fields['agenttypes_id']), _n('Agent type', 'Agents types', 1), field_options ) }} {{ fields.dropdownYesNo( 'locked', item.fields['locked'], __('Locked'), field_options ) }} {{ fields.htmlField( 'deviceid', item.fields['deviceid'], __('Device ID'), field_options ) }} {{ fields.numberField( 'port', item.fields['port'], _n('Port', 'Ports', 1), field_options ) }} {{ fields.htmlField( "Agent", item.fields['remote_addr'], __('Public contact address'), field_options ) }} {{ fields.htmlField( "itemtype", item.fields['itemtype']|itemtype_name, __('Item type'), field_options ) }} {% if not item.isNewItem() %} {% set asset_item = get_item(item.fields['itemtype'], item.fields['items_id']) %} {{ fields.htmlField( 'items_id', asset_item.getLink(), __('Item link'), field_options ) }} {% set versions %} {% set versions_array = call("importArrayFromDB", [versions_field]) %} {% if versions_array|length %}
    {% for module, version in versions_array %}
  • {{ module }}: {{ version }}
  • {% endfor %}
{% elseif versions_field|length %} {{ versions_field }} {% endif %} {% endset %} {{ fields.htmlField( 'versions', versions, _n('Version', 'Versions', 1), field_options ) }} {{ fields.htmlField( 'tag', item.fields['tag'], __('Tag'), field_options ) }} {{ fields.htmlField( 'useragent', item.fields['useragent'], __('Useragent'), field_options ) }} {{ fields.htmlField( 'last_contact', call("Html::convDateTime", [item.fields['last_contact']]), __('Last contact'), field_options ) }}
{{ __('Agent configuration') }}
{% for netfield, netlabel in { 'threads_networkdiscovery': __('Network discovery threads'), 'timeout_networkdiscovery': __('Network discovery timeout'), 'threads_networkinventory': __('Network inventory threads'), 'timeout_networkinventory': __('Network inventory timeout'), } %} {% set general = __('General setup') %} {% if config(netfield) != null %} {% set general = "%1$s (%2$s)"|format(general, config(netfield)) %} {% endif %} {{ fields.dropdownNumberField( netfield, item.fields[netfield], netlabel, field_options|merge({ 'min': 1, 'toadd': [ general ] }) ) }} {% endfor %}
{{ __('Supported tasks') }} ?
{% for modulefield, modulelabel in { 'use_module_wake_on_lan': __('Wake on LAN'), 'use_module_computer_inventory': __('Computer inventory'), 'use_module_esx_remote_inventory': __('ESX remote inventory'), 'use_module_network_inventory': __('Network inventory (SNMP)'), 'use_module_network_discovery': __('Network discovery (SNMP)'), 'use_module_package_deployment': __('Package Deployment'), 'use_module_collect_data': __('Collect data'), 'use_module_remote_inventory': __('Remote inventory'), } %} {% if item.fields[modulefield] %} {% set html = '' %} {% else %} {% set html = '' %} {% endif %} {{ fields.htmlField('', html, modulelabel) }} {% endfor %} {% endif %}
{# .row #}
{# .row #}
{# .flex-row #}
{# .card-body #} {% if no_form_buttons is not defined or no_form_buttons == false %} {{ include('components/form/buttons.html.twig') }} {% endif %} {% if params['formfooter'] is null or params['formfooter'] == true %} {% endif %}