[PR #7218] [MERGED] Fixes #7162: Decouple base path rendering from API request logic #13221

Closed
opened 2025-12-29 22:26:04 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/7218
Author: @jeremystretch
Created: 9/8/2021
Status: Merged
Merged: 9/8/2021
Merged by: @jeremystretch

Base: developHead: 7162-base-path-bug2


📝 Commits (3)

  • 950ce94 Refactor ApiRequest to take only full URLs; update TableConfigForm
  • 2c1745c Refactor checkJobStatus() to use API URLs provided via context
  • cf8fdac Refactor connection toggle to use API URLs

📊 Changes

18 files changed (+61 additions, -128 deletions)

View changed files

📝 netbox/project-static/dist/config.js (+2 -2)
📝 netbox/project-static/dist/config.js.map (+2 -2)
📝 netbox/project-static/dist/jobs.js (+2 -2)
📝 netbox/project-static/dist/jobs.js.map (+2 -2)
📝 netbox/project-static/dist/lldp.js (+2 -2)
📝 netbox/project-static/dist/lldp.js.map (+2 -2)
📝 netbox/project-static/dist/netbox.js (+7 -7)
📝 netbox/project-static/dist/netbox.js.map (+2 -2)
📝 netbox/project-static/dist/status.js (+2 -2)
📝 netbox/project-static/dist/status.js.map (+2 -2)
📝 netbox/project-static/src/buttons/connectionToggle.ts (+3 -3)
📝 netbox/project-static/src/jobs.ts (+12 -11)
📝 netbox/project-static/src/tableConfig.ts (+15 -3)
📝 netbox/project-static/src/util.ts (+1 -81)
📝 netbox/templates/dcim/inc/cable_toggle_buttons.html (+2 -2)
📝 netbox/templates/extras/report_result.html (+1 -1)
📝 netbox/templates/extras/script_result.html (+1 -1)
📝 netbox/templates/utilities/templatetags/table_config_form.html (+1 -1)

📄 Description

Fixes: #7162

This is a more fleshed out implementation of my initial proposal under PR #7172. This removes the need to ever detect or calculate the BASE_PATH (if configured) in the front end. All URLs are rendered in the back end and passed via context in the template for reference by the front end.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/7218 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 9/8/2021 **Status:** ✅ Merged **Merged:** 9/8/2021 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `7162-base-path-bug2` --- ### 📝 Commits (3) - [`950ce94`](https://github.com/netbox-community/netbox/commit/950ce946533d87bf05b3d53f0dfedc84413be7ee) Refactor ApiRequest to take only full URLs; update TableConfigForm - [`2c1745c`](https://github.com/netbox-community/netbox/commit/2c1745ce2854847cda42c10966c68cc6069fead5) Refactor checkJobStatus() to use API URLs provided via context - [`cf8fdac`](https://github.com/netbox-community/netbox/commit/cf8fdacfa3f8e514c2efb4ba188cbc997a29a041) Refactor connection toggle to use API URLs ### 📊 Changes **18 files changed** (+61 additions, -128 deletions) <details> <summary>View changed files</summary> 📝 `netbox/project-static/dist/config.js` (+2 -2) 📝 `netbox/project-static/dist/config.js.map` (+2 -2) 📝 `netbox/project-static/dist/jobs.js` (+2 -2) 📝 `netbox/project-static/dist/jobs.js.map` (+2 -2) 📝 `netbox/project-static/dist/lldp.js` (+2 -2) 📝 `netbox/project-static/dist/lldp.js.map` (+2 -2) 📝 `netbox/project-static/dist/netbox.js` (+7 -7) 📝 `netbox/project-static/dist/netbox.js.map` (+2 -2) 📝 `netbox/project-static/dist/status.js` (+2 -2) 📝 `netbox/project-static/dist/status.js.map` (+2 -2) 📝 `netbox/project-static/src/buttons/connectionToggle.ts` (+3 -3) 📝 `netbox/project-static/src/jobs.ts` (+12 -11) 📝 `netbox/project-static/src/tableConfig.ts` (+15 -3) 📝 `netbox/project-static/src/util.ts` (+1 -81) 📝 `netbox/templates/dcim/inc/cable_toggle_buttons.html` (+2 -2) 📝 `netbox/templates/extras/report_result.html` (+1 -1) 📝 `netbox/templates/extras/script_result.html` (+1 -1) 📝 `netbox/templates/utilities/templatetags/table_config_form.html` (+1 -1) </details> ### 📄 Description ### Fixes: #7162 This is a more fleshed out implementation of my initial proposal under PR #7172. This removes the need to ever detect or calculate the `BASE_PATH` (if configured) in the front end. All URLs are rendered in the back end and passed via context in the template for reference by the front end. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:26:04 +01:00
adam closed this issue 2025-12-29 22:26:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13221