fix(admin/view): define basePath in plugin IIFE scopes (#9298)

The plugin.templ and plugin_lane.templ components use basePath() in their IIFE
(Immediately Invoked Function Expression) scopes to handle subdirectory
deployments. However, basePath was not defined locally, causing "basePath is
not defined" errors when accessing plugin pages.

Added local basePath function definitions in both files, matching the pattern
from admin.js. This function checks window.__BASE_PATH__ (set by the layout
during page initialization) and prepends it to API paths.
This commit is contained in:
Chris Lu authored and GitHub committed 2026-05-01 18:22:39 -07:00
1 parent 913f98db10
commit f2c3bd7b77
4 files changed
+10 -2

No files matched your search

+4
View File
@@ -597,6 +597,10 @@ templ Plugin(page string, initialJob string, lane string) {
var pluginLane = String(page.getAttribute('data-plugin-lane') || '').trim();
function basePath(path) {
return (window.__BASE_PATH__ || '') + path;
}
var state = {
selectedJobType: '',
jobTypes: [],