https://metaplay.io logo
Custom Dashboard
# questions-and-feedback
d
Hi, I have developed some custom dashboard screens which are available when i run the metaplay dashboard (metaplay dev dashboard cmd via cli). Is there a way to update the built in dashboard of metaplay so that the new dashboard is served when i start the server without need to run the dashboard separately? Thanks Andre
j
If you have done
metaplay init dashboard
and therefore your dashboard files are located under Backend/Dashboard, including your gamespecific.ts, the server should automatically build that dashboard and serve it on port 5550 locally. Do note, however, that running the dashboard that way gives you the version of the dashboard at server build time, meaning, you need to restart/rebuild the server to get changes made to the dashboard code visible again. That's why when developing anything for the LiveOps dashboard, it's possibly to indeed run it separately with
metaplay dev dashboard
from your project root. Edit: gamespecific.ts is under Backend/Dashboard/src
Correction: the server build does not automatically build the dashboard, you have to do that yourself with
metaplay build dashboard
, the game server then discovers the built files and serves that dashboard.
If your use case is that the dashboard is updated rarely or you have devs that do not develop the dashboard but want to use it, you can also use the Backend/PrebuiltDashboard folder in the following manner: - Build the dashboard using
metaplay build dashboard
(in project root) or
pnpm build
(in Backend/Dashboard directory) (We're going to add a flag to the metaplay CLI to build directly to the PrebuiltDashboard folder, which will skip the complexity of copying files over) - For now, you can copy the built files from Backend/Dashboard/dist folder to Backend/PrebuiltDashboard (delete first any files already there) - Commit the built files to your version control repo - Now your devs can run the server locally or deploy it to the cloud and the server will use the dashboard from the PrebuiltDashboard folder automatically. This way all devs don't need the tools to build the dashboard. The steps will have to be repeated whenever changes are made to the dashboard code, with the added step of first deleting the old files from the PrebuiltDashboard folder.
d
thanks for the reply. i think metaplay build dashboard solved the problem but having it automatically commited would also be nice to have.
j
We've updated the docs regarding building the dashboard and using the Prebuilt Dashboard functionality: https://docs.metaplay.io/liveops-dashboard/developing-the-liveops-dashboard.html#building-the-liveops-dashboard-and-using-the-prebuilt-dashboard-functionality We've also updated the CLI as decribed in the docs to be able to build directly into the PrebuiltDashboard folder using the flag
--output-prebuilt