Managed to figure out how to use javascript on the plugin page by utilizing data-controller as found in other repos. Unsure how this is used, but appears to be how you can attach a js file to a div. Also implemented a basic state api to build off of in future.

This commit is contained in:
2026-01-20 20:32:37 -07:00
parent 8d85194df5
commit d024035d07
7 changed files with 111 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
var table = document.getElementById("seriesTable");
const getMediaCleanerState = async () => {
const response = await fetch('/mediacleaner/state');
if(!response.ok){
throw new Error(`Response status: ${response.status}`)
}
return response.json();
}
var state = await getMediaCleanerState();
console.log("State: ", state);
for(let i = 0; i < state.length; i++){
var row = table.insertRow(-1);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
cell1.innerHTML = state[i].Id;
cell2.innerHTML = state[i].SeriesName;
cell3.innerHTML = state[i].Seasons.length;
}