@@ -59,7 +59,7 @@ <h3>Recent Activity</h3>
5959function protectDownload ( btn , downloadId , title , arrName ) {
6060 btn . disabled = true ;
6161 btn . setAttribute ( 'aria-busy' , 'true' ) ;
62- fetch ( '/api/protected/' + encodeURIComponent ( downloadId ) , {
62+ fetch ( rootPath + '/api/protected/' + encodeURIComponent ( downloadId ) , {
6363 method : 'POST' ,
6464 headers : { 'Content-Type' : 'application/json' } ,
6565 body : JSON . stringify ( { title : title , arr_name : arrName } )
@@ -72,7 +72,7 @@ <h3>Recent Activity</h3>
7272}
7373
7474function unprotectDownload ( downloadId ) {
75- fetch ( '/api/protected/' + encodeURIComponent ( downloadId ) , {
75+ fetch ( rootPath + '/api/protected/' + encodeURIComponent ( downloadId ) , {
7676 method : 'DELETE'
7777 } ) . then ( ( ) => htmx . trigger ( '#queue-container' , 'refresh' ) ) ;
7878}
@@ -83,7 +83,7 @@ <h3>Recent Activity</h3>
8383 message : '' ,
8484 evtSource : null ,
8585 init ( ) {
86- this . evtSource = new EventSource ( '/api/events' ) ;
86+ this . evtSource = new EventSource ( rootPath + '/api/events' ) ;
8787 this . evtSource . addEventListener ( 'item_removed' , ( ) => {
8888 htmx . trigger ( '#queue-container' , 'refresh' ) ;
8989 htmx . trigger ( '#activity-feed' , 'refresh' ) ;
@@ -109,7 +109,7 @@ <h3>Recent Activity</h3>
109109 this . triggering = true ;
110110 this . message = '' ;
111111 try {
112- const res = await fetch ( '/api/trigger' , { method : 'POST' } ) ;
112+ const res = await fetch ( rootPath + '/api/trigger' , { method : 'POST' } ) ;
113113 const data = await res . json ( ) ;
114114 this . message = data . status === 'triggered' ? 'Cycle triggered!' : 'Could not trigger' ;
115115 } catch {
@@ -120,7 +120,7 @@ <h3>Recent Activity</h3>
120120 } ,
121121 async toggleTestRun ( ) {
122122 try {
123- const res = await fetch ( '/api/config/test-run' , { method : 'POST' } ) ;
123+ const res = await fetch ( rootPath + '/api/config/test-run' , { method : 'POST' } ) ;
124124 const data = await res . json ( ) ;
125125 this . message = `Test Run: ${ data . test_run ? 'ON' : 'OFF' } ` ;
126126 htmx . trigger ( '[hx-get="/partials/status-bar"]' , 'refresh' ) ;
@@ -132,4 +132,4 @@ <h3>Recent Activity</h3>
132132 }
133133}
134134</ script >
135- {% endblock %}
135+ {% endblock %}
0 commit comments