91 lines
3 KiB
Dart
91 lines
3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:libac_flutter/packets/packets.dart';
|
|
import 'package:servermanager/Constants.dart';
|
|
import 'package:servermanager/autorestart.dart';
|
|
import 'package:servermanager/game.dart';
|
|
import 'package:servermanager/home.dart';
|
|
import 'package:servermanager/proton.dart';
|
|
import 'package:servermanager/serversettings.dart';
|
|
import 'package:servermanager/settings.dart';
|
|
import 'package:servermanager/steamcmd.dart';
|
|
|
|
Future<void> main() async {
|
|
runApp(MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
MyApp({super.key});
|
|
Settings appSettings = Settings();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Server Manager',
|
|
theme: ThemeData.dark(useMaterial3: true),
|
|
routes: {
|
|
"/": (context) => ServerPage(),
|
|
"/home": (context) => HomePage(settings: appSettings),
|
|
"/proton": (context) => Proton(settings: appSettings),
|
|
"/steamcmd": (context) => SteamCMD(
|
|
settings: appSettings,
|
|
),
|
|
"/server": (context) => GameServerPage(settings: appSettings),
|
|
"/server/autorestart": (context) => AutoRestartPage(),
|
|
"/server/ports": (context) => ServerSettingsPage(),
|
|
"/server/mods": (context) => ModManager(settings: appSettings),
|
|
"/server/mods/edit": (context) => ModPage(),
|
|
"/steamcmd/creds": (context) => CredentialsPrompt()
|
|
});
|
|
}
|
|
}
|
|
|
|
class ServerPage extends StatelessWidget {
|
|
TextEditingController serverIP = TextEditingController();
|
|
TextEditingController username = TextEditingController();
|
|
TextEditingController password = TextEditingController();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text("Conan Exiles Server Manager - Login"),
|
|
backgroundColor: Constants.TITLEBAR_COLOR,
|
|
),
|
|
floatingActionButton: ElevatedButton(
|
|
onPressed: () {
|
|
// Send login packet to server
|
|
Settings settings = Settings();
|
|
settings.client = PacketClient(serverIP.text);
|
|
},
|
|
child: Text("Login"),
|
|
),
|
|
body: SingleChildScrollView(
|
|
child: Column(
|
|
children: [
|
|
ListTile(
|
|
title: Text("Server IP/FQDN"),
|
|
subtitle: TextField(
|
|
controller: serverIP,
|
|
decoration: InputDecoration(hintText: "ex. 192.168.1.100"),
|
|
),
|
|
),
|
|
ListTile(
|
|
title: Text("Username"),
|
|
subtitle: TextField(
|
|
controller: username,
|
|
decoration: InputDecoration(hintText: "the_user"),
|
|
),
|
|
),
|
|
ListTile(
|
|
title: Text("Password"),
|
|
subtitle: TextField(
|
|
controller: password,
|
|
decoration: InputDecoration(hintText: "pass"),
|
|
obscureText: true,
|
|
),
|
|
)
|
|
],
|
|
),
|
|
));
|
|
}
|
|
}
|