diff --git a/.env b/.env index ba7db22..2e00319 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -SOFTPLAYER_BACKEND_URL=https://softplayer-backend.badhouseplants.net:8080 +SOFTPLAYER_BACKEND_URL=http://localhost:4020 diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..6f5d3b4 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +flutter 3.41.7-stable diff --git a/Untitled b/Untitled new file mode 100644 index 0000000..9a32cdc --- /dev/null +++ b/Untitled @@ -0,0 +1,311 @@ +Dart SDK 3.11.5 +Flutter SDK 3.41.7 +softplayer_web 1.0.0+1 +├── cupertino_icons 1.0.9 +├── dio 5.9.2 +│ ├── async... +│ ├── collection... +│ ├── dio_web_adapter 2.1.2 +│ │ ├── dio... +│ │ ├── http_parser... +│ │ ├── meta... +│ │ └── web... +│ ├── http_parser... +│ ├── meta... +│ ├── mime 2.0.0 +│ └── path 1.9.1 +├── flutter 0.0.0 +│ ├── characters 1.4.1 +│ ├── collection 1.19.1 +│ ├── material_color_utilities 0.13.0 +│ │ └── collection... +│ ├── meta 1.17.0 +│ ├── sky_engine 0.0.0 +│ └── vector_math 2.2.0 +├── flutter_dotenv 5.2.1 +│ └── flutter... +├── flutter_lints 3.0.2 +│ └── lints 3.0.0 +├── flutter_test 0.0.0 +│ ├── clock... +│ ├── collection... +│ ├── fake_async 1.3.3 +│ │ ├── clock... +│ │ └── collection... +│ ├── flutter... +│ ├── leak_tracker_flutter_testing 3.0.10 +│ │ ├── flutter... +│ │ ├── leak_tracker 11.0.2 +│ │ │ ├── clock... +│ │ │ ├── collection... +│ │ │ ├── meta... +│ │ │ ├── path... +│ │ │ └── vm_service 15.1.0 +│ │ ├── leak_tracker_testing 3.0.2 +│ │ │ ├── leak_tracker... +│ │ │ ├── matcher... +│ │ │ └── meta... +│ │ ├── matcher... +│ │ └── meta... +│ ├── matcher 0.12.19 +│ │ ├── async... +│ │ ├── meta... +│ │ ├── stack_trace... +│ │ ├── term_glyph... +│ │ └── test_api... +│ ├── meta... +│ ├── path... +│ ├── stack_trace 1.12.1 +│ │ └── path... +│ ├── stream_channel 2.1.4 +│ │ └── async... +│ ├── test_api 0.7.10 +│ │ ├── async... +│ │ ├── boolean_selector 2.1.2 +│ │ │ ├── source_span... +│ │ │ └── string_scanner... +│ │ ├── collection... +│ │ ├── meta... +│ │ ├── source_span... +│ │ ├── stack_trace... +│ │ ├── stream_channel... +│ │ ├── string_scanner... +│ │ └── term_glyph 1.2.2 +│ └── vector_math... +├── grpc 4.1.0 +│ ├── async 2.13.1 +│ │ ├── collection... +│ │ └── meta... +│ ├── clock 1.1.2 +│ ├── crypto 3.0.7 +│ │ └── typed_data 1.4.0 +│ │ └── collection... +│ ├── fixnum 1.1.1 +│ ├── googleapis_auth 2.3.0 +│ │ ├── crypto... +│ │ ├── google_cloud 0.4.1 +│ │ │ ├── collection... +│ │ │ ├── http... +│ │ │ ├── io 1.0.5 +│ │ │ │ ├── meta... +│ │ │ │ ├── path... +│ │ │ │ └── string_scanner... +│ │ │ ├── meta... +│ │ │ ├── shelf 1.4.2 +│ │ │ │ ├── async... +│ │ │ │ ├── collection... +│ │ │ │ ├── http_parser... +│ │ │ │ ├── path... +│ │ │ │ ├── stack_trace... +│ │ │ │ └── stream_channel... +│ │ │ └── stack_trace... +│ │ ├── google_identity_services_web 0.3.3+1 +│ │ │ ├── meta... +│ │ │ └── web... +│ │ ├── http... +│ │ ├── http_parser... +│ │ └── meta... +│ ├── http... +│ ├── http2 2.3.1 +│ ├── meta... +│ ├── protobuf 3.1.0 +│ │ ├── collection... +│ │ ├── fixnum... +│ │ └── meta... +│ └── web 1.1.1 +├── http 1.6.0 +│ ├── async... +│ ├── http_parser 4.1.2 +│ │ ├── collection... +│ │ ├── source_span 1.10.2 +│ │ │ ├── collection... +│ │ │ ├── path... +│ │ │ └── term_glyph... +│ │ ├── string_scanner 1.4.1 +│ │ │ └── source_span... +│ │ └── typed_data... +│ ├── meta... +│ └── web... +└── softplayer_dart_proto 1.0.0 + ├── googleapis_grpc 1.0.28+routingonly + │ ├── fixnum... + │ ├── grpc... + │ └── protobuf... + └── protobuf_wellknown 0.1.1 + ├── build 2.5.4 + │ ├── analyzer 7.7.1 + │ │ ├── _fe_analyzer_shared 85.0.0 + │ │ │ └── meta... + │ │ ├── collection... + │ │ ├── convert... + │ │ ├── crypto... + │ │ ├── glob... + │ │ ├── meta... + │ │ ├── package_config... + │ │ ├── path... + │ │ ├── pub_semver 2.2.0 + │ │ │ └── collection... + │ │ ├── source_span... + │ │ ├── watcher 1.2.1 + │ │ │ ├── async... + │ │ │ └── path... + │ │ └── yaml 3.1.3 + │ │ ├── collection... + │ │ ├── source_span... + │ │ └── string_scanner... + │ ├── async... + │ ├── build_runner_core 9.1.2 + │ │ ├── analyzer... + │ │ ├── async... + │ │ ├── build... + │ │ ├── build_config 1.1.2 + │ │ │ ├── checked_yaml 2.0.4 + │ │ │ │ ├── json_annotation... + │ │ │ │ ├── source_span... + │ │ │ │ └── yaml... + │ │ │ ├── json_annotation... + │ │ │ ├── path... + │ │ │ ├── pubspec_parse 1.5.0 + │ │ │ │ ├── checked_yaml... + │ │ │ │ ├── collection... + │ │ │ │ ├── json_annotation... + │ │ │ │ ├── pub_semver... + │ │ │ │ └── yaml... + │ │ │ └── yaml... + │ │ ├── build_resolvers 2.5.4 + │ │ │ ├── analyzer... + │ │ │ ├── async... + │ │ │ ├── build... + │ │ │ ├── build_runner_core... + │ │ │ ├── collection... + │ │ │ ├── convert... + │ │ │ ├── crypto... + │ │ │ ├── graphs... + │ │ │ ├── logging... + │ │ │ ├── package_config... + │ │ │ ├── path... + │ │ │ ├── pool... + │ │ │ ├── pub_semver... + │ │ │ └── stream_transform 2.1.1 + │ │ ├── build_runner 2.5.4 + │ │ │ ├── analyzer... + │ │ │ ├── args 2.7.0 + │ │ │ ├── async... + │ │ │ ├── build... + │ │ │ ├── build_config... + │ │ │ ├── build_daemon 4.1.1 + │ │ │ │ ├── built_collection... + │ │ │ │ ├── built_value... + │ │ │ │ ├── crypto... + │ │ │ │ ├── http_multi_server... + │ │ │ │ ├── logging... + │ │ │ │ ├── path... + │ │ │ │ ├── pool... + │ │ │ │ ├── shelf... + │ │ │ │ ├── shelf_web_socket... + │ │ │ │ ├── stream_transform... + │ │ │ │ ├── watcher... + │ │ │ │ └── web_socket_channel... + │ │ │ ├── build_resolvers... + │ │ │ ├── build_runner_core... + │ │ │ ├── code_builder 4.11.1 + │ │ │ │ ├── built_collection... + │ │ │ │ ├── built_value... + │ │ │ │ ├── collection... + │ │ │ │ ├── matcher... + │ │ │ │ └── meta... + │ │ │ ├── collection... + │ │ │ ├── crypto... + │ │ │ ├── dart_style 3.1.1 + │ │ │ │ ├── analyzer... + │ │ │ │ ├── args... + │ │ │ │ ├── collection... + │ │ │ │ ├── package_config... + │ │ │ │ ├── path... + │ │ │ │ ├── pub_semver... + │ │ │ │ ├── source_span... + │ │ │ │ └── yaml... + │ │ │ ├── frontend_server_client 4.0.0 + │ │ │ │ ├── async... + │ │ │ │ └── path... + │ │ │ ├── glob... + │ │ │ ├── graphs... + │ │ │ ├── http... + │ │ │ ├── http_multi_server 3.2.2 + │ │ │ │ └── async... + │ │ │ ├── io... + │ │ │ ├── js 0.7.2 + │ │ │ ├── logging... + │ │ │ ├── meta... + │ │ │ ├── mime... + │ │ │ ├── package_config... + │ │ │ ├── path... + │ │ │ ├── pool... + │ │ │ ├── pub_semver... + │ │ │ ├── pubspec_parse... + │ │ │ ├── shelf... + │ │ │ ├── shelf_web_socket 3.0.0 + │ │ │ │ ├── shelf... + │ │ │ │ ├── stream_channel... + │ │ │ │ └── web_socket_channel... + │ │ │ ├── stack_trace... + │ │ │ ├── stream_transform... + │ │ │ ├── timing... + │ │ │ ├── watcher... + │ │ │ ├── web... + │ │ │ ├── web_socket_channel 3.0.3 + │ │ │ │ ├── async... + │ │ │ │ ├── crypto... + │ │ │ │ ├── stream_channel... + │ │ │ │ ├── web... + │ │ │ │ └── web_socket 1.0.1 + │ │ │ │ └── web... + │ │ │ └── yaml... + │ │ ├── built_collection... + │ │ ├── built_value... + │ │ ├── collection... + │ │ ├── convert... + │ │ ├── crypto... + │ │ ├── glob... + │ │ ├── graphs... + │ │ ├── json_annotation 4.11.0 + │ │ │ └── meta... + │ │ ├── logging... + │ │ ├── meta... + │ │ ├── package_config... + │ │ ├── path... + │ │ ├── pool... + │ │ ├── timing 1.0.2 + │ │ │ └── json_annotation... + │ │ ├── watcher... + │ │ └── yaml... + │ ├── built_collection 5.1.1 + │ ├── built_value 8.12.5 + │ │ ├── built_collection... + │ │ ├── collection... + │ │ ├── fixnum... + │ │ └── meta... + │ ├── convert 3.1.2 + │ │ └── typed_data... + │ ├── crypto... + │ ├── glob 2.1.3 + │ │ ├── async... + │ │ ├── collection... + │ │ ├── file 7.0.1 + │ │ │ ├── meta... + │ │ │ └── path... + │ │ ├── path... + │ │ └── string_scanner... + │ ├── graphs 2.3.2 + │ │ └── collection... + │ ├── logging 1.3.0 + │ ├── meta... + │ ├── package_config 2.2.0 + │ │ └── path... + │ ├── path... + │ └── pool 1.5.2 + │ ├── async... + │ └── stack_trace... + ├── fixnum... + ├── path... + └── protobuf... diff --git a/lib/api/grpc/accounts.dart b/lib/api/grpc/accounts.dart index 0fb6882..2488341 100644 --- a/lib/api/grpc/accounts.dart +++ b/lib/api/grpc/accounts.dart @@ -1,5 +1,6 @@ import 'package:grpc/grpc_web.dart'; -import 'package:softplayer_dart_proto/main.dart'; +import 'package:softplayer_dart_proto/src/accounts/v1/accounts_v1.pb.dart'; +import 'package:softplayer_dart_proto/src/accounts/v1/accounts_v1.pbgrpc.dart'; class AccountLocalData { AccountLocalData({ @@ -12,36 +13,18 @@ class AccountLocalData { class AccountsGrpc { final GrpcWebClientChannel channel; - late AccountsClient accountsStub; + late AccountsServiceClient accountsStub; AccountsGrpc({ required this.channel, }); void init() { - accountsStub = AccountsClient(channel); - } - - Future signIn( - String username, String email, String password) async { - final request = AccountWithPassword( - data: AccountData( - name: username, - email: email, - ), - password: AccountPassword( - password: password, - )); - try { - final response = await accountsStub.signIn(request); - return AccountLocalData(uuid: response.id.id, token: response.token); - } catch (e) { - rethrow; - } + accountsStub = AccountsServiceClient(channel); } Future signUp( String username, String email, String password) async { - final request = AccountWithPassword( + final request = SignUpRequest( data: AccountData( name: username, email: email, @@ -51,36 +34,7 @@ class AccountsGrpc { )); try { final response = await accountsStub.signUp(request); - return AccountLocalData(uuid: response.id.id, token: response.token); - } catch (e) { - rethrow; - } - } - - Future resetPassword(String username, String email) async { - final request = AccountData( - name: username, - email: email, - ); - try { - final response = await accountsStub.resetPassword(request); - return response; - } catch (e) { - rethrow; - } - } - - Future newPassword( - String username, String code, String newPassword) async { - final request = AccountWithPasswordAndCode( - data: AccountData( - name: username, - ), - code: code, - password: AccountPassword(password: newPassword)); - try { - final response = await accountsStub.newPassword(request); - return response; + return AccountLocalData(uuid: "test", token: "test"); } catch (e) { rethrow; } diff --git a/lib/api/grpc/environments.dart b/lib/api/grpc/environments.dart deleted file mode 100644 index 136d911..0000000 --- a/lib/api/grpc/environments.dart +++ /dev/null @@ -1,106 +0,0 @@ -import 'package:softplayer_dart_proto/main.dart'; -import 'package:softplayer_web/api/grpc/creds.dart'; - -class EnvironmentLocalData { - EnvironmentLocalData( - {required this.serverType, - required this.serverLocation, - required this.provider, - required this.name, - required this.description, - this.uuid}); - - final String name; - final String description; - final String provider; - final String serverType; - final String serverLocation; - String? uuid; -} - -class EnvironmentsGrpc { - // final GrpcWebClientChannel channel; - final EnvironmentsClient envStub; - - // Init the grpc channel for environments - EnvironmentsGrpc(channel) : envStub = EnvironmentsClient(channel); - - // Get environments from the API - Future get(String uuid, SoftplayerCreds creds) async { - final request = GetOptions( - id: EnvironmentId(uuid: uuid), - ownerId: OwnerId(uuid: creds.uuid), - token: Token(token: creds.token), - ); - - try { - final response = await envStub.get(request); - return EnvironmentLocalData( - uuid: uuid, - serverType: response.spec.serverType.toString(), - serverLocation: response.spec.serverLocation.toString(), - provider: response.spec.provider.toString(), - name: response.metadata.name, - description: response.metadata.description); - } catch (e) { - rethrow; - } - } - - Future create( - EnvironmentLocalData data, SoftplayerCreds creds) async { - print(data); - final request = CreateOptions( - metadata: - EnvironmentMetadata(description: data.description, name: data.name), - spec: EnvironmentSpec( - // Currently we do not support other kinds - kubernetes: Kubernetes.KUBERNETES_K3S, - // Currently we do not support other providers - provider: Provider.PROVIDER_HETZNER, - serverLocation: Location.values - .firstWhere((e) => e.toString() == data.serverLocation), - serverType: ServerType.values - .firstWhere((e) => e.toString() == data.serverType), - ), - ownerId: OwnerId(uuid: creds.uuid), - token: Token(token: creds.token), - ); - try { - final response = await envStub.create(request); - return EnvironmentLocalData( - uuid: response.id.uuid, - serverType: response.spec.serverType.toString(), - serverLocation: response.spec.serverLocation.toString(), - provider: response.spec.provider.toString(), - name: response.metadata.name, - description: response.metadata.description); - } catch (e) { - rethrow; - } - } - - Stream> list(SoftplayerCreds creds) async* { - List envs = []; - try { - await for (var feature in envStub.list( - ListOptions( - ownerId: OwnerId(uuid: creds.uuid), - token: Token(token: creds.token), - ), - )) { - envs.add(EnvironmentLocalData( - uuid: feature.id.uuid, - serverType: feature.spec.serverType.toString(), - serverLocation: feature.spec.serverLocation.toString(), - provider: feature.spec.provider.toString(), - name: feature.metadata.name, - description: feature.metadata.description, - )); - } - } catch (e) { - rethrow; - } - yield envs; - } -} diff --git a/lib/components/create_env_form.dart b/lib/components/create_env_form.dart deleted file mode 100644 index 09acd4d..0000000 --- a/lib/components/create_env_form.dart +++ /dev/null @@ -1,161 +0,0 @@ -import 'dart:js' as js; -import 'package:flutter/material.dart'; -import 'package:grpc/grpc_web.dart'; -import 'package:softplayer_dart_proto/main.dart'; -import 'package:softplayer_web/api/grpc/creds.dart'; -import 'package:softplayer_web/api/grpc/environments.dart'; -import 'package:softplayer_web/helpers/providers/common.dart' as helper; - -class CreateEnvForm extends StatefulWidget { - CreateEnvForm(GrpcWebClientChannel channel, {super.key}) - : environmentsGrpc = EnvironmentsGrpc(channel); - final EnvironmentsGrpc environmentsGrpc; - - @override - State createState() => _CreateEnvFormState(); -} - -class _CreateEnvFormState extends State { - final _formKey = GlobalKey(); - final String defaultProvider = Provider.PROVIDER_HETZNER.toString(); - late helper.Provider provider = - helper.ProviderHelper().getProvider(defaultProvider); - late String defaultLocation = provider.defaultLocation(); - final nameCtl = TextEditingController(); - final descriptionCtl = TextEditingController(); - late String? serverLocation = defaultLocation; - late String? serverType = ServerType.SERVER_TYPE_REGULAR.toString(); - - void createEnvironment() { - // Validate returns true if the form is valid, or false otherwise. - if (_formKey.currentState!.validate()) { - final name = nameCtl.text; - final description = descriptionCtl.text; - widget.environmentsGrpc - .create( - EnvironmentLocalData( - serverType: serverType!, - serverLocation: serverLocation!, - provider: defaultProvider, - name: name, - description: description), - SoftplayerCredsHelpers().fromLocalStorage()) - .then((rs) { - Navigator.pop(context); - }).catchError((e) { - GrpcError error = e; - String msg; - if (error.message != null) { - msg = error.message!; - } else { - msg = error.toString(); - } - ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text(msg), - backgroundColor: Colors.red, - showCloseIcon: true, - behavior: SnackBarBehavior.floating, - )); - }); - } - } - - String defaultServerType = "Regular"; - Widget createEnvForm() => SingleChildScrollView( - child: SizedBox( - width: 420, - child: Form( - key: _formKey, - child: Center( - child: Column(children: [ - TextFormField( - autofocus: true, - controller: nameCtl, - decoration: const InputDecoration( - hintText: "Enter the environment name", - icon: Icon(Icons.computer), - label: Text("Name"), - ), - cursorWidth: 1, - cursorHeight: 18, - cursorRadius: const Radius.circular(10), - ), - TextFormField( - autofocus: false, - controller: descriptionCtl, - decoration: const InputDecoration( - hintText: "Enter the environment description", - icon: Icon(Icons.description), - label: Text("Description"), - ), - maxLength: 360, - cursorWidth: 1, - cursorHeight: 18, - cursorRadius: const Radius.circular(10), - ), - DropdownButtonFormField( - decoration: const InputDecoration( - hintText: "Enter the environment description", - icon: Icon(Icons.computer), - label: Text("Type of the server"), - ), - value: ServerType.SERVER_TYPE_REGULAR.toString(), - isDense: true, - items: ServerType.values - .where((element) => - element != ServerType.SERVER_TYPE_CUSTOM && - element != ServerType.SERVER_TYPE_UNSPECIFIED) - .map((serverType) { - return DropdownMenuItem( - value: serverType.toString(), - child: Text(helper.ProviderHelper() - .getServerType(serverType.toString())), - ); - }).toList(), - onChanged: (value) => setState(() { - serverType = value; - }), - ), - TextButton( - onPressed: () => js.context.callMethod( - 'open', ['https://stackoverflow.com/questions/ask']), - child: const Text("Read more about environment types here"), - ), - DropdownButtonFormField( - decoration: const InputDecoration( - hintText: "Enter the environment location", - icon: Icon(Icons.location_on), - label: Text("Location of the server"), - ), - value: defaultLocation, - isDense: true, - items: Location.values - .where((element) => element - .toString() - .contains(provider.getProviderName().toUpperCase())) - .map((serverType) { - return DropdownMenuItem( - value: serverType.toString(), - child: Text( - provider.getServerLocation(serverType.toString())), - ); - }).toList(), - onChanged: (value) => setState(() { - serverLocation = value; - }), - ), - ]))))); - List createEnvActions() => [ - TextButton( - onPressed: createEnvironment, - child: const Text('OK'), - ), - ]; - - @override - Widget build(BuildContext context) => AlertDialog( - title: const Text("Create a new environment"), - content: createEnvForm(), - actions: createEnvActions(), - ); -} diff --git a/lib/components/environment_card.dart b/lib/components/environment_card.dart deleted file mode 100644 index bfcf857..0000000 --- a/lib/components/environment_card.dart +++ /dev/null @@ -1,102 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:softplayer_web/api/grpc/environments.dart'; -import 'package:softplayer_web/components/environment_preview.dart'; -import 'package:softplayer_web/helpers/providers/common.dart'; - -class EnvirnomentCard extends StatefulWidget { - final EnvironmentLocalData env; - - const EnvirnomentCard({ - super.key, - required this.env, - }); - - @override - State createState() => _EnvirnomentCardState(); -} - -class _EnvirnomentCardState extends State { - late double elevation = 1.0; - - @override - Widget build(BuildContext context) { - Provider provider = ProviderHelper().getProvider(widget.env.provider); - - String serverType; - String serverLocation; - try { - serverType = ProviderHelper().getServerType(widget.env.serverType); - serverLocation = provider.getServerLocation(widget.env.serverLocation); - } catch (e) { - rethrow; - } - - return Container( - margin: const EdgeInsets.all(8.0), - height: 10, - child: MouseRegion( - onExit: (event) { - setState(() { - elevation = 1.0; - }); - }, - onEnter: (event) { - setState(() { - elevation = 5.0; - }); - }, - child: Card( - elevation: elevation, - child: SelectionArea( - child: InkWell( - onLongPress: () => showMenu( - position: RelativeRect.fromSize(Rect.largest, Size.infinite), - context: context, - items: [ - const PopupMenuItem(child: Text("test")), - const PopupMenuItem(child: Text("text")), - ], - ), - onTap: () => showDialog( - context: context, - builder: (context) => EnvirnomentPreiview(env: widget.env), - ), - child: Column( - children: [ - Text(widget.env.name), - const Divider(), - Table( - border: const TableBorder( - bottom: BorderSide.none, - left: BorderSide.none, - right: BorderSide.none, - top: BorderSide.none, - ), - children: [ - TableRow(children: [ - const Text("Description"), - Text(widget.env.description), - ]), - TableRow(children: [ - const Text("Provider"), - Text(provider.getProviderName()), - ]), - TableRow(children: [ - const Text("Server Type"), - Text(serverType), - ]), - TableRow(children: [ - const Text("Location"), - Text(serverLocation), - ]), - ], - ) - ], - ), - ), - ), - ), - ), - ); - } -} diff --git a/lib/components/environment_preview.dart b/lib/components/environment_preview.dart deleted file mode 100644 index 685a453..0000000 --- a/lib/components/environment_preview.dart +++ /dev/null @@ -1,90 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:softplayer_web/api/grpc/environments.dart'; -import 'package:softplayer_web/helpers/providers/common.dart'; - -class EnvirnomentPreiview extends StatefulWidget { - @override - State createState() => _EnvirnomentPreviewState(); - final EnvironmentLocalData env; - - const EnvirnomentPreiview({ - super.key, - required this.env, - }); -} - -class _EnvirnomentPreviewState extends State { - @override - Widget build(BuildContext context) { - Provider provider = ProviderHelper().getProvider(widget.env.provider); - - String serverType; - String serverLocation; - try { - serverType = ProviderHelper().getServerType(widget.env.serverType); - serverLocation = provider.getServerLocation(widget.env.serverLocation); - } catch (e) { - rethrow; - } - - return AlertDialog( - title: Text(widget.env.name), - content: SizedBox( - height: 420, - width: 420, - child: Column( - children: [ - Table( - border: const TableBorder( - bottom: BorderSide.none, - left: BorderSide.none, - right: BorderSide.none, - top: BorderSide.none, - ), - children: [ - TableRow(children: [ - const Text("Description"), - Text(widget.env.description), - ]), - TableRow(children: [ - const Text("Provider"), - Text(provider.getProviderName()), - ]), - TableRow(children: [ - const Text("Server Type"), - Text(serverType), - ]), - TableRow(children: [ - const Text("Location"), - Text(serverLocation), - ]), - ], - ), - const Divider(), - Table( - border: const TableBorder( - bottom: BorderSide.none, - left: BorderSide.none, - right: BorderSide.none, - top: BorderSide.none, - ), - children: const [ - TableRow(children: [ - Text("Price per hour"), - Text("0.52"), - ]), - TableRow(children: [ - Text("Current usage"), - Text("10.5"), - ]), - ], - ), - ], - ), - ), - actions: [ - TextButton(onPressed: () => print("lala"), child: const Text("test")), - TextButton(onPressed: () => print("lala"), child: const Text("test")), - ]); - } -} diff --git a/lib/components/environments.dart b/lib/components/environments.dart deleted file mode 100644 index 25a6686..0000000 --- a/lib/components/environments.dart +++ /dev/null @@ -1,105 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:grpc/grpc_web.dart'; -import 'package:softplayer_web/api/grpc/creds.dart'; -import 'package:softplayer_web/api/grpc/environments.dart'; -import 'package:softplayer_web/components/environment_card.dart'; - -class EnvirnomentList extends StatefulWidget { - const EnvirnomentList({ - super.key, - required this.channel, - }); - final GrpcWebClientChannel channel; - @override - State createState() => _EnvirnomentListState(); -} - -class _EnvirnomentListState extends State { - late EnvironmentsGrpc envGrpc; - List envs = []; - @override - void initState() { - super.initState(); - envGrpc = EnvironmentsGrpc(widget.channel); - } - - final GlobalKey _key = GlobalKey(); // Create a key - - @override - Widget build(BuildContext context) { - return Scaffold( - key: _key, - endDrawer: const Drawer(child: Text("Env")), - body: Container( - width: double.infinity, - height: double.infinity, - decoration: const BoxDecoration( - gradient: LinearGradient(colors: [ - Colors.blueGrey, - Colors.cyan, - Colors.yellow, - ])), - child: StreamBuilder( - stream: - envGrpc.list(SoftplayerCredsHelpers().fromLocalStorage()), - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return const CircularProgressIndicator(); - } else if (snapshot.connectionState == ConnectionState.done) { - if (snapshot.hasError) { - return const Text('Error!'); - } else { - if (snapshot.hasData) { - var data = snapshot.requireData; - if (data.isNotEmpty) { - return Container( - margin: const EdgeInsetsDirectional.fromSTEB( - 50.0, 20.0, 50.0, 10.0), - child: Column(children: [ - Flexible( - child: Container( - child: const TextField( - decoration: InputDecoration( - fillColor: Colors.white, - filled: true, - labelText: "Search", - prefixIcon: Icon(Icons.search)), - ), - ), - ), - Container( - child: Flexible( - child: GridView.count( - childAspectRatio: (30 / 13), - crossAxisCount: 4, - children: snapshot.data! - .map((e) => EnvirnomentCard( - env: e, - )) - .toList(), - )), - ) - ]), - ); - } else { - return Center( - child: Container( - height: 300, - decoration: BoxDecoration( - border: Border.all(), - shape: BoxShape.rectangle, - borderRadius: - const BorderRadius.all(Radius.circular(10)), - color: const Color.fromRGBO(100, 150, 80, 20), - ), - child: const Text( - "To get strated, use the button in the corner"), - )); - } - } - } - } - return const Text("err"); - }))); - } -} diff --git a/lib/components/login_form.dart b/lib/components/login_form.dart index 66fa231..a4bb0c2 100644 --- a/lib/components/login_form.dart +++ b/lib/components/login_form.dart @@ -62,142 +62,6 @@ class _LoginFormState extends State { } } - void submitSignIn() { - // Validate returns true if the form is valid, or false otherwise. - if (_formKey.currentState!.validate()) { - final username = usernameCtrl.text; - final password = passwordCtrl.text; - accountsGrpc.signIn(username, "", password).then((rs) { - window.localStorage["token"] = rs.token; - window.localStorage["uuid"] = rs.uuid; - widget.notifyParent(); - // Navigator.of(context, rootNavigator: true).pop(); - }).catchError((e) { - GrpcError error = e; - String msg; - if (error.message != null) { - msg = error.message!; - } else { - msg = error.toString(); - } - ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text(msg), - backgroundColor: Colors.red, - showCloseIcon: true, - behavior: SnackBarBehavior.floating, - )); - passwordCtrl.clear(); - }); - } - } - - void subminResetPassword() { - // Validate returns true if the form is valid, or false otherwise. - if (_formKey.currentState!.validate()) { - final username = usernameCtrl.text; - final password = passwordCtrl.text; - final code = codeCtrl.text; - accountsGrpc.newPassword(username, code, password).then((rs) { - action = Action.singIn; - // Navigator.of(context, rootNavigator: true).pop(); - }).catchError((e) { - GrpcError error = e; - String msg; - if (error.message != null) { - msg = error.message!; - } else { - msg = error.toString(); - } - ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text(msg), - backgroundColor: Colors.red, - showCloseIcon: true, - behavior: SnackBarBehavior.floating, - )); - passwordCtrl.clear(); - }); - } - } - - void sendCode() { - if (_formKey.currentState!.validate()) { - final username = usernameCtrl.text; - final email = emailCtrl.text; - accountsGrpc - .resetPassword(username, email) - .then((_) => setState(() { - codeEnabled = true; - })) - .catchError((e) { - GrpcError error = e; - String msg; - if (error.message != null) { - msg = error.message!; - } else { - msg = error.toString(); - } - ScaffoldMessenger.of(context).showSnackBar(SnackBar( - content: Text(msg), - backgroundColor: Colors.red, - showCloseIcon: true, - behavior: SnackBarBehavior.floating, - )); - }); - } - } - - Widget signInForm() => SizedBox( - width: 420, - height: 280, - child: Form( - key: _formKey, - child: Center( - child: Column(children: [ - TextFormField( - onFieldSubmitted: (value) => submitSignIn(), - autofocus: true, - controller: usernameCtrl, - decoration: const InputDecoration( - hintText: "Enter your username", - icon: Icon(Icons.account_circle), - label: Text("Username"), - ), - cursorWidth: 1, - cursorHeight: 18, - cursorRadius: const Radius.circular(10), - ), - TextFormField( - onFieldSubmitted: (value) => submitSignIn(), - controller: passwordCtrl, - obscureText: true, - decoration: const InputDecoration( - hintText: "Enter your password", - icon: Icon(Icons.password), - label: Text("Password")), - cursorWidth: 1, - cursorHeight: 18, - cursorRadius: const Radius.circular(10), - ), - TextButton( - onPressed: () => setState(() { - action = Action.resetPassword; - }), - child: const Text("reset yomakeur password")), - ])))); - - List signInActions() => [ - TextButton( - onPressed: () => setState(() { - action = Action.signUp; - }), - child: const Text('Sing Up'), - ), - TextButton( - onPressed: submitSignIn, - child: const Text('OK'), - ), - ]; - List signUpActions() => [ TextButton( onPressed: () => setState(() { @@ -224,10 +88,6 @@ class _LoginFormState extends State { }), child: const Text('Sing Up'), ), - TextButton( - onPressed: subminResetPassword, - child: const Text('OK'), - ), ]; Widget signUpForm() => SizedBox( @@ -288,88 +148,6 @@ class _LoginFormState extends State { cursorRadius: const Radius.circular(10), ), ])))); - Widget resetPasswordForm() => SizedBox( - width: 420, - height: 420, - child: Form( - key: _formKey, - child: Center( - child: Column(children: [ - TextFormField( - // onFieldSubmitted: (value) => submitSignUp(), - autofocus: true, - controller: usernameCtrl, - decoration: const InputDecoration( - hintText: "Enter your username", - icon: Icon(Icons.account_circle), - label: Text("Username"), - ), - cursorWidth: 1, - cursorHeight: 18, - cursorRadius: const Radius.circular(10), - ), - TextFormField( - // onFieldSubmitted: (value) => submitSignUp(), - controller: emailCtrl, - autofocus: true, - decoration: const InputDecoration( - hintText: "Enter your email", - icon: Icon(Icons.email), - label: Text("Email"), - ), - cursorWidth: 1, - cursorHeight: 18, - cursorRadius: const Radius.circular(10), - ), - TextButton( - onPressed: () => sendCode(), - child: const Text("send code to email")), - TextFormField( - // onFieldSubmitted: (value) => submitSignUp(), - controller: codeCtrl, - autofocus: false, - enabled: codeEnabled, - decoration: const InputDecoration( - hintText: "Enter code that you've received via the email", - icon: Icon(Icons.numbers), - label: Text("Code"), - ), - cursorWidth: 1, - cursorHeight: 18, - cursorRadius: const Radius.circular(10), - ), - TextFormField( - // onFieldSubmitted: (value) => submitSignUp(), - controller: passwordCtrl, - autofocus: false, - enabled: codeEnabled, - obscureText: true, - decoration: const InputDecoration( - hintText: "Enter a new password", - icon: Icon(Icons.password), - label: Text("Password"), - ), - cursorWidth: 1, - cursorHeight: 18, - cursorRadius: const Radius.circular(10), - ), - TextFormField( - // onFieldSubmitted: (value) => submitSignUp(), - controller: passwordVerifyCtrl, - autofocus: false, - enabled: codeEnabled, - obscureText: true, - decoration: const InputDecoration( - hintText: "Enter a new password", - icon: Icon(Icons.password), - label: Text("Password"), - ), - cursorWidth: 1, - cursorHeight: 18, - cursorRadius: const Radius.circular(10), - ), - ])))); - @override void initState() { super.initState(); @@ -383,22 +161,14 @@ class _LoginFormState extends State { // content: action == Action.singIn ? signInForm() : signUpForm(), content: () { switch (action) { - case Action.signUp: - return signUpForm(); - case Action.resetPassword: - return resetPasswordForm(); default: - return signInForm(); + return signUpForm(); } }(), actions: () { switch (action) { - case Action.signUp: - return signUpActions(); - case Action.resetPassword: - return resetPasswordActions(); default: - return signInActions(); + return signUpActions(); } }()); } diff --git a/lib/helpers/page_wrapper.dart b/lib/helpers/page_wrapper.dart deleted file mode 100644 index 03e0a02..0000000 --- a/lib/helpers/page_wrapper.dart +++ /dev/null @@ -1,28 +0,0 @@ -import 'dart:html'; - -import 'package:flutter/material.dart'; -import 'package:softplayer_web/api/grpc/accounts.dart'; -import 'package:softplayer_web/components/menubar.dart'; - -class PageWrapper extends StatelessWidget { - final Widget child; - final MenuPanel appBar; - const PageWrapper( - {super.key, - required this.child, - required this.appBar, - required this.accountsGrpc}); - - final AccountsGrpc accountsGrpc; - bool isSignedIn() { - return window.localStorage.containsKey("token"); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: appBar, - body: child, - ); - } -} diff --git a/lib/helpers/providers/common.dart b/lib/helpers/providers/common.dart deleted file mode 100644 index 7973c47..0000000 --- a/lib/helpers/providers/common.dart +++ /dev/null @@ -1,52 +0,0 @@ -import 'package:softplayer_dart_proto/environments/environments_v1.pbenum.dart'; -import 'package:softplayer_web/helpers/providers/hetzner.dart'; - -abstract class Provider { - String getServerLocation(String serverLocation); - String rawServerLocation(String serverLocation); - String defaultLocation(); - - String getProviderName(); - String rawProviderName(); -} - -class ProviderHelper { - String getServerType(String serverType) { - if (serverType == ServerType.SERVER_TYPE_STARTER.toString()) { - return "Starter"; - } else if (serverType == ServerType.SERVER_TYPE_REGULAR.toString()) { - return "Regular"; - } else if (serverType == ServerType.SERVER_TYPE_PLUS.toString()) { - return "Plus"; - } else if (serverType == ServerType.SERVER_TYPE_PRO.toString()) { - return "Pro"; - } else if (serverType == ServerType.SERVER_TYPE_CUSTOM.toString()) { - throw 'Custom server type is not yet supported'; - } else { - throw 'Unknown server type'; - } - } - - String rawServerType(String serverType) { - if (serverType == "Starter") { - return ServerType.SERVER_TYPE_STARTER.toString(); - } else if (serverType == "Regular") { - return ServerType.SERVER_TYPE_REGULAR.toString(); - } else if (serverType == "Plus") { - return ServerType.SERVER_TYPE_PLUS.toString(); - } else if (serverType == "Pro") { - return ServerType.SERVER_TYPE_PRO.toString(); - } else { - throw 'Unknown server type'; - } - } - - Hetzner getProvider(String provider) { - switch (provider) { - case "hetzner" || "PROVIDER_HETZNER": - return Hetzner(); - default: - throw "unknown prodiver"; - } - } -} diff --git a/lib/helpers/providers/hetzner.dart b/lib/helpers/providers/hetzner.dart deleted file mode 100644 index 8e8a9ca..0000000 --- a/lib/helpers/providers/hetzner.dart +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:softplayer_dart_proto/environments/environments_v1.pbgrpc.dart'; -import 'package:softplayer_web/helpers/providers/common.dart' as helper; - -class Hetzner implements helper.Provider { - @override - String getProviderName() { - return "Hetzner"; - } - - @override - String rawProviderName() { - return Provider.PROVIDER_HETZNER.toString(); - } - - @override - String getServerLocation(String serverType) { - if (serverType == Location.LOCATION_HETZNER_ASHBURN.toString()) { - return "Ashburn, USA"; - } else if (serverType == Location.LOCATION_HETZNER_FALKENSTEIN.toString()) { - return "Falkenstein, Germany"; - } else if (serverType == Location.LOCATION_HETZNER_HELSINKI.toString()) { - return "Helsinki, Finland"; - } else if (serverType == Location.LOCATION_HETZNER_HILLSBORO.toString()) { - return "Hillsboro, USA"; - } else if (serverType == Location.LOCATION_HETZNER_NUREMBERG.toString()) { - return "Nuremberg, Germany"; - } else { - throw 'Unknown server type'; - } - } - - @override - String rawServerLocation(String serverLocation) { - if (serverLocation == "Ashburn, USA") { - return Location.LOCATION_HETZNER_ASHBURN.toString(); - } else if (serverLocation == "Falkenstein, Germany") { - return Location.LOCATION_HETZNER_FALKENSTEIN.toString(); - } else if (serverLocation == "Helsinki, Finland") { - return Location.LOCATION_HETZNER_HELSINKI.toString(); - } else if (serverLocation == "Hillsboro, USA") { - return Location.LOCATION_HETZNER_HILLSBORO.toString(); - } else if (serverLocation == "Nuremberg, Germany") { - return Location.LOCATION_HETZNER_NUREMBERG.toString(); - } else { - throw 'Unknown server type'; - } - } - - @override - String defaultLocation() { - return Location.LOCATION_HETZNER_NUREMBERG.toString(); - } -} diff --git a/lib/main.dart b/lib/main.dart index e2c89aa..9e75aa8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,9 +4,6 @@ import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter/material.dart'; import 'package:grpc/grpc_web.dart'; import 'package:softplayer_web/api/grpc/accounts.dart'; -import 'package:softplayer_web/api/grpc/creds.dart'; -import 'package:softplayer_web/components/create_env_form.dart'; -import 'package:softplayer_web/components/environments.dart'; import 'package:softplayer_web/components/login_form.dart'; void main() async { @@ -58,90 +55,22 @@ class _StateRootWidget extends State { } final GlobalKey _key = GlobalKey(); // Create a key + @override Widget build(BuildContext context) { - if (!isSignedIn()) { - return Scaffold( - body: Container( - width: double.infinity, - height: double.infinity, - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/login_background.jpg"), - fit: BoxFit.cover, - ), - ), - child: LoginForm( - grpcChannel: widget.channel, - notifyParent: refresh, - ), - )); - } else { - EnvirnomentList envList = EnvirnomentList(channel: widget.channel); - return DefaultTabController( - length: 3, - initialIndex: 0, - child: Scaffold( - key: _key, - endDrawer: const Drawer(child: Text("text")), - body: TabBarView(children: [envList, envList]), - appBar: AppBar( - backgroundColor: Colors.grey, - centerTitle: false, - title: const Text("Softplayer"), - bottom: const TabBar( - tabs: [ - Tab( - icon: Icon(Icons.computer), - text: "Environments", - ), - Tab( - icon: Icon(Icons.install_desktop), - text: "Your applications", - ), - Tab( - icon: Icon(Icons.list), - text: "Application Catalog", - ), - ], + return Scaffold( + body: Container( + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/login_background.jpg"), + fit: BoxFit.cover, + ), ), - actions: [ - PopupMenuButton( - child: const Row(children: [ - Icon(Icons.account_circle), - Text("account"), - ]), - itemBuilder: (context) => [ - const PopupMenuItem( - child: Row( - children: [Icon(Icons.settings), Text("Settings")], - ), - ), - const PopupMenuItem( - child: Row(children: [ - Icon(Icons.monetization_on), - Text("Invoices"), - ])), - PopupMenuItem( - child: const Row( - children: [Icon(Icons.logout), Text("Sign out")]), - onTap: () { - SoftplayerCredsHelpers().cleanupLocalStorate(); - refresh(); - }, - ), - ]) - ], - ), - floatingActionButton: FloatingActionButton( - child: const Icon(Icons.add), - onPressed: () => showDialog( - context: context, - builder: (context) => CreateEnvForm(widget.channel), - ), - ), - ), - ); - } + child: LoginForm( + grpcChannel: widget.channel, + notifyParent: refresh, + ))); } } diff --git a/lib/models/catalog_entry.dart b/lib/models/catalog_entry.dart deleted file mode 100644 index 7c00629..0000000 --- a/lib/models/catalog_entry.dart +++ /dev/null @@ -1,10 +0,0 @@ -class CatalogEntry { - CatalogEntry({ - required this.name, - required this.description, - required this.logoUrl, - }); - final String name; - final String description; - final String logoUrl; -} diff --git a/lib/models/environments.dart b/lib/models/environments.dart deleted file mode 100644 index c90f35c..0000000 --- a/lib/models/environments.dart +++ /dev/null @@ -1,10 +0,0 @@ -class Environment { - final String name; - final List apps; - final String provider; - Environment({ - required this.name, - required this.apps, - required this.provider, - }); -} diff --git a/lib/pages/about.dart b/lib/pages/about.dart deleted file mode 100644 index fb879e0..0000000 --- a/lib/pages/about.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:flutter/material.dart'; - -class AboutPage extends StatefulWidget { - const AboutPage({super.key}); - final String title = "about"; - - @override - State createState() => _AboutPage(); -} - -class _AboutPage extends State { - @override - Widget build(BuildContext context) { - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - 'You have pushed the button this many times:', - ), - Text( - 'test', - style: Theme.of(context).textTheme.headlineMedium, - ), - ], - ), - ); - } -} diff --git a/lib/pages/catalog.dart b/lib/pages/catalog.dart deleted file mode 100644 index 99153dd..0000000 --- a/lib/pages/catalog.dart +++ /dev/null @@ -1,77 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:softplayer_web/api/third_party/chartmuseum.dart'; -import 'package:softplayer_web/components/catalog_card.dart'; -import 'package:softplayer_web/models/catalog_entry.dart'; - -class CatalogPage extends StatefulWidget { - const CatalogPage({ - super.key, - }); - final String title = "catalog"; - - @override - State createState() => _CatalogPage(); -} - -class _CatalogPage extends State { - late Future> helmChart; - @override - void initState() { - super.initState(); - helmChart = fetchCharts(); - } - - final List catalog = [ - CatalogEntry( - name: "openvpn", - description: "you know what I mean", - logoUrl: - "https://upload.wikimedia.org/wikipedia/commons/f/f5/OpenVPN_logo.svg"), - CatalogEntry( - name: "openvpn", - description: "you know what I mean", - logoUrl: - "https://upload.wikimedia.org/wikipedia/commons/f/f5/OpenVPN_logo.svg"), - ]; - @override - Widget build(BuildContext context) { - print(helmChart); - return Container( - margin: const EdgeInsets.all(14), - child: Container( - child: Row(children: [ - const SizedBox( - width: 200, - child: Card( - child: Column( - children: [Text("Filter")], - ))), - Flexible( - child: Column( - children: [ - const TextField( - decoration: InputDecoration( - icon: Icon(Icons.search), - labelText: "Search", - ), - autofocus: true, - ), - CatalogCard(data: catalog), - FutureBuilder( - future: helmChart, - builder: (context, snapshot) { - print(snapshot); - if (snapshot.hasData) { - return Text(snapshot.data!.first.name); - } else if (snapshot.hasError) { - return SelectableText('${snapshot.error}'); - } - return const CircularProgressIndicator(); - }), - ], - ), - ) - ])), - ); - } -} diff --git a/lib/pages/home.dart b/lib/pages/home.dart deleted file mode 100644 index 832c273..0000000 --- a/lib/pages/home.dart +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:flutter/material.dart'; - -class HomePage extends StatefulWidget { - const HomePage({super.key}); - static String title = "home"; - - @override - State createState() => _HomePage(); -} - -class _HomePage extends State { - @override - Widget build(BuildContext context) { - return const Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'You have pushed the button this many times:', - ), - ], - )); - } -} diff --git a/pubspec.lock b/pubspec.lock index 096e92c..86a8f09 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,102 +1,94 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: - dependency: transitive - description: - name: archive - sha256: ecf4273855368121b1caed0d10d4513c7241dfc813f7d3c8933b36622ae9b265 - url: "https://pub.dev" - source: hosted - version: "3.5.1" - args: - dependency: transitive - description: - name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" - url: "https://pub.dev" - source: hosted - version: "2.5.0" async: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.13.1" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" characters: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.1" clock: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" collection: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.1" crypto: dependency: transitive description: name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.7" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" url: "https://pub.dev" source: hosted - version: "1.0.8" + version: "1.0.9" dio: dependency: "direct main" description: name: dio - sha256: "11e40df547d418cc0c4900a9318b26304e665da6fa4755399a9ff9efd09034b5" + sha256: aff32c08f92787a557dd5c0145ac91536481831a01b4648136373cddb0e64f8c url: "https://pub.dev" source: hosted - version: "5.4.3+1" + version: "5.9.2" + dio_web_adapter: + dependency: transitive + description: + name: dio_web_adapter + sha256: "2f9e64323a7c3c7ef69567d5c800424a11f8337b8b228bad02524c9fb3c1f340" + url: "https://pub.dev" + source: hosted + version: "2.1.2" fake_async: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.3" fixnum: dependency: transitive description: name: fixnum - sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" flutter: dependency: "direct main" description: flutter @@ -106,236 +98,269 @@ packages: dependency: "direct main" description: name: flutter_dotenv - sha256: "9357883bdd153ab78cbf9ffa07656e336b8bbb2b5a3ca596b0b27e119f7c7d77" + sha256: d41da11fb497314fbf89811ec30af02d1d898b47980a129f0a8c0a1720460ba2 url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "6.0.1" flutter_lints: dependency: "direct dev" description: name: flutter_lints - sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "6.0.0" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + google_cloud: + dependency: transitive + description: + name: google_cloud + sha256: fbcde933b2d8600c3cdb2328f8f4c47628ec29a39e9cef85dee535c7868993c4 + url: "https://pub.dev" + source: hosted + version: "0.4.1" google_identity_services_web: dependency: transitive description: name: google_identity_services_web - sha256: "9482364c9f8b7bd36902572ebc3a7c2b5c8ee57a9c93e6eb5099c1a9ec5265d8" + sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" url: "https://pub.dev" source: hosted - version: "0.3.1+1" + version: "0.3.3+1" googleapis_auth: dependency: transitive description: name: googleapis_auth - sha256: befd71383a955535060acde8792e7efc11d2fccd03dd1d3ec434e85b68775938 + sha256: "661738b763d3e524de69df53bf4e03943e4e01e98265cebcc6684871b06a5379" url: "https://pub.dev" source: hosted - version: "1.6.0" + version: "2.3.0" grpc: dependency: "direct main" description: name: grpc - sha256: e93ee3bce45c134bf44e9728119102358c7cd69de7832d9a874e2e74eb8cab40 + sha256: "86be3a7d39ad865b214a7370021ac80e68939238b507730de6d97fc662cb2723" url: "https://pub.dev" source: hosted - version: "3.2.4" + version: "5.1.0" http: dependency: "direct main" description: name: http - sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.6.0" http2: dependency: transitive description: name: http2 - sha256: "9ced024a160b77aba8fb8674e38f70875e321d319e6f303ec18e87bd5a4b0c1d" + sha256: "382d3aefc5bd6dc68c6b892d7664f29b5beb3251611ae946a98d35158a82bbfa" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.1" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.0" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.2" lints: dependency: transitive description: name: lints - sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "6.1.0" matcher: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.19" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.13.0" meta: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.17.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" path: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" protobuf: dependency: transitive description: name: protobuf - sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" + sha256: "75ec242d22e950bdcc79ee38dd520ce4ee0bc491d7fadc4ea47694604d22bf06" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "6.0.0" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" softplayer_dart_proto: dependency: "direct main" description: path: "." - ref: main - resolved-ref: "5ee911c92eee4ee7db58a2da0407da4f7db2f994" - url: "https://git.badhouseplants.net/softplayer/softplayer-dart-proto.git" + ref: "3e742ade989e461c42ea20fb757eb2b90577c65e" + resolved-ref: "3e742ade989e461c42ea20fb757eb2b90577c65e" + url: "https://gitea.badhouseplants.net/softplayer/softplayer-dart-proto.git" source: git - version: "1.0.0+1" + version: "1.0.0" source_span: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.10.2" stack_trace: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" string_scanner: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" test_api: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.10" typed_data: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: "046d3928e16fa4dc46e8350415661755ab759d9fc97fc21b5ab295f71e4f0499" url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "15.1.0" web: dependency: transitive description: name: web - sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "1.1.1" sdks: - dart: ">=3.3.0 <4.0.0" + dart: ">=3.11.5 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index 52ee53e..6ce13fc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,32 +1,32 @@ name: softplayer_web -description: | +description: | An web interface for managing softplayer applications and environments -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.3.0 <4.0.0' + sdk: ">=3.3.0 <4.0.0" dependencies: flutter: sdk: flutter softplayer_dart_proto: git: - url: https://git.badhouseplants.net/softplayer/softplayer-dart-proto.git - ref: main - cupertino_icons: ^1.0.6 - grpc: ^3.2.4 - http: ^1.2.1 - dio: ^5.4.2 - flutter_dotenv: ^5.1.0 + url: https://gitea.badhouseplants.net/softplayer/softplayer-dart-proto.git + ref: 3e742ade989e461c42ea20fb757eb2b90577c65e + cupertino_icons: ^1.0.9 + grpc: 5.1.0 + http: ^1.6.0 + dio: ^5.9.2 + flutter_dotenv: ^6.0.1 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^3.0.0 + flutter_lints: ^6.0.0 flutter: uses-material-design: true assets: - assets/ - - .env \ No newline at end of file + - .env