Commit Graph

164 Commits

Author SHA1 Message Date
Jeremy Stretch
c684892a98 Closes #14871: Complete work on UI cleanup (#15341)
* Fix left padding of login button in top menu

* Relocate "add" buttons for embedded object tables

* Remove unused data template block & getNetboxData() utility function

* Remove bottom margin from last <p> element in rendered Markdown inside a table cell

* Prevent TomSelect from initializing on <select> elements with a size

* Fix styling of dropdown menu button for circuit commit rate

* Change .color-block to display: inline-block

* Delete unused static asset

* Improve contrast between menu group headings & items

* Remove custom color for attr-table row headings

* Fix border color of copy-to-clipboard button

* Fix toast text color in dark mode

* Fix rack elevation label/image toggles

* Increase border radius for small buttons

* Fix object selector
2024-03-04 15:55:01 -05:00
Jeremy Stretch
19f6b21b2a #14917: Nullify maxOptions for static select fields 2024-02-22 15:49:41 -05:00
Jeremy Stretch
f4a5a8cb33 Closes #13283: Add context to dropdown options (#15104)
* Initial work on #13283

* Enable passing TomSelect HTML template attibutes on DynamicModelChoiceField

* Merge disabled_indicator into option_attrs

* Add support for annotating a numeric count on dropdown options

* Annotate parent object on relevant fields

* Improve rendering of color options

* Improve rendering of color options

* Rename option_attrs to context

* Expose option context on ObjectVar for custom scripts

* Document dropdown context variables
2024-02-13 16:31:17 -05:00
Jeremy Stretch
3cf4464ed0 Remove unused Javascript 2024-02-09 16:30:14 -05:00
Jeremy Stretch
4f01d8f70e Closes #14917: Replace slim-select with tom-select (#15080)
* Experimenting

* Remove testing resources

* Replace ApiSelect with TomSelect

* Add color support

* Add clear button

* Clear cached options when searching dynamic selects

* Add support for static parameters

* Refactor TomSelect implementation

* Add dynamic parameter support

* Limit number of options to 100

* Remove redundant api_url definitions for user model

* Add support for disabled indicator

* Remove obsolete value-field attr on dynamic select widgets

* Remove obsolete fetch_trigger kwarg from dynamic model choice widgets

* Remove obsolete empty_label kwarg from dynamic model choice widgets

* Add support for API path variables

* Add support for setting a 'null' option

* Annotate depth for recursive hierarchies

* Misc cleanup

* Remove obsolete APISelect code

* Remove slim-select & just-debounce-it

* Clean up type validation

* Closes #14237: Clear child selections on change to parent selection

* Use an MD icon for the clear button

* Use an MD icon for the clear button

* Explain why noUnusedParameters is disabled
2024-02-08 15:07:04 -05:00
Jeremy Stretch
dbbcf49c1d Fix left padding of login button in top menu
Clean up spacing for nav pills

Markdown fields should default to using monospace font

Wrap action buttons in object page header

Fix page link style for non-HTMX paginators

Clean up styling of Markdown preview widget

Fix spacing around placeholder text for empty panel tables

Remove obsolete templates

Tweak checkbox input spacing

Fix toggling of clear button for quick search

Fix positioning of quick search filter dropdown

Fix positioning of 'highlight device' button

Fix styling for custom field group names

Widen buttons on nav menu items

Restyle the login page

Fix active nav-pill background color in dark mode

Fix spacing around 'map' button for sites
2024-01-31 17:59:14 -05:00
Jeremy Stretch
f430ca49c2 Closes #12128: Refresh the web UI to employ the Tabler CSS framework (#14833)
* Remove dark mode styling

* Condense & rename light mode stylesheet

* Upgrade to Bootstrap 5.3.2

* Swap out Bootstrap for Tabler; remove custom styling

* Update base page layout for Tabler

* Update login page

* Bump node to v18

* Update button styles

* Update object list view

* Tweak navbar size

* Clean up dashboard widgets

* Ditch separate stylesheet for print media

* Remove simplebar

* Remove obsolete sidebar styling

* Clean up object view template

* Clean up object edit template

* Standardize primary button sizing

* Clean up object list styling

* Add buttons for add & import to navigation menu

* Fix global search bar

* Fix slim-select form widget styling

* Fix toast styling

* Set base fonts

* Clean up paginator styling

* Clean up navigation menu group headings

* Clean up footer links

* Clean up card styles

* Move SVG styles to a designated directory

* Restructure SCSS files

* Remove obsolete/redundant dependencies

* Fix icon spacing

* Update background color classes

* Tweak banner & footer styling and spacing

* Fix badge background colors in table content

* Bump @types/bootstrap to 5.2.10

* Clean up form layouts

* Fix object selector button style

* Fix icon padding inside small buttons

* Fix icon & badge spacing inside buttons and tabs

* Hide paginator for empty pages

* Fix hover color for list items (Tabler bug #1694)

* Fix width of checkbox column in empty tables

* Clean up bulk edit template

* Fix border color of reslug button

* Package & serve Google fonts locally

* Fix tab styling

* Reduce vetical space at top of dashboard

* Remove obsolete content-wrapper template block

* Fix icon spacing in dropdown menu items

* Fix color label sizing

* Separate bulk delete form & object list into tabs

* Fix styling of filter group headings

* Fix styling for object changelog & journal views

* Standardize ordering & styling of action buttons

* Fix designation of active menu item

* Automatically expand menu section containing the active link

* Clean up nav menu styling

* Remove button colors; hide buttons except on hover/active

* Highlight menu group containing the active item

* Update & standardize alert styling

* Refactor base templates to ensure consistent display of header content

* Tweak styling for links inside badges

* Clean up top menu

* Fix JSON/YAML toggles for config context data

* Fix object template header

* Constrain tabs to container-xl; tweak header margins

* Fix object identifier styling

* Fix positioning of card header buttons

* Remove padding from HTMX tables inside cards

* Ensure consistent use of row headings in attribute tables

* Remove padding surrounding tables inside cards

* Remove obsolete CSS classes

* Misc cleanup of old styling

* Refactor 'controls' template block; ditch old classes

* Fix login button sizing

* Limit object edit form width

* Append asterisk to required form field labels

* Remove obsolete styling

* Remove obsolete styling

* Fix position of progress bar outside label

* Fix alignment of delete button in report/script lists

* Fix <pre> styling

* Clean up page headers

* Replace SVG icons with Material Design icons

* Restore dark mode togle functionality

* Fix top navbar background color under dark mode

* Rebuild static assets
2024-01-17 16:25:42 -05:00
kkthxbye
6d0fdcbc29 Fixes #12751 - Usability improvements for object selector (#14387)
* Usability improvements for object selector:
* Adds preselected filters
* Applies the filter on selection instead of requiring the search button to be pushed

* Declare selector_fields on base form class

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-12-15 16:07:15 -05:00
Jeremy Stretch
c191be971f Closes #13962: Add a copy-to-clipboard button to the key field of the API token creation form 2023-10-17 11:34:37 -04:00
Jeremy Stretch
4060e409a8 Fixes #13843: Fix assignment of VLAN group scope during bulk edit (#13887)
* Update VLANGroup bulk edit form to support all scope types

* Fixes #13843: Fix scope assignment for VLAN groups during bulk edit

* Add missed static file

* Restore graphiql static assets
2023-09-26 13:09:20 -04:00
Luke Anderson
ffcc2f5fcf Add Hide Disconnected Button to Interface Summary, Remove Unused Table Caption Descriptor - Close #12732 2023-09-26 09:56:33 -04:00
Jeremy Stretch
d88e2d2791 Fixes #13446: Don't disable bulk edit/delete buttons after deselecting "select all" checkbox 2023-08-11 08:56:58 -04:00
Abhimanyu Saharan
404714f618 Adds copy content button (#12584)
* adds copy content button #12499

* adds newline

* Omit hash mark from target string

* Clean up HTML element IDs

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-06 14:19:55 -04:00
Abhimanyu Saharan
f7b5f7792e Adds image preview back on the table (#12739)
* adds image preview on image attachment #12627

* adds bootstrap initialization for hx-trigger=load #12627

---------

Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-05-30 09:41:32 -04:00
kkthxbye-code
6214bb3709 Escape text passed as display values to slim-select 2023-05-30 09:09:15 -04:00
jeremystretch
d669251679 Merge branch 'develop' into feature 2023-04-26 15:09:51 -04:00
Austin de Coup-Crank
14c087c559 Fixes #11623: obfuscate Wi-Fi PSKs (#12244)
* Fixes #11623: obfuscate Wi-Fi PSKs

* yarn linting fixes

* include static files
2023-04-24 12:13:28 -04:00
jeremystretch
453ac7ea37 Closes #12292: Replace SelectSpeedWidget and SelectDurationWidget with NumberWithOptions 2023-04-18 16:33:43 -04:00
jeremystretch
e99f04e551 Closes #12119: Lock & unlock dashboard layout 2023-04-05 09:59:22 -04:00
jeremystretch
9a211a07c4 Fixes #12108: Limit the draggable area of widgets to their headers 2023-03-31 09:26:58 -04:00
jeremystretch
6280053d45 #10054: Trigger change event after updating form field value 2023-03-20 16:06:06 -04:00
Jeremy Stretch
763611b15a Closes #10054: Implement advanced UI controls for object selection (#11952)
* WIP

* WIP

* WIP

* Make object selector functional

* Replace extraneous form fields with selector widgets

* Avoid overlap with filterset field names

* Show checkmarks next to visibile filters

* Update results automatically when searching

* Include selector for device/VM component parent fields

* Use selector for filtering VLAN group/site

* Limit selector to 100 results
2023-03-13 12:44:26 -04:00
jeremystretch
6acc947c65 Merge branch 'develop' into feature 2023-03-13 11:58:37 -04:00
Aron Bergur Jóhannsson
bcfeb07ff2 Closes #11294: Markdown Preview (#11894)
* MarkdownWidget

* Change border and color of active markdown tab

* Fix template name typo

* Add render markdown endpoint

* Static assets for markdown widget

* widget style fix and unique ids based on name

* Replace SmallTextArea with SmallMarkdownWidget

* Clear innerHTML before swapping

* render markdown directly in template

* change render markdown view path

* remove small markdown widget

* Simplify rendering logic

* Use a form to clean input Markdown data

---------

Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2023-03-09 08:21:13 -05:00
aron bergur jóhannsson
8a1246b250 Update toggle caption for vif 2023-02-27 14:53:52 -05:00
aron bergur jóhannsson
f40749bc4e include static assets 2023-02-27 14:53:52 -05:00
jeremystretch
d62d4db0de Fixes #11753: Avoid re-initializing SlimSelects 2023-02-25 12:09:06 -05:00
Jeremy Stretch
f5869e7ec3 Closes #9416: Dashboard widgets (#11823)
* Replace masonry with gridstack

* Initial work on dashboard widgets

* Implement function to save dashboard layout

* Define a default dashboard

* Clean up widgets

* Implement widget configuration views & forms

* Permit merging dict value with existing dict in user config

* Add widget deletion view

* Enable HTMX for widget configuration

* Implement view to add dashboard widgets

* ObjectCountsWidget: Identify models by app_label & name

* Add color customization to dashboard widgets

* Introduce Dashboard model to store user dashboard layout & config

* Clean up utility functions

* Remove hard-coded API URL

* Use fixed grid cell height

* Add modal close button

* Clean up dashboard views

* Rebuild JS
2023-02-24 16:04:00 -05:00
jeremystretch
1c2f55668a #11625: Employ HTMX form rendering for device & VM interfaces 2023-02-19 20:09:52 -05:00
Jeremy Stretch
39286ef513 Closes #11558: Add support for remote data sources (#11646)
* WIP

* WIP

* Add git sync

* Fix file hashing

* Add last_synced to DataSource

* Build out UI & API resources

* Add status field to DataSource

* Add UI control to sync data source

* Add API endpoint to sync data sources

* Fix display of DataSource job results

* DataSource password should be write-only

* General cleanup

* Add data file UI view

* Punt on HTTP, FTP support for now

* Add DataSource URL validation

* Add HTTP proxy support to git fetcher

* Add management command to sync data sources

* DataFile REST API endpoints should be read-only

* Refactor fetch methods into backend classes

* Replace auth & git branch fields with general-purpose parameters

* Fix last_synced time

* Render discrete form fields for backend parameters

* Enable dynamic edit form for DataSource

* Register DataBackend classes in application registry

* Add search indexers for DataSource, DataFile

* Add single & bulk delete views for DataFile

* Add model documentation

* Convert DataSource to a primary model

* Introduce pre_sync & post_sync signals

* Clean up migrations

* Rename url to source_url

* Clean up filtersets

* Add API & filterset tests

* Add view tests

* Add initSelect() to HTMX refresh handler

* Render DataSourceForm fieldsets dynamically

* Update compiled static resources
2023-02-19 20:09:51 -05:00
Jeremy Stretch
68cf700a3e Closes #10560: New global search (#10676)
* Initial work on new search backend

* Clean up search backends

* Return only the most relevant result per object

* Clear any pre-existing cached entries on cache()

* #6003: Implement global search functionality for custom field values

* Tweak field weights & document guidance

* Extend search() to accept a lookup type

* Move get_registry() out of SearchBackend

* Enforce object permissions when returning search results

* Add indexers for remaining models

* Avoid calling remove() on non-cacheable objects

* Use new search backend by default

* Extend search backend to filter by object type

* Clean up search view form

* Enable specifying lookup logic

* Add indexes for value field

* Remove object type selector from search bar

* Introduce SearchTable and enable HTMX for results

* Enable pagination

* Remove legacy search backend

* Cleanup

* Use a UUID for CachedValue primary key

* Refactoring search methods

* Define max search results limit

* Extend reindex command to support specifying particular models

* Add clear() and size to SearchBackend

* Optimize bulk caching performance

* Highlight matched portion of field value

* Performance improvements for reindexing

* Started on search tests

* Cleanup & docs

* Documentation updates

* Clean up SearchIndex

* Flatten search registry to register by app_label.model_name

* Clean up search backend classes

* Clean up RestrictedGenericForeignKey and RestrictedPrefetch

* Resolve migrations conflict
2022-10-21 13:16:16 -04:00
kkthxbye-code
2e9ace7677 Fix graphiql by pinning esbuild 2022-10-04 22:00:32 +02:00
kkthxbye-code
9bb8454be3 Update JS dependencies WIP 2022-10-04 15:02:37 +02:00
PieterL75
8f99699123 Issue10352 removegetvariables (#10475)
* Add javascript to disable empty form fields

* add js cleanGetUrl

* use addEventListener submit

* use addEventListener

* update collectstatics

* Use FormData to remove empty fields

* optimeze ts-ignore

* update ts-ignore comment

* oneline of ts-ignore

* one line of ts-ingnore

* fix tsc errors by adding types (as per kkthxbye)

Co-authored-by: Pieter Lambrecht <pieter.lambrecht@sentia.com>
2022-10-03 14:32:01 -04:00
Arthur
8dd636d95c #101700 change csrf token access 2022-08-29 14:57:56 -07:00
Jonathan Senecal
ff4b2812c5 Add a "clear" button for quick search
Fixes #9857
2022-08-11 08:26:25 -04:00
jeremystretch
05ce58a9e2 Fixes #9437: Standardize form submission buttons and behavior when using enter key 2022-07-19 14:21:20 -04:00
jeremystretch
2861f5cfd7 Fixes #9749: Retain original slug values when modifying object names 2022-07-19 13:01:51 -04:00
kkthxbye-code
91d66cd421 Revert #9735 & #9696 2022-07-17 17:33:47 +02:00
kkthxbye-code
164bc93795 UI: Only set focus on select field search boxes if the select is open 2022-07-15 08:51:05 +02:00
kkthxbye-code
8ce09c4741 Focus on select field after populating data 2022-07-10 19:16:16 +02:00
kkthxbye-code
9db7f687d2 Don't close select field when multiple select 2022-06-17 22:53:51 +02:00
CroogQT
1566028798 yarn bundle. 2022-05-06 12:16:45 -07:00
CroogQT
88766b836b fixed text deselection and refactor 2022-05-05 15:01:40 -07:00
CroogQT
4bd787652e click event calls multiselect function 2022-05-05 13:24:50 -07:00
CroogQT
f94f488a75 clicking a PkCheckbox updates state 2022-05-05 12:37:28 -07:00
kkthxbye-code
37a5e4fdce UI: Fix apiSelect scrolling while zoomed in chrome 2022-04-22 20:33:46 +02:00
jeremystretch
2197315e3b Merge branch 'develop' into feature 2022-03-30 15:45:40 -04:00
jeremystretch
499dbbeeaf Change log & cleanup for #8163, #8866 2022-03-30 15:39:28 -04:00
Alex Gittings
51a8be8639 Fixes: #8866 - Does not perform API Select Search if a django peramiter has not been replaced 2022-03-14 17:57:33 +00:00