diff --git a/electron/index3.html b/electron/index3.html
index 13678c1..4795892 100644
--- a/electron/index3.html
+++ b/electron/index3.html
@@ -47,7 +47,7 @@
Security
-
+
Federation
diff --git a/mstream.js b/mstream.js
index 1f99b5b..87cd2f2 100755
--- a/mstream.js
+++ b/mstream.js
@@ -114,6 +114,8 @@ exports.serveIt = config => {
});
}
+ require('./src/api/admin.js').setup(mstream, program);
+
// Album art endpoint
mstream.use('/album-art', express.static(program.storage.albumArtDirectory));
// Download Files API
diff --git a/public/admin.html b/public/admin.html
index 1149e4a..ba77a61 100644
--- a/public/admin.html
+++ b/public/admin.html
@@ -28,18 +28,21 @@
+
+
-
+
+
@@ -98,6 +101,17 @@
mStream RPN
+
+
+
@@ -122,4 +136,5 @@
+
\ No newline at end of file
diff --git a/public/css/admin.css b/public/css/admin.css
new file mode 100644
index 0000000..0275017
--- /dev/null
+++ b/public/css/admin.css
@@ -0,0 +1,18 @@
+.collection-item {
+ display: flow-root;
+}
+
+.collection-item:hover {
+ background-color: #EEE;
+ cursor: pointer;
+}
+
+.collection-item svg {
+ float: left;
+}
+
+.collection-item div {
+ vertical-align: middle;
+ height: 32.4px;
+ float: left;
+}
diff --git a/public/js/admin.js b/public/js/admin.js
index 00cf4b9..4c38540 100644
--- a/public/js/admin.js
+++ b/public/js/admin.js
@@ -1,3 +1,27 @@
+const ADMINDATA = (() => {
+ const module = {};
+ module.sharedSelect = { value: '' };
+ module.folders = {};
+ module.foldersUpdated = { ts: 0 };
+
+ module.getFolders = async () => {
+ const res = await API.axios({
+ method: 'GET',
+ url: `${API.url()}/api/v1/admin/directories`
+ });
+
+ Object.keys(res.data.memory).forEach(key=>{
+ module.folders[key] = res.data.memory[key];
+ });
+
+ module.foldersUpdated.ts = Date.now();
+ };
+
+ return module;
+})();
+
+// Load in data
+ADMINDATA.getFolders();
// initialize modal
M.Modal.init(document.querySelectorAll('.modal'), {});
@@ -5,9 +29,11 @@ M.Modal.init(document.querySelectorAll('.modal'), {});
const foldersView = Vue.component('folders-view', {
data() {
return {
- componentKey: false, // Flip this value to force re-render,
+ componentKey: false, // Flip this value to force re-render
dirName: '',
- folder: ''
+ folder: ADMINDATA.sharedSelect,
+ foldersTS: ADMINDATA.foldersUpdated,
+ folders: ADMINDATA.folders
};
},
template: `
@@ -19,14 +45,14 @@ const foldersView = Vue.component('folders-view', {
Add Folder