diff --git a/file server/example/README.md b/file server/example/README.md new file mode 100644 index 0000000..5ad9f3e --- /dev/null +++ b/file server/example/README.md @@ -0,0 +1,12 @@ +# example prim-dns file server + +This is an example setup of a prim-dns file server. + +The directory structure seen here would actually be simulated by naming the notecards as follows: +- `/agents/index.js` +- `/agents/index.xhtml` +- `/index.xhtml` +- `/javascript/index.js` +- `/javascript/index.xhtml` + +![Example inventory contents](example%20inventory%20contents.png) diff --git a/file server/example/agents/index.js b/file server/example/agents/index.js new file mode 100644 index 0000000..8631812 --- /dev/null +++ b/file server/example/agents/index.js @@ -0,0 +1,25 @@ +window.addEventListener('load', function() { + fetch('agents.json').then(resp => resp.json()).then(agents => { + document.getElementById('region-name').innerHTML = agents.region; + + let table = document.getElementById('agents-table'); + + agents.agentList.forEach(agent => { + let row = document.createElement('tr'); + + let col1 = document.createElement('td'); + col1.innerHTML = agent.key; + row.append(col1); + + let col2 = document.createElement('td'); + col2.innerHTML = agent.displayName; + row.append(col2); + + let col3 = document.createElement('td'); + col3.innerHTML = agent.username; + row.append(col3); + + table.append(row); + }); + }); +}); diff --git a/file server/example/agents/index.xhtml b/file server/example/agents/index.xhtml new file mode 100644 index 0000000..08b7f29 --- /dev/null +++ b/file server/example/agents/index.xhtml @@ -0,0 +1,30 @@ + + + + +Agents in region + + +