File tree Expand file tree Collapse file tree
DotNet/Automation.UI/Views Expand file tree Collapse file tree Original file line number Diff line number Diff line change 265265 </button >
266266 </div >
267267 <div class =" col-md-2" >
268- <a asp-controller =" Scenarios" asp-action =" Index" class =" btn btn-outline-secondary w-100" >
268+ <a asp-controller =" Scenarios"
269+ asp-action =" Index"
270+ class =" btn btn-outline-secondary w-100"
271+ id =" btnManageScenario" >
269272 <i class =" bi bi-journal-text me-1" ></i > Manage
270273 </a >
271274 </div >
302305 var recentRunsPartialUrl = ' @Url.Action("RecentRunsPartial", "Runs")' ;
303306 var cancelUrl = ' @Url.Action("CancelJson", "Runs")' ;
304307 var deleteUrl = ' @Url.Action("DeleteJson", "Runs")' ;
308+ var scenariosUrl = ' @Url.Action("Index", "Scenarios")' ;
305309
306310 // --- KPI elements ---
307311 var kpiActive = document .getElementById (' kpiActive' );
612616 var noResults = document .getElementById (' quickLaunchNoResults' );
613617 var quickTypeFilter = document .getElementById (' quickLaunchTypeFilter' );
614618 var quickSort = document .getElementById (' quickLaunchSort' );
619+ var manageLink = document .getElementById (' btnManageScenario' );
615620
616621 function getQuickLaunchOptions () {
617622 return Array .from (
689694 dropdownButton .textContent =
690695 label || ' -- Select a scenario --' ;
691696 }
697+
698+ if (manageLink) {
699+ manageLink .href = id
700+ ? scenariosUrl + ' ?editScenarioId=' + encodeURIComponent (id)
701+ : scenariosUrl;
702+ }
692703 }
693704
694705 if (quickSearch) {
10191030 refreshRecentRunsCard ({ pageSize: sel .value , pageNumber: ' 1' });
10201031 });
10211032})();
1033+
10221034 </script >
10231035
10241036@await Html .PartialAsync (" _ScenarioEditorModal" )
Original file line number Diff line number Diff line change 247247 }
248248
249249 applyScenarioView ();
250+
251+ // Open a scenario passed from Quick Launch directly in the editor.
252+ var editScenarioId = new URLSearchParams (window .location .search ).get (' editScenarioId' );
253+
254+ if (editScenarioId && typeof window .openScenarioEditor === ' function' ) {
255+ window .openScenarioEditor (editScenarioId, ' edit' );
256+
257+ // Remove the one-time navigation parameter so saving/reloading the
258+ // Scenarios page does not automatically reopen the editor.
259+ var url = new URL (window .location .href );
260+ url .searchParams .delete (' editScenarioId' );
261+ window .history .replaceState (null , ' ' , url .toString ());
262+ }
250263 })();
251264 </script >
You can’t perform that action at this time.
0 commit comments