Files
librenms-librenms/resources/views/components/select.blade.php
Tony Murray 075ba4c932 Ports UI update (#16115)
* WIP Device Ports porting to Laravel

* WIP port links

* Port Links WIP

* Port Links

* in_array -> isset

* Add request to DeviceTab data

* Add initial Pagination

* Missing select component

* Collapsed and expandable port neighbors
New expandable component

* Port sorting

* Fix port transfer

* Use menu entries to filter ports

* Add translatable strings

* style fixes and cleanup

* update css

* graph views and tidy controller
basic port link view

* cleanup

* port row blade to reuse in legacy port view

* Legacy tab url handling
work properly in subdirectory
remove includes from sub tab directory to prevent oddity

* fallback to detail list when the view doesn't exist

* Use named variable to simplify

* Fix issue from file that was a symlink

* Submenu handle sub items and query string urls

* extract pageLinks to improve readability

* fix typo

* Apply fixes from StyleCI

* phpstan was not happy using the relationship HasMany query

* Don't allow *bps etc to be on a second line

* Improve table on small screens

* Fix sort

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
2024-06-16 11:29:06 -05:00

23 lines
1.2 KiB
PHP

@props(['label', 'name', 'options', 'selected', 'hint'])
<div {{ $attributes }}>
@isset($label)
<label for="{{ $name }}" class="tw-mb-0 tw-text-sm tw-leading-5 tw-font-medium tw-text-gray-700 dark:tw-text-gray-400">
{{ $label }}
</label>
@endif
<select id="{{ $name }}" class="tw-p-5px tw-text-sm tw-bg-gray-50 tw-border tw-border-gray-300 tw-text-gray-900 tw-rounded-lg focus:tw-ring-blue-500 focus:tw-border-blue-500 tw-p-1 dark:tw-bg-gray-700 dark:tw-border-gray-600 dark:tw-placeholder-gray-400 dark:tw-text-white dark:tw-focus:ring-blue-500 dark:focus:tw-border-blue-500">
<option hidden disabled @empty($selected)selected @endempty>{{ $hint ?? __('Choose') }}</option>
@foreach($options ?? [] as $option)
<option value="{{ $option['value'] ?? $option }}"
@if(isset($selected) && $selected == ($option['value'] ?? $option))selected @endif
>
@isset($option['icon'])
<i class="fa fa-fw fa-lg {{ $option['icon'] }}"></i>
@endisset
{{ $option['text'] ?? $option }}
</option>
@endforeach
</select>
</div>