SimonLeclere / discord-easy-dashboard

💻 Simple module to facilitate the creation of dashboard using discord.js and express
https://www.npmjs.com/package/discord-easy-dashboard
71 stars 11 forks source link

no public files #20

Closed HeCodes2Much closed 2 years ago

HeCodes2Much commented 2 years ago

hey is there no way to add public files to this dashboard? if so where do they go?

SimonLeclere commented 2 years ago

Hey, wdym by public files ?

HeCodes2Much commented 2 years ago

like if i want css/style.css or js/chart.js

im working on a custom theme but adding extra files to the themeing doesnt seem to work

HeCodes2Much commented 2 years ago

<script src="vendor/chart.js/Chart.min.js"></script> something like this doent work

SimonLeclere commented 2 years ago

That's weird. It should work haha

HeCodes2Much commented 2 years ago

it might do it i had them in the right spot but i'm not too sure where they would go as im trying in the theme location but that doesnt work

HeCodes2Much commented 2 years ago

ok so i found where they have to go and its not the best sport for them i have to go into DiscordBot/node_modules/discord-easy-dashboard and make a public folder there with the file... maybe it needs a public: path/to/public

SimonLeclere commented 2 years ago

Mmh i think you can just use the correct path for your files using ../ for example

HeCodes2Much commented 2 years ago

am i doing this right theme: require("../dashboard/themes/therepo.club"), to use my custom theme

HeCodes2Much commented 2 years ago

theme: "../../../dashboard/themes/therepo.club", this also loads the theme but the theme doesnt load the public folder unless its inside DiscordBot/node_modules/discord-easy-dashboard

SimonLeclere commented 2 years ago

I meant to say something like this:

<script src="../../vendor/chart.js/Chart.min.js"></script>
HeCodes2Much commented 2 years ago

that still comes back as 404 page not found :)

HeCodes2Much commented 2 years ago

i have gone from ../ to ../../../../../../../../../../ and still nothing unless there inside of /node_modules/discord-easy-dashboard

SimonLeclere commented 2 years ago

Mmh weird Well, please leave this issue open and I will try to fix the problem. Otherwise you can submit a pull request!

HeCodes2Much commented 2 years ago

@SimonLeclere https://github.com/SimonLeclere/discord-easy-dashboard/pull/21 there you go mate i fixed the issue :)

demo

const dashboard = new Dashboard(client, {
    theme: "../../../dashboard/themes/therepo.club",
    public: "../../../dashboard/themes/therepo.club/public",
    description: "A super cool bot with an online dashboard!",
    baseUrl: "http://localhost",
    port: 3000,
}
SimonLeclere commented 2 years ago

Super cool ! I'll check that later (it's 11pm in France haha). Thanks a lot for your contribution

SimonLeclere commented 2 years ago

Oh and if you think the final result of your theme is cool and you decide to make it open-source, feel free to open an issue here so I can add it in the readme!