chef 3749 Posted February 15, 2020 Author Share Posted February 15, 2020 Look what I got working' LOL! var ApiClient = () => { getJSON((endpoint) => { return new Promise((resolve, reject) => { var url = window.location.href.split("/web")[0] + "/emby"; var xhr = new XMLHttpRequest(); xhr.open('GET', url + endpoint, true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.onreadystatechange = () => { xhr.status === 200 ? resolve(JSON.parse(xhr.responseText)) : reject(xhr.status); } xhr.send(); }); }) } ready(".localUrl", (element) => { var totalStorageNode = document.createElement('p'); totalStorageNode.id = 'totalStorage'; element.parentNode.insertBefore(totalStorageNode, element); ApiClient.getJSON('/GetTotalStorage').then((json) => { totalStorageNode.innerHTML = 'Total Drive Storage: ' + json['Used'] + '\\' + json['Total']; }); }); (function(win) { 'use strict'; var listeners = [], doc = win.document, MutationObserver = win.MutationObserver || win.WebKitMutationObserver, observer; function ready(selector, fn) { // Store the selector and callback to be monitored listeners.push({ selector: selector, fn: fn }); if (!observer) { // Watch for changes in the document observer = new MutationObserver(function(mutations) { check() }); observer.observe(doc.documentElement, { childList: true, subtree: true, attributes: true, attributeOldValue: true, }); } // Check if the element is currently in the DOM check(); } function check() { // Check the DOM for elements matching a stored selector for (var i = 0, len = listeners.length, listener, elements; i < len; i++) { listener = listeners[i]; // Query for elements matching the specified selector elements = doc.querySelectorAll(listener.selector); for (var j = 0, jLen = elements.length, element; j < jLen; j++) { element = elements[j]; // Make sure the callback isn't invoked with the // same element more than once if (!element.ready) { element.ready = true; // Invoke the callback with the element listener.fn.call(element, element); } } } } win.ready = ready; })(this); LOL! Link to comment Share on other sites More sharing options...
maegibbons 1267 Posted February 15, 2020 Share Posted February 15, 2020 Since the last update i am getting false alerts all the time. I have not been in to the config for ages. Do i need to re setup the plugin because of the changes? Krs Mark Sent from my SM-N976B using Tapatalk 1 Link to comment Share on other sites More sharing options...
Dibbes 431 Posted February 15, 2020 Share Posted February 15, 2020 Since the last update i am getting false alerts all the time. I have not been in to the config for ages. Do i need to re setup the plugin because of the changes? Looks like it's the wrong way around Link to comment Share on other sites More sharing options...
Spaceboy 2500 Posted February 15, 2020 Share Posted February 15, 2020 Yep agreed, alerts seem to be negatively configured at the moment. Otherwise looks great 1 Link to comment Share on other sites More sharing options...
chef 3749 Posted February 15, 2020 Author Share Posted February 15, 2020 (edited) I would reconfigure the drives. @@Dibbes you have made the threshold 15 GB, which means that anything over 15GB is going to alert you. @@maegibbons make sure you also have the amount of gigs (which would be almost the whole drive) properly configured. @@Spaceboy what are your thresholds limits set to? If you guys want I can make an option which looks at the limit from the full drive instead of the empty one. I see whats happening there are two ways to look at a threshold limit: 1. Is the actually limit in GB where if the available space exceeds the set limit (example: Cbers uses 756GB, anything over that is exceeded) 2. The amount of space left on the drive. (example: 10GB left as freespace on the drive, anything under the 10GB limit would be exceeded) This is how to fix it: input Max value equals drive total space A label needs to be added to the threshold input which explains that it is the exact number in GBs to monitor for. That should fix this problem. Edited February 15, 2020 by chef Link to comment Share on other sites More sharing options...
Dibbes 431 Posted February 15, 2020 Share Posted February 15, 2020 @@chef That doesn't make sense to me, mate... If I put 150GB as a threshold I would expect that I'd get an alert when the free space goes below that 150GB 2 Link to comment Share on other sites More sharing options...
chef 3749 Posted February 15, 2020 Author Share Posted February 15, 2020 @@chef That doesn't make sense to me, mate... If I put 150GB as a threshold I would expect that I'd get an alert when the free space goes below that 150GB Okay, I can change it back. 1 Link to comment Share on other sites More sharing options...
Spaceboy 2500 Posted February 15, 2020 Share Posted February 15, 2020 Yep, my expectation aligns to @@Dibbes 2 Link to comment Share on other sites More sharing options...
CBers 6780 Posted February 15, 2020 Share Posted February 15, 2020 Yep, my expectation aligns to @@Dibbes Same. Link to comment Share on other sites More sharing options...
chef 3749 Posted February 15, 2020 Author Share Posted February 15, 2020 I have changed it back to the amount of space left of the drive before notifications sent. I believe it is properly coded. Please let me know if you get rogue notifications so I can fix it quickly. thanks so much to everyone 3 Link to comment Share on other sites More sharing options...
Spaceboy 2500 Posted February 15, 2020 Share Posted February 15, 2020 All looks good to me. Great work chef 1 Link to comment Share on other sites More sharing options...
Dibbes 431 Posted February 15, 2020 Share Posted February 15, 2020 No issues here (besides the missing labels in the T and U drives, that is...) 1 Link to comment Share on other sites More sharing options...
Sashaaa 1 Posted February 18, 2020 Share Posted February 18, 2020 this version work, but like tdiguy i have a shit load of path. Maybe if we can filter them that will be nice. 1 Link to comment Share on other sites More sharing options...
CBers 6780 Posted February 18, 2020 Share Posted February 18, 2020 Just to throw a spanner in the works, but there's no way to configure the threshold in the mobile Chrome browser when in LINE chart mode. It's OK in the PIE chart. Thanks Link to comment Share on other sites More sharing options...
chef 3749 Posted February 18, 2020 Author Share Posted February 18, 2020 Just to throw a spanner in the works, but there's no way to configure the threshold in the mobile Chrome browser when in LINE chart mode. It's OK in the PIE chart. Thanks Do you mean the table view? Is that because the table view hasn't been set up for mobile and you can't access the button? Just want to make sure I understand. 1 Link to comment Share on other sites More sharing options...
chef 3749 Posted February 18, 2020 Author Share Posted February 18, 2020 this version work, but like tdiguy i have a shit load of path. Maybe if we can filter them that will be nice. I'm just wondering how to do this. I can split the path into an array and allow you to choose the part which is the most appropriate for the label, but I'm not sure how to show it in the UI. Unless we create a rename feature, which allows you to rename the path for the label. Would that work? We are pretty much set up for that. Link to comment Share on other sites More sharing options...
CBers 6780 Posted February 18, 2020 Share Posted February 18, 2020 Do you mean the table view? Is that because the table view hasn't been set up for mobile and you can't access the button? Just want to make sure I understand. Is that what it's called, TABLE view. Yes, that one. No, there's no button. 1 Link to comment Share on other sites More sharing options...
Spaceboy 2500 Posted February 18, 2020 Share Posted February 18, 2020 Is that what it's called, TABLE view. Yes, that one. No, there's no button. oh really? Works fine in iOS [emoji41] 1 Link to comment Share on other sites More sharing options...
chef 3749 Posted February 18, 2020 Author Share Posted February 18, 2020 Is that what it's called, TABLE view. Yes, that one. No, there's no button. Should I add a media query, then make the entire row clickable, on mobile? Link to comment Share on other sites More sharing options...
chef 3749 Posted February 18, 2020 Author Share Posted February 18, 2020 I have to scroll right to see on Android. I am on Android 10. Link to comment Share on other sites More sharing options...
Spaceboy 2500 Posted February 18, 2020 Share Posted February 18, 2020 I do have to scroll to the right to see the three dot button Link to comment Share on other sites More sharing options...
CBers 6780 Posted February 18, 2020 Share Posted February 18, 2020 Wrapped on my Android 10 phone. Link to comment Share on other sites More sharing options...
CBers 6780 Posted February 18, 2020 Share Posted February 18, 2020 Should I add a media query, then make the entire row clickable, on mobile? Will that solve the issue ? Link to comment Share on other sites More sharing options...
chef 3749 Posted February 18, 2020 Author Share Posted February 18, 2020 Will that solve the issue ? I'm not sure. The table layouts for the Emby aren't really mobile friendly. Auto organization pages suffer the same issues. We can alter the table data for mobile, maybe streamline it and remove some of the column data. Maybe only display, total space, used space, available space and make the row clickable as the config button. Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted February 18, 2020 Share Posted February 18, 2020 or put the button on the left side of the table row? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now