Commit 6a1a0703 authored by Manuel Herold's avatar Manuel Herold

deployment changes

added ports to host_provider
added http deployment of demo
parent 80902c26
FROM nginx:latest
EXPOSE 80
EXPOSE 443
ENV http_proxy http://proxy.uni-klu.ac.at:3128/
ENV https_proxy http://proxy.uni-klu.ac.at:3128/
COPY ./src/dashboard/deployment/nginx.conf /etc/nginx/conf.d/default.conf
COPY ./src/dashboard/build/web/ /usr/share/nginx/html/
\ No newline at end of file
import 'package:dashboard/exceptions/login_exception.dart';
import 'package:dashboard/loading.dart';
import 'package:dashboard/ui/graphs/community_meta/cluster_view_page.dart';
import 'package:dashboard/ui/graphs/community_meta/index.dart';
import 'package:dashboard/ui/sign_in/loginpage.dart';
import 'package:dashboard/util/loginhelper.dart';
import 'package:dashboard/util/user.dart';
import 'package:enhanced_future_builder/enhanced_future_builder.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
void main() {
runApp(ArticonfDashboardDemo());
......@@ -43,3 +43,49 @@ class _ArticonfDashboardDemoState extends State<ArticonfDashboardDemo> {
);
}
}
class DemoWidget extends StatefulWidget {
@override
_DemoWidgetState createState() => _DemoWidgetState();
}
class _DemoWidgetState extends State<DemoWidget> {
String _url = "http://rest-gateway/api/users";
String _response;
void _call() async {
try {
http.Response response = await http.get(_url);
setState(() {
_response = "${response.statusCode} - ${response.body}";
});
} catch (e, str) {
setState(() {
_response = "$e,\n\n $str";
});
}
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
TextFormField(
initialValue: _url,
onChanged: (value) => _url = value,
),
SizedBox(height: 8),
ElevatedButton(onPressed: _call, child: Text("Send Request")),
SizedBox(height: 8),
if (_url != null) Text(_response),
],
),
),
),
);
}
}
......@@ -12,7 +12,9 @@ class ClusterGetter {
Future<List<Community>> getNodesfromLayer(String layerName) async {
String url =
"${HostProvider.articonfHost}/api/use-cases/reddit/tables/reddit/layers/$layerName/nodes";
"${HostProvider.articonfHost(30103)}/api/use-cases/reddit/tables/reddit/layers/$layerName/nodes";
Logger().i("calling $url");
BackendUser user = await LoginHelper().loggedInUser;
String token = user.token;
......@@ -70,7 +72,9 @@ class ClusterGetter {
Future<List<Cluster>> getClustersFromLayer(String layerName) async {
String url =
"${HostProvider.articonfHost}/api/use-cases/reddit/tables/reddit/layers/$layerName/clusters";
"${HostProvider.articonfHost(30103)}/api/use-cases/reddit/tables/reddit/layers/$layerName/clusters";
Logger().i("calling $url");
BackendUser user = await LoginHelper().loggedInUser;
String token = user.token;
......
......@@ -2,13 +2,13 @@ import 'package:flutter/foundation.dart';
class HostProvider {
static String _hostArticonfDebug = "https://articonf1.itec.aau.at";
static String _hostArticonfRelease = "https://articonf1";
static String _hostArticonfRelease = "https://articonf1.itec.aau.at";
static String _hostManuelDebug = "http://test.nope-api.systems:81";
static String _hostManuelRelease = "http://manuel";
static String _hostManuelDebug = "https://live.nope-api.systems:81";
static String _hostManuelRelease = "https://live.nope-api.systems:81";
static String articonfHost(int port) {
return kReleaseMode ? _hostArticonfRelease : "$_hostArticonfDebug:$port";
return kReleaseMode ? "$_hostArticonfRelease:$port" : "$_hostArticonfDebug:$port";
}
static String get manuelHost {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment