@@ -229,37 +229,4 @@ public static BotEntry of(String name, JsonObject json) {
229229 return new BotEntry (name , enabled , runPath );
230230 }
231231 }
232-
233- public static DashboardConfig getDashboardConfig () {
234- final var path = Path .of ("dashboard" ).resolve ("config.json" );
235- if (!path .toFile ().exists ()) {
236- try {
237- Files .createDirectories (Path .of ("dashboard" ));
238- Files .createFile (path ); // If it doesn't exist, generate it
239- try (final var fw = new BufferedWriter (new FileWriter (path .toFile ()))) {
240- Constants .Gsons .GSON .toJson (new DashboardConfig (), fw );
241- }
242- } catch (IOException e ) {
243- LOG .error ("Exception while trying to generate dashboard config!" , e );
244- }
245- }
246- try (final var ir = new FileReader (path .toFile ())) {
247- return Constants .Gsons .GSON .fromJson (ir , DashboardConfig .class );
248- } catch (IOException e ) {
249- LOG .error ("Exception while trying to read config!" , e );
250- }
251- return new DashboardConfig ();
252- }
253-
254- public static final class DashboardConfig {
255- public int port = 600 ;
256-
257- public Account [] accounts ;
258-
259- public static final class Account {
260- public String username ;
261- public String password ;
262- }
263- }
264-
265232}
0 commit comments