Problem making diskspace2 plugin out of diskspace plugin ?

jith45

Member
May 25, 2018
960
0
16
I looked into tutorial and I see that plugin name is bond to folder name. I want to make 2 disk plugins to show different mount points each.

a) I copied existing diskspace > diskspace2 folder.

b) I found 2 locations where "diskspace" was hardcoded and change them too
init.js
url : "plugins/diskspace2/action.php",
lang/en.js
thePlugins.get("diskspace2").langLoaded();

Plugin loads fine but there is nothing in status bar. If I revert everything to "diskspace" plugin works. Is there any other hard coded location where diskspace is mentioned or way to solve this problem ?

Kind Regards,
torrentfun
 

shwetha17

Member
May 24, 2018
785
0
16
The 2nd plugin overwrites the DOM modifications made by the first one, since you have not edited the dom elements id's (ex: #meter-disk-* in init.js).

Multiple mounts space status can be achieved by using a single modified instance of diskspace plugin. For example you can send more serialized data in each diskspace/action.php request containing information about your mount points and using JS to render the stats.

action.php feeds-> init.js -> displays the stats data

You need some time with JS, json and php to achieve your goal.