diff --git a/apps/home/static/home/js/index.js b/apps/home/static/home/js/index.js index d97e185..224c283 100644 --- a/apps/home/static/home/js/index.js +++ b/apps/home/static/home/js/index.js @@ -4,6 +4,7 @@ $(document).ready(async function() { // await initContentTable(); initSubscriptionsModule(); + initContentModule(); initMessageStylesModule(); await loadServers(); diff --git a/apps/home/static/home/js/tabs/content.js b/apps/home/static/home/js/tabs/content.js index e69de29..aa01f0c 100644 --- a/apps/home/static/home/js/tabs/content.js +++ b/apps/home/static/home/js/tabs/content.js @@ -0,0 +1,56 @@ +const contentTableId = "#contentTable"; + + +// region Init Module + +function initContentModule() { + initializeDataTable( + contentTableId, + [ + { + title: "Subscription", + data: "subscription" + }, + { + title: "Item ID", + data: "item_id" + }, + { + title: "Item GUID", + data: "item_guid" + }, + { + title: "Title", + data: "item_title" + }, + { + title: "URL", + data: "item_url" + }, + { + title: "Content Hash", + data: "item_content_hash" + } + ] + ); +} + + +// region Load Data + +$(document).on("selectedServerChange", async function() { + await loadContentData(); +}); + +$(contentTableId).on("doDataLoad", async function() { + await loadContentData(); +}) + +async function loadContentData() { + if (!selectedServer){ + return; + } + + setTableFilter(contentTableId, "subscription__server", selectedServer.id); + await loadTableData(contentTableId, "/api/content/", "GET"); +} \ No newline at end of file diff --git a/apps/home/templates/home/tabs/content.html b/apps/home/templates/home/tabs/content.html index 6b584e8..48aa80e 100644 --- a/apps/home/templates/home/tabs/content.html +++ b/apps/home/templates/home/tabs/content.html @@ -1 +1,80 @@ -content \ No newline at end of file +
+
+
+ + +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
+ +
+
+ + + of  + 10 +
+
\ No newline at end of file