File tree Expand file tree Collapse file tree 6 files changed +36
-4
lines changed
Expand file tree Collapse file tree 6 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,5 @@ backend/dist
22backend /__migration__
33docker
44backend /scripts
5+ backend /private
56** /vitest.config.js
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ <h1>API Server Configuration</h1>
5555 < span id ="form-loader " class ="loader "> </ span >
5656 </ div >
5757 < div id ="save "> Save Changes</ div >
58+ < div id ="export "> Export Configuration</ div >
5859 < script src ="script.js "> </ script >
5960 </ body >
6061</ html >
Original file line number Diff line number Diff line change @@ -281,4 +281,27 @@ window.onload = async () => {
281281 saveButton . disabled = false ;
282282 } , 3000 ) ;
283283 } ) ;
284+
285+ const exportButton = document . querySelector ( "#export" ) ;
286+
287+ exportButton . addEventListener ( "click" , async ( ) => {
288+ download (
289+ "backend-configuration.json" ,
290+ JSON . stringify ( { configuration : state } )
291+ ) ;
292+ } ) ;
284293} ;
294+
295+ function download ( filename , text ) {
296+ let element = document . createElement ( "a" ) ;
297+ element . setAttribute (
298+ "href" ,
299+ "data:text/plain;charset=utf-8," + encodeURIComponent ( text )
300+ ) ;
301+ element . setAttribute ( "download" , filename ) ;
302+
303+ element . style . display = "none" ;
304+ document . body . appendChild ( element ) ;
305+ element . click ( ) ;
306+ document . body . removeChild ( element ) ;
307+ }
Original file line number Diff line number Diff line change 7474 background-color : # d84b4b ;
7575}
7676
77- # save {
77+ # save ,
78+ # export {
7879 position : fixed;
7980 right : 6rem ;
8081 bottom : 3rem ;
@@ -90,7 +91,12 @@ body {
9091 transition : 0.125s ;
9192}
9293
93- # save : hover {
94+ # export {
95+ bottom : 9rem ;
96+ }
97+
98+ # save : hover ,
99+ # export : hover {
94100 background-color : var (--text-color );
95101 color : var (--bg-color );
96102}
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ COPY --from=builder /prod/backend/node_modules /app/backend/node_modules
2929COPY --from=builder /prod/backend/dist /app/backend/dist
3030COPY --from=builder /prod/backend/email-templates /app/backend/email-templates
3131COPY --from=builder /prod/backend/redis-scripts /app/backend/redis-scripts
32+ COPY --from=builder /prod/backend/private /app/backend/private
3233
3334# # to build directory
3435WORKDIR /app/backend/dist
Original file line number Diff line number Diff line change @@ -168,8 +168,8 @@ If you don't want to update this file manually you can
168168
169169- open the backend url in your browser, e.g. `http://localhost:5005/configure/`
170170- adjust the settings and click `Save Changes`
171- - open the configuration in your browser, e.g. `http://localhost:5005/configuration`
172- - copy everything from `data` into the `backend-configuration.json` file .
171+ - click `Export Configuration`
172+ - save the file as `backend-configuration.json`, overwriting the existing one .
173173
174174Example output from `http://localhost:5005/configuration` :
175175` ` ` json
You can’t perform that action at this time.
0 commit comments