File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change
1
+ {}
Original file line number Diff line number Diff line change
1
+ {}
Original file line number Diff line number Diff line change 49
49
50
50
< script type ="module ">
51
51
import UI from "./app/ui.js" ;
52
+ import * as Log from './core/util/logging.js' ;
53
+
54
+ let response ;
52
55
53
56
let defaults = { } ;
54
57
let mandatory = { } ;
55
58
56
- // Override any defaults you need here:
59
+ // Default settings will be loaded from defaults.json. Mandatory
60
+ // settings will be loaded from mandatory.json, which the user
61
+ // cannot change.
62
+
63
+ try {
64
+ response = await fetch ( './defaults.json' ) ;
65
+ if ( ! response . ok ) {
66
+ throw Error ( "" + response . status + " " + response . statusText ) ;
67
+ }
68
+
69
+ defaults = await response . json ( ) ;
70
+ } catch ( err ) {
71
+ Log . Error ( "Couldn't fetch defaults.json: " + err ) ;
72
+ }
73
+
74
+ try {
75
+ response = await fetch ( './mandatory.json' ) ;
76
+ if ( ! response . ok ) {
77
+ throw Error ( "" + response . status + " " + response . statusText ) ;
78
+ }
79
+
80
+ mandatory = await response . json ( ) ;
81
+ } catch ( err ) {
82
+ Log . Error ( "Couldn't fetch mandatory.json: " + err ) ;
83
+ }
84
+
85
+ // You can also override any defaults you need here:
57
86
//
58
87
// defaults['host'] = 'vnc.example.com';
59
88
You can’t perform that action at this time.
0 commit comments