Files
librenms-librenms/resources/views/widgets/settings/availability-map.blade.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
4.6 KiB
PHP
Raw Normal View History

@extends('widgets.settings.base')
@section('form')
<div class="form-group">
<label for="title-{{ $id }}" class="control-label">{{ __('Widget title') }}</label>
<input type="text" class="form-control" name="title" id="title-{{ $id }}" placeholder="{{ __('Custom title for widget') }}" value="{{ $title }}">
</div>
<div class="form-group">
<label for="type-{{ $id }}" class="control-label">{{ __('Display type') }}</label>
<select class="form-control" name="type" id="type-{{ $id }}" onchange="toggle_availability_type(this, '{{ $id }}');">
<option value="0" @if($type == 0) selected @endif>{{ __('boxes') }}</option>
<option value="1" @if($type == 1) selected @endif>{{ __('compact') }}</option>
</select>
</div>
<div class="form-group" id="color_only_select-group-{{ $id }}" style="display: {{ $type == 0 ? 'block' : 'none' }};">
Add additional sorting options for Availability Map (#14073) * Fix IPv6 in service check host (#13939) * Add hostName cleaning to Clean * Apply RFC 5952 formatting to Clean::hostName output * Use more liberal cleaning for hostnames * Remove unwanted whitespace * Apply Clean::hostName() to all relevant fields * Fix docstring * Use IP::isValid inline * Update Clean.php * Update services.inc.php Co-authored-by: Tony Murray <murraytony@gmail.com> * Add sorting support for additional columns + dual column Additional columns are Display Name (display) and System Name (sysName) Dual column means that first is sorted after status, then within each status group another sort is done (every columns from single column sorting is possible). * Change code for styleCI * Expand availability map sorting menu Also change sysName to System Name – there is no real reason for that short form. * Add german translation for avail. map sorting/display options * Adjust sorting behaviour in Availability Map The dropdown now presents two options: - Display Text: Sort by the selected value of the dropdown 'Display Text' - Status: Sort by status, then by selected value of dropdown 'Display Text' As the field 'display' (The display name) may contain template functions etc., sorting is not done by SQL means; instead custom sorting is done within the controller. * Apply fix for styleCI * Apply fix for styleCI, part 2 * Update availability-map.blade.php * Update availability-map.blade.php * Update availability-map.blade.php * Update de.json * Update AvailabilityMapController.php * Update AvailabilityMapController.php * Update availability-map.blade.php * Update de.json Co-authored-by: Sander Steffann <sander@steffann.nl> Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-08 03:02:00 +02:00
<label for="color_only_select-{{ $id }}" class="control-label">{{ __('Label') }}</label>
<select class="form-control" name="color_only_select" id="color_only_select-{{ $id }}">
<option value="1" @if($color_only_select == 1) selected @endif>{{ __('empty') }}</option>
<option value="4" @if($color_only_select == 4) selected @endunless>{{ __('Display Name') }}</option>
<option value="2" @if($color_only_select == 2) selected @endunless>{{ __('Hostname') }}</option>
Add additional sorting options for Availability Map (#14073) * Fix IPv6 in service check host (#13939) * Add hostName cleaning to Clean * Apply RFC 5952 formatting to Clean::hostName output * Use more liberal cleaning for hostnames * Remove unwanted whitespace * Apply Clean::hostName() to all relevant fields * Fix docstring * Use IP::isValid inline * Update Clean.php * Update services.inc.php Co-authored-by: Tony Murray <murraytony@gmail.com> * Add sorting support for additional columns + dual column Additional columns are Display Name (display) and System Name (sysName) Dual column means that first is sorted after status, then within each status group another sort is done (every columns from single column sorting is possible). * Change code for styleCI * Expand availability map sorting menu Also change sysName to System Name – there is no real reason for that short form. * Add german translation for avail. map sorting/display options * Adjust sorting behaviour in Availability Map The dropdown now presents two options: - Display Text: Sort by the selected value of the dropdown 'Display Text' - Status: Sort by status, then by selected value of dropdown 'Display Text' As the field 'display' (The display name) may contain template functions etc., sorting is not done by SQL means; instead custom sorting is done within the controller. * Apply fix for styleCI * Apply fix for styleCI, part 2 * Update availability-map.blade.php * Update availability-map.blade.php * Update availability-map.blade.php * Update de.json * Update AvailabilityMapController.php * Update AvailabilityMapController.php * Update availability-map.blade.php * Update de.json Co-authored-by: Sander Steffann <sander@steffann.nl> Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-08 03:02:00 +02:00
<option value="3" @if($color_only_select == 3) selected @endunless>{{ __('SNMP sysName') }}</option>
<option value="0" @unless($color_only_select) selected @endunless>{{ __('Status') }}</option>
</select>
</div>
<div class="form-group" id="tile_size-group-{{ $id }}" style="display: {{ $type == 1 ? 'block' : 'none' }};">
<label for="tile_size-{{ $id }}" class="control-label">{{ __('Tile size') }}</label>
<input type="text" class="form-control" name="tile_size" id="tile_size-{{ $id }}" placeholder="{{ __('Tile size') }}" value="{{ $tile_size }}">
</div>
<div class="form-group">
<label for="show_disabled_and_ignored-{{ $id }}" class="control-label">{{ __('Disabled polling/alerting') }}</label>
<select class="form-control" name="show_disabled_and_ignored" id="show_disabled_and_ignored-{{ $id }}">
<option value="1" @if($show_disabled_and_ignored) selected @endif>{{ __('Show') }}</option>
<option value="0" @unless($show_disabled_and_ignored) selected @endunless>{{ __('Hide') }}</option>
</select>
</div>
<div class="form-group">
<label for="mode_select-{{ $id }}" class="control-label">{{ __('Mode select') }}</label>
<select class="form-control" name="mode_select" id="mode_select-{{ $id }}">
<option value="0" @if($mode_select == 0) selected @endif>{{ __('only devices') }}</option>
@config('show_services')
<option value="1" @if($mode_select == 1) selected @endif>{{ __('only services') }}</option>
<option value="2" @if($mode_select == 2) selected @endif>{{ __('devices and services') }}</option>
@endconfig
</select>
</div>
<div class="form-group">
<label for="order_by-{{ $id }}" class="control-label">{{ __('Order By') }}</label>
<select class="form-control" name="order_by" id="order_by-{{ $id }}">
Add additional sorting options for Availability Map (#14073) * Fix IPv6 in service check host (#13939) * Add hostName cleaning to Clean * Apply RFC 5952 formatting to Clean::hostName output * Use more liberal cleaning for hostnames * Remove unwanted whitespace * Apply Clean::hostName() to all relevant fields * Fix docstring * Use IP::isValid inline * Update Clean.php * Update services.inc.php Co-authored-by: Tony Murray <murraytony@gmail.com> * Add sorting support for additional columns + dual column Additional columns are Display Name (display) and System Name (sysName) Dual column means that first is sorted after status, then within each status group another sort is done (every columns from single column sorting is possible). * Change code for styleCI * Expand availability map sorting menu Also change sysName to System Name – there is no real reason for that short form. * Add german translation for avail. map sorting/display options * Adjust sorting behaviour in Availability Map The dropdown now presents two options: - Display Text: Sort by the selected value of the dropdown 'Display Text' - Status: Sort by status, then by selected value of dropdown 'Display Text' As the field 'display' (The display name) may contain template functions etc., sorting is not done by SQL means; instead custom sorting is done within the controller. * Apply fix for styleCI * Apply fix for styleCI, part 2 * Update availability-map.blade.php * Update availability-map.blade.php * Update availability-map.blade.php * Update de.json * Update AvailabilityMapController.php * Update AvailabilityMapController.php * Update availability-map.blade.php * Update de.json Co-authored-by: Sander Steffann <sander@steffann.nl> Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-08 03:02:00 +02:00
<option value="label" @if($order_by == 'label') selected @endif>{{ __('Label') }}</option>
<option value="status" @if($order_by == 'status') selected @endif>{{ __('Status') }}</option>
<option value="display-name" @if($order_by == 'display-name') selected @endif>{{ __('Display Name') }}</option>
</select>
</div>
<div class="form-group">
<label for="device_group-{{ $id }}" class="control-label">{{ __('Device group') }}</label>
<select class="form-control" name="device_group" id="device_group-{{ $id }}" data-placeholder="{{ __('All Devices') }}">
@if($device_group)
<option value="{{ $device_group->id }}" selected>{{ $device_group->name }}</option>
@endif
</select>
</div>
@endsection
@section('javascript')
<script type="text/javascript">
init_select2('#device_group-{{ $id }}', 'device-group', {});
function toggle_availability_type(el, id) {
if (el.value === '0') {
$('#tile_size-group-' + id).hide();
$('#color_only_select-group-' + id).show();
} else {
$('#tile_size-group-' + id).show();
$('#color_only_select-group-' + id).hide();
}
}
</script>
@endsection