I have come across two issues with this amazing theme. Thanks for all the hard work, much appreciated.
1. If you remove id tag mobro-cpu-name in the h2 tag then
<h2 id="mobro-gpu-name" class="text-nowrap text-truncate"></h2>
will not show a value.
I did this because my CPU name was too long. The code in the my modified index file is:
<h2>AMD Ryzen 5 1600</h2>
This issue is easy to solve as I modified the gpu h2 tag to:
<h2 id="mobro-gpu-name" class="text-nowrap text-truncate">NVIDIA GeForce GTX 1070</h2>
2. The total ram is not showing so all i see is:
RAM 4.85/ Not sure why
<span id="mobro-ram-data--total"></span>
is not showing a value.
Again I can manually put in the value.
For reference I have all 3 external data sources available “Open Hardware, Libre Hardware and HWiNFO”
Hey @Bob NZ ,
first of all thank you for trying out MoBro and also looking into the code to try and modify things - really great to see that people are playing with the settings!
- yep that seems to be an issue because in the js (https://github.com/ModBros/mobro-theme-dubbadhar/blob/master/src/js/script.js#L114) we do not catch an error when the id does not exist.
- I think the second issue is related to the first one because the ram would be set at line 116 in the same js that will not be used if the lines before throw an error.
Thanks for letting me know! I'll might find some time this weekend to look into it and fix it. I'll let you know as soon as I have a new version in the repository for you to try out.
I'm really looking forward to our theme customization where we'll not have to code around to change values like that ?
From my understanding you can compare null to a boolean and then set the element. What am i doing wrong? also if you have a code fix can you post it below please. Thanks again for your help
I have changed the code to:
MobroSDK.emit("monitor:hardware").then((data) => {
const cpuName = document.getElementById("mobro-cpu-name");
if (cpuName) {cpuName.innerHTML = data.processor.cpus[0].name}
const gpuName = document.getElementById("mobro-gpu-name");
if (gpuName) {gpuName.innerHTML = data.graphics.gpus[0].name}
const ramTotal = document.getElementById("mobro-ram-data--total")
if (ramTotal) {ramTotal.innerHTML = bytes(data.memory.totalcapacity)}
//old lines
//document.getElementById("mobro-cpu-name").innerHTML = data.processor.cpus[0].name
//document.getElementById("mobro-gpu-name").innerHTML = data.graphics.gpus[0].name
//document.getElementById("mobro-ram-data--total").innerHTML = bytes(data.memory.totalcapacity)
})
Ok I am obviously missing something big.
Unlike index.html I dont think when i modify the script it is being run.
i commented out all the lines as well as putting an alert in the function and am not getting anything.
Is there instructions for loading this project in some environment?
I have Visual Studio installed and am family with C#.
Hey sorry there is no readme yet - i gotta provide one :P
The project uses a frontend build pipeline to build the files from the dist folder to the src folder and bundle everything together.
In order to set it up you have to have Node.js and npm (comes with node) installed on your os. After that run the command “npm install” in your terminal of choise in the projects root directory. That creates a node_modules folder and downloads all the required modules for the project. Now you are able to run two commands “npm run dev” or “npm run build”.
- The build command bundles everything together and minfies the scripts to make them as small as possible.
- With the dev command the bundeling happens but it will not get minified so you are able to debug. Also it creates a watcher that keeps the building pipeline “open” and listens to changes in your files and compiles them again after a change happens.
So while developing use the dev and when you're finished run the build command.
Hope that helps.
Hey @Bob NZ ,
did that solve your issue? If so I'd like to close that topic - otherwise feel free to ask me again or create a new topic.
~ Mike
How can i change the wallpaper of this theme ????
On the RED theme its just change the pic on the original theres no PIcture ?
@HoRNeT yes there is no picture on the original theme. You can wait for the Theme configurator (Or join Patreon if you cannot wait :P), with that you can add Images as you wish.