That isn't what Dashboard is for. It is aimed at people with no html/js experience and enables them to have a UI simply by providing nodes in Node-RED flows.
If you want a custom UI, you may wish to try uibuilder.
It is helpful to share the ui_template code directly not just the flow file (since that takes time to paste into NR and tidy up afterwards).
If I am reading the raw flow correctly, I think you have assumed that the ui_template needs to have a full HMTL file. But the ui_template node is just a snippet that is inserted into the Dashboard page.
All you need to do is put the script file into the folder you have declared in settings.js as the static resources folder.