From e0a742768e5bfd220a9abf408c01ffb4fb1dcad4 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 16:19:41 +0200 Subject: [PATCH 01/44] I don't think you're supposed to commit environment specific files :-) --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 07488ba..4e85588 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,6 @@ !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages + +android/local.properties +android/gradlew \ No newline at end of file From c2803560be71a633d1d1dfeb517f76d01d2b364f Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 16:20:12 +0200 Subject: [PATCH 02/44] I don't think you're supposed to commit environment specific files :-) --- android/gradlew | 160 --------------------------------------- android/local.properties | 5 -- 2 files changed, 165 deletions(-) delete mode 100644 android/gradlew delete mode 100644 android/local.properties diff --git a/android/gradlew b/android/gradlew deleted file mode 100644 index 9d82f78..0000000 --- a/android/gradlew +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/android/local.properties b/android/local.properties deleted file mode 100644 index 9f4eae3..0000000 --- a/android/local.properties +++ /dev/null @@ -1,5 +0,0 @@ -sdk.dir=E:\\Pterodactly\\sdk -flutter.sdk=E:\\Pterodactly\\flutter -flutter.buildMode=debug -flutter.versionName=2.6.6 -flutter.versionCode=37 \ No newline at end of file From fbc774e32f4a4f899d0039e23b70ed5be026a0d6 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 16:22:13 +0200 Subject: [PATCH 03/44] variable name -> logical name --- lib/page/auth/sponsorlist.dart | 18 +++++++++--------- lib/sponsor.dart | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/page/auth/sponsorlist.dart b/lib/page/auth/sponsorlist.dart index 6f77ef1..9730c94 100644 --- a/lib/page/auth/sponsorlist.dart +++ b/lib/page/auth/sponsorlist.dart @@ -1,26 +1,26 @@ class SponsorList { final String avatarUrl; final String name; - final String datetime; + final String donation; final String message; final String link; SponsorList( - {this.avatarUrl, this.name, this.datetime, this.message, this.link}); + {this.avatarUrl, this.name, this.donation, this.message, this.link}); static final List dummyData = [ SponsorList( avatarUrl: "https://s3-eu-west-1.amazonaws.com/tpd/logos/5c033220e32b98000128f214/0x0.png", name: "Thunderbolt Hosting", - datetime: "Apple License", + donation: "Apple License", message: "https://thunderbolt-hosting.com/", link: "https://thunderbolt-hosting.com/", ), SponsorList( avatarUrl: "https://i.coderslight.com/CodersLight_Logo.png", name: "CodersLight LLC", - datetime: "\$ 25.00 CAD", + donation: "\$ 25.00 CAD", message: "https://coderslight.com/", link: "https://coderslight.com/", ), @@ -28,7 +28,7 @@ class SponsorList { avatarUrl: "https://raw.githubusercontent.com/rubentalstra/Pterodactyl-app/master/assets/images/minicenter_logo.png", name: "MiniCenter", - datetime: "\$ 21.53 CAD", + donation: "\$ 21.53 CAD", message: "https://www.minicenter.net/", link: "https://www.minicenter.net/", ), @@ -36,7 +36,7 @@ class SponsorList { avatarUrl: "https://pbs.twimg.com/profile_images/1010254773826793472/vjxA9idJ_400x400.jpg", name: "deploys.io", - datetime: "Website and WebHost", + donation: "Website and WebHost", message: "https://deploys.io/", link: "https://deploys.io/share/104?utm_source=ruben-app&utm_medium=sponsors&utm_campaign=list", @@ -44,7 +44,7 @@ class SponsorList { SponsorList( avatarUrl: "https://avatars0.githubusercontent.com/u/50382144?s=460&v=4", name: "Jordy", - datetime: "Android License", + donation: "Android License", message: "", link: "", ), @@ -52,7 +52,7 @@ class SponsorList { avatarUrl: "https://pbs.twimg.com/profile_images/1104864471581949952/q4wO6V9c_400x400.jpg", name: "Skoali", - datetime: "€ 5,00 EURO", + donation: "€ 5,00 EURO", message: "https://skoali.fr/", link: "https://skoali.fr/", ), @@ -60,7 +60,7 @@ class SponsorList { avatarUrl: "https://raw.githubusercontent.com/rubentalstra/Pterodactyl-app/master/assets/images/discord2.png", name: "AccurateNode", - datetime: "€ 5,00 EURO", + donation: "€ 5,00 EURO", message: "https://accuratenode.com/", link: "https://accuratenode.com/", ), diff --git a/lib/sponsor.dart b/lib/sponsor.dart index 310bf75..a62dd44 100644 --- a/lib/sponsor.dart +++ b/lib/sponsor.dart @@ -66,7 +66,7 @@ class _SponsorPageState extends State { width: 16.0, ), Text( - _model.datetime, + _model.donation, style: TextStyle(fontSize: 12.0), ), ], From 6e467124453d78a41b33ef065edc96d6952b04a1 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 16:30:27 +0200 Subject: [PATCH 04/44] Superuser --- lib/page/admin/adminusers.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/page/admin/adminusers.dart b/lib/page/admin/adminusers.dart index bd6a04e..65a9e12 100644 --- a/lib/page/admin/adminusers.dart +++ b/lib/page/admin/adminusers.dart @@ -149,7 +149,7 @@ class _AdminUsersListPageState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text('Root Admin', + Text('Superuser', style: TextStyle( color: globals.isDarkTheme ? Colors.white From dd95eb89637671fd49199b3ea709c81f99be33d6 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 16:34:02 +0200 Subject: [PATCH 05/44] Cleanup bullshit --- lib/page/admin/adminactionnodes.dart | 17 ----------------- lib/page/admin/adminactionserver.dart | 17 ----------------- lib/page/admin/adminallocations.dart | 17 ----------------- lib/page/admin/admincreateallocation.dart | 17 ----------------- lib/page/admin/admincreateuser.dart | 17 ----------------- lib/page/admin/admineditserver.dart | 17 ----------------- lib/page/admin/adminnodes.dart | 17 ----------------- lib/page/admin/adminserverinfo.dart | 17 ----------------- lib/page/admin/adminsettings.dart | 17 ----------------- lib/page/admin/adminuserinfo.dart | 17 ----------------- lib/page/client/actionserver.dart | 17 ----------------- lib/page/client/console.dart | 17 ----------------- lib/page/client/consolelogs.dart | 19 +------------------ lib/page/client/servers.dart | 17 ----------------- lib/page/client/settings.dart | 17 ----------------- lib/page/client/utilization.dart | 17 ----------------- lib/sponsor.dart | 17 ----------------- 17 files changed, 1 insertion(+), 290 deletions(-) diff --git a/lib/page/admin/adminactionnodes.dart b/lib/page/admin/adminactionnodes.dart index a026ad8..5deb2d4 100644 --- a/lib/page/admin/adminactionnodes.dart +++ b/lib/page/admin/adminactionnodes.dart @@ -81,23 +81,6 @@ class _AdminActionNodesPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: StaggeredGridView.count( crossAxisCount: 2, diff --git a/lib/page/admin/adminactionserver.dart b/lib/page/admin/adminactionserver.dart index 37cf73d..8c0d898 100644 --- a/lib/page/admin/adminactionserver.dart +++ b/lib/page/admin/adminactionserver.dart @@ -140,23 +140,6 @@ class _AdminActionServerPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: StaggeredGridView.count( crossAxisCount: 2, diff --git a/lib/page/admin/adminallocations.dart b/lib/page/admin/adminallocations.dart index ba6dcc2..2f1a5a9 100644 --- a/lib/page/admin/adminallocations.dart +++ b/lib/page/admin/adminallocations.dart @@ -60,23 +60,6 @@ class _AdminAllocationsPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: ListView.builder( itemCount: userData == null ? 0 : userData.length, diff --git a/lib/page/admin/admincreateallocation.dart b/lib/page/admin/admincreateallocation.dart index 16a5cb3..7219e23 100644 --- a/lib/page/admin/admincreateallocation.dart +++ b/lib/page/admin/admincreateallocation.dart @@ -67,23 +67,6 @@ class _AdminCreateAllocationPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: SafeArea( child: ListView( diff --git a/lib/page/admin/admincreateuser.dart b/lib/page/admin/admincreateuser.dart index ee191ee..004e859 100644 --- a/lib/page/admin/admincreateuser.dart +++ b/lib/page/admin/admincreateuser.dart @@ -78,23 +78,6 @@ class _AdminCreateUserPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: SafeArea( child: ListView( diff --git a/lib/page/admin/admineditserver.dart b/lib/page/admin/admineditserver.dart index ebb6687..1908a14 100644 --- a/lib/page/admin/admineditserver.dart +++ b/lib/page/admin/admineditserver.dart @@ -79,23 +79,6 @@ class _AdminEditServerPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: SafeArea( child: ListView( diff --git a/lib/page/admin/adminnodes.dart b/lib/page/admin/adminnodes.dart index b5771c7..43d4151 100644 --- a/lib/page/admin/adminnodes.dart +++ b/lib/page/admin/adminnodes.dart @@ -63,23 +63,6 @@ class _AdminNodesListPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: ListView.builder( itemCount: userData == null ? 0 : userData.length, diff --git a/lib/page/admin/adminserverinfo.dart b/lib/page/admin/adminserverinfo.dart index 623dae5..73dc522 100644 --- a/lib/page/admin/adminserverinfo.dart +++ b/lib/page/admin/adminserverinfo.dart @@ -78,23 +78,6 @@ class _AdminServerInfoPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: StaggeredGridView.count( crossAxisCount: 2, diff --git a/lib/page/admin/adminsettings.dart b/lib/page/admin/adminsettings.dart index 2fe2f0f..d497569 100644 --- a/lib/page/admin/adminsettings.dart +++ b/lib/page/admin/adminsettings.dart @@ -69,23 +69,6 @@ class AdminSettingsListPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: SingleChildScrollView( child: SafeArea( diff --git a/lib/page/admin/adminuserinfo.dart b/lib/page/admin/adminuserinfo.dart index 7cf5070..e619142 100644 --- a/lib/page/admin/adminuserinfo.dart +++ b/lib/page/admin/adminuserinfo.dart @@ -80,23 +80,6 @@ class _AdminUserInfoPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: StaggeredGridView.count( crossAxisCount: 2, diff --git a/lib/page/client/actionserver.dart b/lib/page/client/actionserver.dart index 674780a..955c4cf 100644 --- a/lib/page/client/actionserver.dart +++ b/lib/page/client/actionserver.dart @@ -142,23 +142,6 @@ class _ActionServerPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: StaggeredGridView.count( crossAxisCount: 2, diff --git a/lib/page/client/console.dart b/lib/page/client/console.dart index 188b098..61c801e 100644 --- a/lib/page/client/console.dart +++ b/lib/page/client/console.dart @@ -57,23 +57,6 @@ class _SendPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: SafeArea( child: ListView( diff --git a/lib/page/client/consolelogs.dart b/lib/page/client/consolelogs.dart index 2b70ea1..78b46d5 100644 --- a/lib/page/client/consolelogs.dart +++ b/lib/page/client/consolelogs.dart @@ -28,24 +28,7 @@ class _ConsoleLogsState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], - ), + ), body: CustomScrollView( slivers: [ SliverList( diff --git a/lib/page/client/servers.dart b/lib/page/client/servers.dart index c445db7..d05b70f 100644 --- a/lib/page/client/servers.dart +++ b/lib/page/client/servers.dart @@ -64,23 +64,6 @@ class _ServerListPageState extends State { style: TextStyle( color: globals.isDarkTheme ? null : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: ListView.builder( itemCount: userData == null ? 0 : userData.length, diff --git a/lib/page/client/settings.dart b/lib/page/client/settings.dart index 21e9e81..1d44b73 100644 --- a/lib/page/client/settings.dart +++ b/lib/page/client/settings.dart @@ -69,23 +69,6 @@ class SettingsListPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: SingleChildScrollView( child: SafeArea( diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index 4ff55fa..4e26100 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -70,23 +70,6 @@ class _StatePageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: StaggeredGridView.count( crossAxisCount: 2, diff --git a/lib/sponsor.dart b/lib/sponsor.dart index a62dd44..4b98fe9 100644 --- a/lib/sponsor.dart +++ b/lib/sponsor.dart @@ -25,23 +25,6 @@ class _SponsorPageState extends State { style: TextStyle( color: globals.isDarkTheme ? Colors.white : Colors.black, fontWeight: FontWeight.w700)), - // actions: - // [ - // Container - // ( - // margin: EdgeInsets.only(right: 8.0), - // child: Row - // ( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: - // [ - // Text('beclothed.com', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700, fontSize: 14.0)), - // Icon(Icons.arrow_drop_down, color: Colors.black54) - // ], - // ), - // ) - // ], ), body: Container( child: ListView.builder( From 1d9421b06b05b74ad5768f33549a5fff76176da7 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 17:53:26 +0200 Subject: [PATCH 06/44] Translations --- assets/lang/en_US.json | 2 +- assets/lang/nl_NL.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/lang/en_US.json b/assets/lang/en_US.json index 14a3995..ca135e2 100644 --- a/assets/lang/en_US.json +++ b/assets/lang/en_US.json @@ -6,7 +6,7 @@ "next":"NEXT", "login_error":"username or password \ncan't be empty", "login_error_ok":"OK", - "login_admin_account": "Do you have a Admin account? tap here then", + "login_admin_account": "Do you have an Admin account? tap here then", "dashboard":"Dashboard", "logout":"Logout", "logout_sub":"Disconnect", diff --git a/assets/lang/nl_NL.json b/assets/lang/nl_NL.json index 32e5f26..04a344b 100644 --- a/assets/lang/nl_NL.json +++ b/assets/lang/nl_NL.json @@ -95,15 +95,15 @@ "firstname": "Voornaam:", "lastname": "Achternaam:", "email": "E-Mail:", - "uuid": "uuid:", + "uuid": "UUID:", "id": "ID:", "language": "Taal:", - "rootadmin": "Root admin:", + "rootadmin": "Superuser:", "2fa": "2FA", "created_at": "Gemaakt op:", "updated_at": "Geupdate op:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_online": "Server is online" } From e7e1525aaecd1a7aa6449c810576f1b51c02e798 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 17:56:08 +0200 Subject: [PATCH 07/44] fix gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4e85588..c0d9cf5 100644 --- a/.gitignore +++ b/.gitignore @@ -70,4 +70,7 @@ !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages android/local.properties -android/gradlew \ No newline at end of file +android/gradlew +ios/Podfile.lock +ios/Flutter/Generated.xcconfig +ios/Runner.xcodeproj/project.pbxproj \ No newline at end of file From a2fd6d8a2e0ec10a76d2b219a1bf397647024942 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 17:57:35 +0200 Subject: [PATCH 08/44] Check login state --- lib/page/admin/adminhome.dart | 19 ++++++++-- lib/page/admin/adminlogin.dart | 4 -- lib/page/auth/shared_preferences_helper.dart | 39 ++++++++++++++++++++ lib/page/client/home.dart | 13 +++++++ 4 files changed, 68 insertions(+), 7 deletions(-) diff --git a/lib/page/admin/adminhome.dart b/lib/page/admin/adminhome.dart index 903cb76..9d89e52 100644 --- a/lib/page/admin/adminhome.dart +++ b/lib/page/admin/adminhome.dart @@ -31,8 +31,8 @@ class _AdminHomePageState extends State { Future getData() async { String _apiadmin = await SharedPreferencesHelper.getString("apiAdminKey"); - String _urladmin = await SharedPreferencesHelper.getString("panelAdminUrl"); String _adminhttps = await SharedPreferencesHelper.getString("adminhttps"); + String _urladmin = await SharedPreferencesHelper.getString("panelAdminUrl"); http.Response response = await http.get( "$_adminhttps$_urladmin/api/application/servers", headers: { @@ -40,6 +40,7 @@ class _AdminHomePageState extends State { "Authorization": "Bearer $_apiadmin" }, ); + data = json.decode(response.body); setState(() { userTotalServers = data["meta"]["pagination"]["total"]; @@ -57,9 +58,13 @@ class _AdminHomePageState extends State { "Authorization": "Bearer $_apiadmin" }, ); + + data = json.decode(response.body); setState(() { - totalNodes = data["meta"]["pagination"]["total"]; + if(data.containsKey('meta')) { + totalNodes = data["meta"]["pagination"]["total"]; + } }); } @@ -74,15 +79,23 @@ class _AdminHomePageState extends State { "Authorization": "Bearer $_apiadmin" }, ); + data = json.decode(response.body); setState(() { - totalUsers = data["meta"]["pagination"]["total"]; + if(data.containsKey('meta')) { + totalUsers = data["meta"]["pagination"]["total"]; + } }); } @override void initState() { super.initState(); + + SharedPreferencesHelper.isAuthenticated().then((val) { + Navigator.of(context).pushNamedAndRemoveUntil('/login', (Route route) => false); + }); + getData(); getNodesData(); getUsers(); diff --git a/lib/page/admin/adminlogin.dart b/lib/page/admin/adminlogin.dart index a05b541..a864dc1 100644 --- a/lib/page/admin/adminlogin.dart +++ b/lib/page/admin/adminlogin.dart @@ -25,10 +25,6 @@ class _AdminLoginPageState extends State { final _apiadminController = TextEditingController(); final _urladminController = TextEditingController(); - - - - SharedPreferences sharedPreferences; @override diff --git a/lib/page/auth/shared_preferences_helper.dart b/lib/page/auth/shared_preferences_helper.dart index b891886..6fadab4 100644 --- a/lib/page/auth/shared_preferences_helper.dart +++ b/lib/page/auth/shared_preferences_helper.dart @@ -1,4 +1,5 @@ import 'package:shared_preferences/shared_preferences.dart'; +import 'package:http/http.dart' as http; class SharedPreferencesHelper { static Future setString(String key, String value) async { @@ -13,6 +14,44 @@ class SharedPreferencesHelper { return prefs.getString(key) ?? ''; } + static Future isAuthenticated([isAdmin=false]) async { + if(isAdmin) { + String _apiadmin = await SharedPreferencesHelper.getString("apiAdminKey"); + String _adminhttps = await SharedPreferencesHelper.getString( + "adminhttps"); + String _urladmin = await SharedPreferencesHelper.getString( + "panelAdminUrl"); + + print("$_adminhttps$_urladmin/api/application/servers"); + http.Response response = await http.get( + "$_adminhttps$_urladmin/api/application/servers", + headers: { + "Accept": "Application/vnd.pterodactyl.v1+json", + "Authorization": "Bearer $_apiadmin" + }, + ).catchError((val) { + remove('apiAdminKey'); + }); + } else { + String _apikey = await SharedPreferencesHelper.getString("apiKey"); + String _adminhttps = await SharedPreferencesHelper.getString( + "https"); + String _urladmin = await SharedPreferencesHelper.getString( + "panelUrl"); + + print("$_adminhttps$_urladmin/api/application/servers"); + http.Response response = await http.get( + "$_adminhttps$_urladmin/api/client", + headers: { + "Accept": "Application/vnd.pterodactyl.v1+json", + "Authorization": "Bearer $_apikey" + }, + ).catchError((val) { + remove('apiKey'); + }); + } + } + static remove(String key) async { final SharedPreferences prefs = await SharedPreferences.getInstance(); diff --git a/lib/page/client/home.dart b/lib/page/client/home.dart index 791ad6d..96236dc 100644 --- a/lib/page/client/home.dart +++ b/lib/page/client/home.dart @@ -24,6 +24,7 @@ class _MyHomePageState extends State { String _api = await SharedPreferencesHelper.getString("apiKey"); String _url = await SharedPreferencesHelper.getString("panelUrl"); String _https = await SharedPreferencesHelper.getString("https"); + http.Response response = await http.get( "$_https$_url/api/client", headers: { @@ -31,6 +32,13 @@ class _MyHomePageState extends State { "Authorization": "Bearer $_api" }, ); + + if (response.statusCode == 401) { + SharedPreferencesHelper.remove('apiKey'); + Navigator.of(context) + .pushNamedAndRemoveUntil('/login', (Route route) => false); + } + data = json.decode(response.body); setState(() { userTotalServers = data["meta"]["pagination"]["total"]; @@ -40,6 +48,11 @@ class _MyHomePageState extends State { @override void initState() { super.initState(); + + SharedPreferencesHelper.isAuthenticated().then((val) { + Navigator.of(context).pushNamedAndRemoveUntil('/login', (Route route) => false); + }); + getDataHome(); } From 4833c2742b26d274da7e8fa16c8b3e4284c46e8e Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 18:46:02 +0200 Subject: [PATCH 09/44] Amend CREDITS --- CREDITS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.md b/CREDITS.md index 0a69dcc..3cf7bf5 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -34,6 +34,7 @@ For all the people who worked with me on this amazing project. ###### Flutter Coders: > - `@appomatrix#9639` +> - `@Yvan#9877` From e7aed16ba4f157e3034591342beb3eedc0cc477a Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 19:00:59 +0200 Subject: [PATCH 10/44] Temporarily fix iOS language issue --- ios/GoogleService-Info.plist | 36 ++++++++++++++++++++++++++++++++++++ lib/main.dart | 9 ++++++--- 2 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 ios/GoogleService-Info.plist diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist new file mode 100644 index 0000000..cf35d2f --- /dev/null +++ b/ios/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + 565795306919-7c4v8abdnaq30dd9f0s338tsjrc4rhrv.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.565795306919-7c4v8abdnaq30dd9f0s338tsjrc4rhrv + API_KEY + AIzaSyAECYr3uGoXnDLU_wfYphnKuvxri6AfN9g + GCM_SENDER_ID + 565795306919 + PLIST_VERSION + 1 + BUNDLE_ID + nl.rubentalstra.pterodactyl + PROJECT_ID + pterodactyl-app + STORAGE_BUCKET + pterodactyl-app.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:565795306919:ios:f3d6ac38704170ba + DATABASE_URL + https://pterodactyl-app.firebaseio.com + + \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index c9b6513..2e7358a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; @@ -129,9 +130,11 @@ class MyApp extends StatelessWidget { localeResolutionCallback: (Locale locale, Iterable supportedLocales) { for (Locale supportedLocale in supportedLocales) { - if (supportedLocale.languageCode == locale.languageCode || - supportedLocale.countryCode == locale.countryCode) { - return supportedLocale; + if(!Platform.isIOS) { + if (supportedLocale.languageCode == locale.languageCode || + supportedLocale.countryCode == locale.countryCode) { + return supportedLocale; + } } } From ca4c4adcd42de879a5dd8d60dd2d72d4f9d1a7cf Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 20:23:48 +0200 Subject: [PATCH 11/44] iOS compile fix --- lib/main.dart | 1 + lib/page/admin/adminhome.dart | 9 +---- lib/page/auth/shared_preferences_helper.dart | 40 +------------------- 3 files changed, 4 insertions(+), 46 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 2e7358a..803f9da 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -107,6 +107,7 @@ class MyApp extends StatelessWidget { ), themedWidgetBuilder: (context, theme) { return new MaterialApp( + navigatorKey: key, supportedLocales: [ const Locale('en', 'US'), const Locale('en', 'UK'), diff --git a/lib/page/admin/adminhome.dart b/lib/page/admin/adminhome.dart index 9d89e52..a310612 100644 --- a/lib/page/admin/adminhome.dart +++ b/lib/page/admin/adminhome.dart @@ -59,10 +59,9 @@ class _AdminHomePageState extends State { }, ); - data = json.decode(response.body); setState(() { - if(data.containsKey('meta')) { + if (data.containsKey('meta')) { totalNodes = data["meta"]["pagination"]["total"]; } }); @@ -82,7 +81,7 @@ class _AdminHomePageState extends State { data = json.decode(response.body); setState(() { - if(data.containsKey('meta')) { + if (data.containsKey('meta')) { totalUsers = data["meta"]["pagination"]["total"]; } }); @@ -92,10 +91,6 @@ class _AdminHomePageState extends State { void initState() { super.initState(); - SharedPreferencesHelper.isAuthenticated().then((val) { - Navigator.of(context).pushNamedAndRemoveUntil('/login', (Route route) => false); - }); - getData(); getNodesData(); getUsers(); diff --git a/lib/page/auth/shared_preferences_helper.dart b/lib/page/auth/shared_preferences_helper.dart index 6fadab4..11eca1e 100644 --- a/lib/page/auth/shared_preferences_helper.dart +++ b/lib/page/auth/shared_preferences_helper.dart @@ -1,7 +1,7 @@ import 'package:shared_preferences/shared_preferences.dart'; -import 'package:http/http.dart' as http; class SharedPreferencesHelper { + static Future setString(String key, String value) async { final SharedPreferences prefs = await SharedPreferences.getInstance(); @@ -14,44 +14,6 @@ class SharedPreferencesHelper { return prefs.getString(key) ?? ''; } - static Future isAuthenticated([isAdmin=false]) async { - if(isAdmin) { - String _apiadmin = await SharedPreferencesHelper.getString("apiAdminKey"); - String _adminhttps = await SharedPreferencesHelper.getString( - "adminhttps"); - String _urladmin = await SharedPreferencesHelper.getString( - "panelAdminUrl"); - - print("$_adminhttps$_urladmin/api/application/servers"); - http.Response response = await http.get( - "$_adminhttps$_urladmin/api/application/servers", - headers: { - "Accept": "Application/vnd.pterodactyl.v1+json", - "Authorization": "Bearer $_apiadmin" - }, - ).catchError((val) { - remove('apiAdminKey'); - }); - } else { - String _apikey = await SharedPreferencesHelper.getString("apiKey"); - String _adminhttps = await SharedPreferencesHelper.getString( - "https"); - String _urladmin = await SharedPreferencesHelper.getString( - "panelUrl"); - - print("$_adminhttps$_urladmin/api/application/servers"); - http.Response response = await http.get( - "$_adminhttps$_urladmin/api/client", - headers: { - "Accept": "Application/vnd.pterodactyl.v1+json", - "Authorization": "Bearer $_apikey" - }, - ).catchError((val) { - remove('apiKey'); - }); - } - } - static remove(String key) async { final SharedPreferences prefs = await SharedPreferences.getInstance(); From c3e4c757dd4af9a5df9aff9dc9e087ffee4ae6de Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 20:25:23 +0200 Subject: [PATCH 12/44] remove old code --- lib/page/client/home.dart | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/page/client/home.dart b/lib/page/client/home.dart index 96236dc..452f24c 100644 --- a/lib/page/client/home.dart +++ b/lib/page/client/home.dart @@ -33,12 +33,6 @@ class _MyHomePageState extends State { }, ); - if (response.statusCode == 401) { - SharedPreferencesHelper.remove('apiKey'); - Navigator.of(context) - .pushNamedAndRemoveUntil('/login', (Route route) => false); - } - data = json.decode(response.body); setState(() { userTotalServers = data["meta"]["pagination"]["total"]; @@ -49,10 +43,6 @@ class _MyHomePageState extends State { void initState() { super.initState(); - SharedPreferencesHelper.isAuthenticated().then((val) { - Navigator.of(context).pushNamedAndRemoveUntil('/login', (Route route) => false); - }); - getDataHome(); } From a325bc61dd40a14699368d7b560996a02411eb74 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 20:28:39 +0200 Subject: [PATCH 13/44] Hoofdpijn dit. --- lib/page/auth/auth.dart | 63 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/lib/page/auth/auth.dart b/lib/page/auth/auth.dart index 9ee83c8..3627a32 100644 --- a/lib/page/auth/auth.dart +++ b/lib/page/auth/auth.dart @@ -1,6 +1,8 @@ import 'dart:async'; +import 'package:pterodactyl_app/page/auth/shared_preferences_helper.dart'; import 'package:pterodactyl_app/page/client/login.dart'; import 'package:pterodactyl_app/page/client/home.dart'; +import 'package:http/http.dart' as http; import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:pterodactyl_app/page/admin/adminhome.dart'; @@ -16,10 +18,11 @@ class SplashState extends State { SharedPreferences prefs = await SharedPreferences.getInstance(); var bool2 = prefs.getBool('seen'); bool _seen = (bool2 ?? false); - if (_seen) { - Navigator.of(context).pushReplacement( - new MaterialPageRoute(builder: (context) => new MyHomePage())); + if (await isAuthenticated()) { + Navigator.of(context).pushReplacement( + new MaterialPageRoute(builder: (context) => new MyHomePage())); + } } else { prefs.setBool('seen', true); Navigator.of(context).pushReplacement( @@ -31,7 +34,7 @@ class SplashState extends State { SharedPreferences prefs = await SharedPreferences.getInstance(); bool _seenadmin = (prefs.getBool('seenadmin') ?? false); - if (_seenadmin) { + if (_seenadmin && await isAuthenticated(isAdmin: true)) { Navigator.of(context).pushReplacement( new MaterialPageRoute(builder: (context) => new AdminHomePage())); } else { @@ -41,6 +44,56 @@ class SplashState extends State { } } + Future isAuthenticated({isAdmin = false}) async { + if (isAdmin) { + String _apiadmin = await SharedPreferencesHelper.getString("apiAdminKey"); + String _adminhttps = + await SharedPreferencesHelper.getString("adminhttps"); + String _urladmin = + await SharedPreferencesHelper.getString("panelAdminUrl"); + + http.Response response = await http.get( + "$_adminhttps$_urladmin/api/application/servers", + headers: { + "Accept": "Application/vnd.pterodactyl.v1+json", + "Authorization": "Bearer $_apiadmin" + }, + ); + + if (response.statusCode == 401) { + // Todo fix Navigation context for logging out if key isn't available + SharedPreferencesHelper.remove('apiAdminKey'); + Navigator.of(context).pushNamedAndRemoveUntil( + '/adminlogin', (Route route) => false); + return false; + } else { + return true; + } + } else { + String _apikey = await SharedPreferencesHelper.getString("apiKey"); + String _adminhttps = await SharedPreferencesHelper.getString("https"); + String _urladmin = await SharedPreferencesHelper.getString("panelUrl"); + + http.Response response = await http.get( + "$_adminhttps$_urladmin/api/client", + headers: { + "Accept": "Application/vnd.pterodactyl.v1+json", + "Authorization": "Bearer $_apikey" + }, + ); + + if (response.statusCode == 401) { + // Todo fix Navigation context for logging out if key isn't available + SharedPreferencesHelper.remove('apiKey'); + Navigator.of(context) + .pushNamedAndRemoveUntil('/login', (Route route) => false); + return false; + } else { + return true; + } + } + } + @override void initState() { super.initState(); @@ -57,5 +110,3 @@ class SplashState extends State { ); } } - - From 3de245ee3be37deb5aa5c27127162ad825b5959e Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 21:46:23 +0200 Subject: [PATCH 14/44] Spec update --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index b3580ac..a914288 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,7 @@ authors: - Ala (iOS part) environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=2.2.0 <3.0.0" dependencies: flutter: From 3821b9b1e95dc5674a9603d32e4249e574cfb804 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 21:46:35 +0200 Subject: [PATCH 15/44] Cpu hotfix, shit not working --- lib/page/client/utilization.dart | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index c272ed8..6365019 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -40,12 +40,21 @@ class _StatePageState extends State { "Authorization": "Bearer $_api" }, ); + + List parseCpu(List cpu) { + List result; + cpu.forEach((f) => result.add(f)); + return result; + } + data = json.decode(response.body); setState(() { _stats = data["attributes"]["state"]; _memorycurrent = data["attributes"]["memory"]["current"]; _memorylimit = data["attributes"]["memory"]["limit"]; - //_cpu = data["attributes"]["cpu"]["cores"]; + _cpu = [0.0]; + _cpu = data["attributes"]["cpu"]["cores"].length < 0 ? + parseCpu(data["attributes"]["cpu"]["cores"]) : [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,]; _diskcurrent = data["attributes"]["disk"]["current"]; _disklimit = data["attributes"]["disk"]["limit"]; }); @@ -59,7 +68,7 @@ class _StatePageState extends State { @override Widget build(BuildContext context) { - var data = "$_cpu" != null ? [0] : "$_cpu"; + List data = _cpu; return Scaffold( appBar: AppBar( elevation: 0.0, @@ -148,7 +157,7 @@ class _StatePageState extends State { ), Padding(padding: EdgeInsets.only(bottom: 4.0)), Sparkline( - data: data, + data: _cpu, lineWidth: 5.0, lineColor: Colors.greenAccent, ) From 860351cd5930e5ea9a5f74a9c8a1f3f763356b2f Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 21:48:25 +0200 Subject: [PATCH 16/44] single zero float --- lib/page/client/utilization.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index 6365019..09107cb 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -54,7 +54,7 @@ class _StatePageState extends State { _memorylimit = data["attributes"]["memory"]["limit"]; _cpu = [0.0]; _cpu = data["attributes"]["cpu"]["cores"].length < 0 ? - parseCpu(data["attributes"]["cpu"]["cores"]) : [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,]; + parseCpu(data["attributes"]["cpu"]["cores"]) : [0.0]; _diskcurrent = data["attributes"]["disk"]["current"]; _disklimit = data["attributes"]["disk"]["limit"]; }); From 3f05241eaff16ba182c0a9c49d8bc6dfddf89769 Mon Sep 17 00:00:00 2001 From: Ruben Talstra Date: Mon, 20 May 2019 16:49:46 -0300 Subject: [PATCH 17/44] Update utilization.dart --- lib/page/client/utilization.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index 09107cb..f93f7c4 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -157,7 +157,7 @@ class _StatePageState extends State { ), Padding(padding: EdgeInsets.only(bottom: 4.0)), Sparkline( - data: _cpu, + data: "$_cpu", lineWidth: 5.0, lineColor: Colors.greenAccent, ) From d2b8e9e0b9de56f9be337cc5d472e7c49cbd2c35 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 22:45:34 +0200 Subject: [PATCH 18/44] Fixed cpu utilization error --- lib/page/client/utilization.dart | 60 +++++++++++++++++++------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index f93f7c4..a466c66 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -23,15 +23,15 @@ class _StatePageState extends State { String _stats; int _memorycurrent; int _memorylimit; - List _cpu; + List _cpu = [0.0].toList(); int _diskcurrent; int _disklimit; - Future getData() async { String _api = await SharedPreferencesHelper.getString("apiKey"); String _url = await SharedPreferencesHelper.getString("panelUrl"); String _https = await SharedPreferencesHelper.getString("https"); + http.Response response = await http.get( "$_https$_url/api/client/servers/${widget.server.id}/utilization", headers: { @@ -41,20 +41,19 @@ class _StatePageState extends State { }, ); - List parseCpu(List cpu) { - List result; - cpu.forEach((f) => result.add(f)); + List parseCpu(cpu) { + List result = []; + cpu.forEach((f) => result.add(f.toDouble())); return result; } data = json.decode(response.body); + setState(() { _stats = data["attributes"]["state"]; _memorycurrent = data["attributes"]["memory"]["current"]; _memorylimit = data["attributes"]["memory"]["limit"]; - _cpu = [0.0]; - _cpu = data["attributes"]["cpu"]["cores"].length < 0 ? - parseCpu(data["attributes"]["cpu"]["cores"]) : [0.0]; + _cpu = parseCpu(data["attributes"]["cpu"]["cores"]); _diskcurrent = data["attributes"]["disk"]["current"]; _disklimit = data["attributes"]["disk"]["limit"]; }); @@ -62,13 +61,12 @@ class _StatePageState extends State { @override void initState() { - super.initState(); getData(); + super.initState(); } @override Widget build(BuildContext context) { - List data = _cpu; return Scaffold( appBar: AppBar( elevation: 0.0, @@ -82,8 +80,7 @@ class _StatePageState extends State { ), ), title: Text(DemoLocalizations.of(context).trans('utilization_stats'), - style: TextStyle( - fontWeight: FontWeight.w700)), + style: TextStyle(fontWeight: FontWeight.w700)), ), body: StaggeredGridView.count( crossAxisCount: 2, @@ -104,7 +101,12 @@ class _StatePageState extends State { children: [ Text("Stats:", style: TextStyle(color: Colors.blueAccent)), - Text("$_stats" == "on" ? DemoLocalizations.of(context).trans('utilization_stats_online') : DemoLocalizations.of(context).trans('utilization_stats_offline'), + Text( + "$_stats" == "on" + ? DemoLocalizations.of(context) + .trans('utilization_stats_online') + : DemoLocalizations.of(context) + .trans('utilization_stats_offline'), style: TextStyle( fontWeight: FontWeight.w700, fontSize: 20.0)) ], @@ -115,7 +117,9 @@ class _StatePageState extends State { child: Padding( padding: const EdgeInsets.all(16.0), child: Icon( - "$_stats" == "on" ? Icons.play_arrow : Icons.stop, + "$_stats" == "on" + ? Icons.play_arrow + : Icons.stop, color: Colors.white, size: 30.0), )), @@ -157,7 +161,7 @@ class _StatePageState extends State { ), Padding(padding: EdgeInsets.only(bottom: 4.0)), Sparkline( - data: "$_cpu", + data: _cpu.isNotEmpty ? _cpu : [0.0], lineWidth: 5.0, lineColor: Colors.greenAccent, ) @@ -175,7 +179,9 @@ class _StatePageState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(DemoLocalizations.of(context).trans('utilization_memory'), + Text( + DemoLocalizations.of(context) + .trans('utilization_memory'), style: TextStyle(color: Colors.blueAccent)), Text("$_memorycurrent MB/ $_memorylimit MB", style: TextStyle( @@ -183,18 +189,19 @@ class _StatePageState extends State { ], ), Material( - color: "$_memorycurrent" == "$_memorylimit" ? Colors.red : Colors.green, + color: "$_memorycurrent" == "$_memorylimit" + ? Colors.red + : Colors.green, shape: CircleBorder(), child: Padding( padding: const EdgeInsets.all(16.0), child: Icon(Icons.memory, - color: Colors.white, - size: 30.0), + color: Colors.white, size: 30.0), )), ]), ), //onTap: () {}, - ), + ), _buildTile( Padding( padding: const EdgeInsets.all(24.0), @@ -206,7 +213,9 @@ class _StatePageState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(DemoLocalizations.of(context).trans('utilization_disk'), + Text( + DemoLocalizations.of(context) + .trans('utilization_disk'), style: TextStyle(color: Colors.blueAccent)), Text("$_diskcurrent MB/ $_disklimit MB", style: TextStyle( @@ -214,18 +223,19 @@ class _StatePageState extends State { ], ), Material( - color: "$_diskcurrent" == "$_disklimit" ? Colors.red : Colors.green, + color: "$_diskcurrent" == "$_disklimit" + ? Colors.red + : Colors.green, shape: CircleBorder(), child: Padding( padding: const EdgeInsets.all(16.0), child: Icon(Icons.sd_storage, - color: Colors.white, - size: 30.0), + color: Colors.white, size: 30.0), )), ]), ), //onTap: () {}, - ), + ), ], staggeredTiles: [ StaggeredTile.extent(2, 110.0), From 7faa959f9dc9b2602d8b9f88f361b7a8395ff2d8 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Mon, 20 May 2019 23:24:34 +0200 Subject: [PATCH 19/44] Linear login for user-only, admin has not yet been done. --- lib/page/client/login.dart | 55 +++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/lib/page/client/login.dart b/lib/page/client/login.dart index 2b683f7..7feb389 100644 --- a/lib/page/client/login.dart +++ b/lib/page/client/login.dart @@ -62,31 +62,38 @@ class _LoginPageState extends State { ), ), ), - SizedBox(height: 12.0), - DropdownButton( - value: dropdownValue, - onChanged: (String newValue) { - setState(() { - dropdownValue = newValue; - }); - }, - items: ['https://', 'http://'] - .map>((String value) { - return DropdownMenuItem( - value: value, - child: Text(value), - ); - }).toList(), - ), - AccentColorOverride( - color: Color(0xFFC5032B), - child: TextField( - controller: _urlController, - decoration: InputDecoration( - labelText: DemoLocalizations.of(context).trans('url_login'), + SizedBox(height: 60.0, child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + DropdownButton( + value: dropdownValue, + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + }); + }, + items: ['https://', 'http://'] + .map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), ), - ), - ), + AccentColorOverride( + color: Color(0xFFC5032B), + child: new Flexible(child: TextField( + controller: _urlController, + decoration: InputDecoration( + labelText: DemoLocalizations.of(context).trans('url_login'), + ), + ), + ) + ), + ], + ),), new CheckboxListTile( value: checkValue, onChanged: _onChanged, From d8502940ed2b0b00cc3f63da08327964e01bf396 Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Mon, 20 May 2019 18:35:17 -0300 Subject: [PATCH 20/44] timer hell yeah --- lib/page/client/utilization.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index a466c66..e9e24ad 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -26,6 +26,7 @@ class _StatePageState extends State { List _cpu = [0.0].toList(); int _diskcurrent; int _disklimit; + Timer timer; Future getData() async { String _api = await SharedPreferencesHelper.getString("apiKey"); @@ -63,8 +64,11 @@ class _StatePageState extends State { void initState() { getData(); super.initState(); + timer = Timer.periodic(Duration(seconds: 15), (Timer t) => getData()); } + + @override Widget build(BuildContext context) { return Scaffold( From 2efe82e9784c1284c34ece3cfb86fa21b72e2087 Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Mon, 20 May 2019 20:25:25 -0300 Subject: [PATCH 21/44] stats page update --- lib/page/client/actionserver.dart | 190 ++++++++++++------------------ lib/page/client/utilization.dart | 21 +++- 2 files changed, 89 insertions(+), 122 deletions(-) diff --git a/lib/page/client/actionserver.dart b/lib/page/client/actionserver.dart index 28a17fe..6805423 100644 --- a/lib/page/client/actionserver.dart +++ b/lib/page/client/actionserver.dart @@ -152,30 +152,22 @@ class _ActionServerPageState extends State { _buildTile( Padding( padding: const EdgeInsets.all(24.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Material( color: Colors.green, - borderRadius: BorderRadius.circular(24.0), - child: Center( - child: Padding( + shape: CircleBorder(), + child: Padding( padding: const EdgeInsets.all(16.0), child: Icon(Icons.play_arrow, color: Colors.white, size: 30.0), - ))), - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - DemoLocalizations.of(context) - .trans('action_start'), - style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 18.0)) - ], - ) + )), + Padding(padding: EdgeInsets.only(bottom: 12.0)), + Text(DemoLocalizations.of(context).trans('action_start'), + style: TextStyle( + fontWeight: FontWeight.w700, fontSize: 23.0)), ]), ), onTap: () { @@ -185,30 +177,22 @@ class _ActionServerPageState extends State { _buildTile( Padding( padding: const EdgeInsets.all(24.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - DemoLocalizations.of(context) - .trans('action_stop'), - style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 18.0)) - ], - ), Material( color: Colors.red, - borderRadius: BorderRadius.circular(24.0), - child: Center( - child: Padding( + shape: CircleBorder(), + child: Padding( padding: const EdgeInsets.all(16.0), child: Icon(Icons.stop, color: Colors.white, size: 30.0), - ))) + )), + Padding(padding: EdgeInsets.only(bottom: 12.0)), + Text(DemoLocalizations.of(context).trans('action_stop'), + style: TextStyle( + fontWeight: FontWeight.w700, fontSize: 23.0)), ]), ), onTap: () { @@ -218,30 +202,23 @@ class _ActionServerPageState extends State { _buildTile( Padding( padding: const EdgeInsets.all(24.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Material( color: Colors.blue, - borderRadius: BorderRadius.circular(24.0), - child: Center( - child: Padding( + shape: CircleBorder(), + child: Padding( padding: const EdgeInsets.all(16.0), child: Icon(Icons.refresh, color: Colors.white, size: 30.0), - ))), - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - DemoLocalizations.of(context) - .trans('action_restart'), - style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 18.0)) - ], - ) + )), + Padding(padding: EdgeInsets.only(bottom: 12.0)), + Text( + DemoLocalizations.of(context).trans('action_restart'), + style: TextStyle( + fontWeight: FontWeight.w700, fontSize: 23.0)), ]), ), onTap: () { @@ -251,30 +228,22 @@ class _ActionServerPageState extends State { _buildTile( Padding( padding: const EdgeInsets.all(24.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - DemoLocalizations.of(context) - .trans('action_kill'), - style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 18.0)) - ], - ), Material( color: Colors.red, - borderRadius: BorderRadius.circular(24.0), - child: Center( - child: Padding( + shape: CircleBorder(), + child: Padding( padding: const EdgeInsets.all(16.0), child: Icon(Icons.offline_bolt, color: Colors.white, size: 30.0), - ))) + )), + Padding(padding: EdgeInsets.only(bottom: 12.0)), + Text(DemoLocalizations.of(context).trans('action_kill'), + style: TextStyle( + fontWeight: FontWeight.w700, fontSize: 23.0)), ]), ), onTap: () { @@ -284,30 +253,22 @@ class _ActionServerPageState extends State { _buildTile( Padding( padding: const EdgeInsets.all(24.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - DemoLocalizations.of(context) - .trans('action_stats'), - style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 20.0)) - ], - ), Material( color: Colors.amber, - borderRadius: BorderRadius.circular(24.0), - child: Center( - child: Padding( - padding: EdgeInsets.all(16.0), + shape: CircleBorder(), + child: Padding( + padding: const EdgeInsets.all(16.0), child: Icon(Icons.show_chart, color: Colors.white, size: 30.0), - ))) + )), + Padding(padding: EdgeInsets.only(bottom: 12.0)), + Text(DemoLocalizations.of(context).trans('action_stats'), + style: TextStyle( + fontWeight: FontWeight.w700, fontSize: 23.0)), ]), ), onTap: () { @@ -321,32 +282,29 @@ class _ActionServerPageState extends State { _buildTile( Padding( padding: const EdgeInsets.all(24.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - DemoLocalizations.of(context) - .trans('action_file'), - style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 20.0)) - ], - ), Material( color: Colors.green, - borderRadius: BorderRadius.circular(24.0), - child: Center( - child: Padding( - padding: EdgeInsets.all(16.0), + shape: CircleBorder(), + child: Padding( + padding: const EdgeInsets.all(16.0), child: Icon(Icons.folder_open, color: Colors.white, size: 30.0), - ))) + )), + Padding(padding: EdgeInsets.only(bottom: 12.0)), + Text(DemoLocalizations.of(context).trans('action_file'), + style: TextStyle( + fontWeight: FontWeight.w700, fontSize: 23.0)), ]), ), + /* + onTap: () { + postKill(); + }, + */ ), _buildTile( Padding( @@ -386,12 +344,12 @@ class _ActionServerPageState extends State { ), ], staggeredTiles: [ - StaggeredTile.extent(1, 110.0), - StaggeredTile.extent(1, 110.0), - StaggeredTile.extent(1, 110.0), - StaggeredTile.extent(1, 110.0), - StaggeredTile.extent(2, 110.0), - StaggeredTile.extent(2, 110.0), + StaggeredTile.extent(1, 150.0), + StaggeredTile.extent(1, 150.0), + StaggeredTile.extent(1, 150.0), + StaggeredTile.extent(1, 150.0), + StaggeredTile.extent(1, 150.0), + StaggeredTile.extent(1, 150.0), StaggeredTile.extent(2, 110.0), ], )); diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index e9e24ad..4b79a5c 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -64,11 +64,9 @@ class _StatePageState extends State { void initState() { getData(); super.initState(); - timer = Timer.periodic(Duration(seconds: 15), (Timer t) => getData()); + timer = Timer.periodic(Duration(seconds: 5), (Timer t) => getData()); } - - @override Widget build(BuildContext context) { return Scaffold( @@ -77,7 +75,10 @@ class _StatePageState extends State { backgroundColor: globals.isDarkTheme ? null : Colors.transparent, leading: IconButton( color: globals.isDarkTheme ? Colors.white : Colors.black, - onPressed: () => Navigator.of(context).pop(), + onPressed: () { + Navigator.of(context).pop(); + timer.cancel(); + }, icon: Icon( Icons.arrow_back, color: globals.isDarkTheme ? Colors.white : Colors.black, @@ -187,7 +188,11 @@ class _StatePageState extends State { DemoLocalizations.of(context) .trans('utilization_memory'), style: TextStyle(color: Colors.blueAccent)), - Text("$_memorycurrent MB/ $_memorylimit MB", + Text( + "$_memorycurrent" == null + ? DemoLocalizations.of(context) + .trans('utilization_stats_offline') + : "$_memorycurrent MB / $_memorylimit MB", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 20.0)) ], @@ -221,7 +226,11 @@ class _StatePageState extends State { DemoLocalizations.of(context) .trans('utilization_disk'), style: TextStyle(color: Colors.blueAccent)), - Text("$_diskcurrent MB/ $_disklimit MB", + Text( + "$_diskcurrent" == null + ? DemoLocalizations.of(context) + .trans('utilization_stats_offline') + : "$_diskcurrent MB / $_disklimit MB", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 20.0)) ], From a2ab57e3c8e0924811076918f5cbd0992a790394 Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Mon, 20 May 2019 20:26:15 -0300 Subject: [PATCH 22/44] lang update --- assets/lang/en_UK.json | 4 ++-- assets/lang/en_US.json | 4 ++-- assets/lang/it_IT.json | 2 +- assets/lang/nl_NL.json | 2 +- assets/lang/no_NO.json | 2 +- assets/lang/pl_PL.json | 2 +- assets/lang/se_SE.json | 2 +- assets/lang/si_SI.json | 2 +- assets/lang/zh_CN.json | 2 +- assets/lang/zh_TW.json | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/assets/lang/en_UK.json b/assets/lang/en_UK.json index ca268d7..22bae3e 100644 --- a/assets/lang/en_UK.json +++ b/assets/lang/en_UK.json @@ -6,7 +6,7 @@ "next":"NEXT", "login_error":"username or password \ncan't be empty", "login_error_ok":"OK", - "login_admin_account": "Do you have a Admin account? tap here then", + "login_admin_account": "Do you have a Admin account? tap here", "dashboard":"Dashboard", "logout":"Logout", "logout_sub":"Disconnect", @@ -27,7 +27,7 @@ "action_restart":"Restart", "action_kill":"Kill", "action_stats": "Stats", - "action_file": "File List (coming panel 0.8)", + "action_file": "File List", "dark_mode":"Dark mode", "dark_mode_sub":"Black and Grey Theme", "cores":"Cores", diff --git a/assets/lang/en_US.json b/assets/lang/en_US.json index ca135e2..dbdd998 100644 --- a/assets/lang/en_US.json +++ b/assets/lang/en_US.json @@ -6,7 +6,7 @@ "next":"NEXT", "login_error":"username or password \ncan't be empty", "login_error_ok":"OK", - "login_admin_account": "Do you have an Admin account? tap here then", + "login_admin_account": "Do you have an Admin account? tap here", "dashboard":"Dashboard", "logout":"Logout", "logout_sub":"Disconnect", @@ -27,7 +27,7 @@ "action_restart":"Restart", "action_kill":"Kill", "action_stats": "Stats", - "action_file": "File List (coming panel 0.8)", + "action_file": "File List", "dark_mode":"Dark mode", "dark_mode_sub":"Black and Grey Theme", "cores":"Cores", diff --git a/assets/lang/it_IT.json b/assets/lang/it_IT.json index 7ca0051..23a73a5 100644 --- a/assets/lang/it_IT.json +++ b/assets/lang/it_IT.json @@ -27,7 +27,7 @@ "action_restart":"Riavvia", "action_kill":"Kill", "action_stats": "Statistiche", - "action_file": "Lista File (coming panel 0.8)", + "action_file": "Lista File", "dark_mode":"Dark mode", "dark_mode_sub":"Template Nero e Grigio", "cores":"Cores", diff --git a/assets/lang/nl_NL.json b/assets/lang/nl_NL.json index 04a344b..4ead1cc 100644 --- a/assets/lang/nl_NL.json +++ b/assets/lang/nl_NL.json @@ -27,7 +27,7 @@ "action_restart":"Herstart", "action_kill":"Forceer stop", "action_stats": "Statistieken", - "action_file": "Bestandenlijst (komt in 0.8)", + "action_file": "Bestandenlijst", "dark_mode":"Donkere modus", "dark_mode_sub":"Zwart en grijze thema", "cores":"Kernen", diff --git a/assets/lang/no_NO.json b/assets/lang/no_NO.json index dcde211..da76168 100644 --- a/assets/lang/no_NO.json +++ b/assets/lang/no_NO.json @@ -27,7 +27,7 @@ "action_restart":"Omstart", "action_kill":"Kill", "action_stats": "Statistikk", - "action_file": "Filliste (coming panel 0.8)", + "action_file": "Filliste", "dark_mode":"Mørk modus", "dark_mode_sub":"Sort og grå modus", "cores":"Cores", diff --git a/assets/lang/pl_PL.json b/assets/lang/pl_PL.json index 425430e..1d5a747 100644 --- a/assets/lang/pl_PL.json +++ b/assets/lang/pl_PL.json @@ -27,7 +27,7 @@ "action_restart":"Zrestartuj", "action_kill":"Zabij proces", "action_stats": "Statystyki", - "action_file": "Pliki (dost. w wersji 0.8)", + "action_file": "Pliki", "dark_mode":"Ciemny motyw", "dark_mode_sub":"Czarny i szary motyw", "cores":"Rdzenie", diff --git a/assets/lang/se_SE.json b/assets/lang/se_SE.json index 299f256..18ee501 100644 --- a/assets/lang/se_SE.json +++ b/assets/lang/se_SE.json @@ -27,7 +27,7 @@ "action_restart":"Starta om", "action_kill":"Avsluta", "action_stats": "Statistik", - "action_file": "Fillista (kommer i panel version 0.8)", + "action_file": "Fillista", "dark_mode":"Mörkt läge", "dark_mode_sub":"Svart och grått tema", "cores":"Kärnor", diff --git a/assets/lang/si_SI.json b/assets/lang/si_SI.json index 3eb5a1f..74e3e86 100644 --- a/assets/lang/si_SI.json +++ b/assets/lang/si_SI.json @@ -27,7 +27,7 @@ "action_restart":"Ponovni zagon", "action_kill":"Ubij", "action_stats": "Statistika", - "action_file": "Seznam datotek (prihaja v verziji 0.8)", + "action_file": "Seznam datotek", "dark_mode":"Nočni način", "dark_mode_sub":"Črna in Siva Tema", "cores":"Jedra", diff --git a/assets/lang/zh_CN.json b/assets/lang/zh_CN.json index 6c6a32a..63ca68a 100644 --- a/assets/lang/zh_CN.json +++ b/assets/lang/zh_CN.json @@ -27,7 +27,7 @@ "action_restart": "重启", "action_kill": "杀死(强制停止)", "action_stats": "状态", - "action_file": "文件列表(将在面板0.8版本到来)", + "action_file": "文件列表", "dark_mode": "夜间模式", "dark_mode_sub": "黑色和灰色主题", "cores": "核心数", diff --git a/assets/lang/zh_TW.json b/assets/lang/zh_TW.json index b506802..f1b6e0d 100644 --- a/assets/lang/zh_TW.json +++ b/assets/lang/zh_TW.json @@ -27,7 +27,7 @@ "action_restart": "重啟", "action_kill": "殺死(強制停止)", "action_stats": "狀態", - "action_file": "檔案列表(將在面板0.8版本到來)", + "action_file": "檔案列表", "dark_mode": "夜間模式", "dark_mode_sub": "黑色和灰色主題", "cores": "核心數", From bdb44dc6de259dba6e8e81f272b6078096c9d64b Mon Sep 17 00:00:00 2001 From: Ruben Talstra Date: Mon, 20 May 2019 20:36:20 -0300 Subject: [PATCH 23/44] Update CONTRIBUTING.md --- CONTRIBUTING.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 28d3c6c..d8f13fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,7 @@ Then you copy this code: "action_restart":"Restart", "action_kill":"Kill", "action_stats": "Stats", - "action_file": "File List (coming panel 0.8)", + "action_file": "File List", "dark_mode":"Dark mode", "dark_mode_sub":"Black and Grey Theme", "cores":"Cores", @@ -121,7 +121,11 @@ Then you copy this code: "rootadmin": "Root admin:", "2fa": "2FA", "created_at": "Created at:", - "updated_at": "Updated at:" + "updated_at": "Updated at:", + "admin_actionserver_view_server_info": "View Server info", + "admin_actionserver_edit_server_info": "Edit Server info", + "utilization_stats_offline": "Server is offline", + "utilization_stats_online": "Server is online" } ``` And change to the languge you are working on. From f75e1afdb1b4580ac71479614385aaff256b3293 Mon Sep 17 00:00:00 2001 From: Ruben Talstra Date: Mon, 20 May 2019 20:37:28 -0300 Subject: [PATCH 24/44] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd1639f..d3a9eb8 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Facebook: Instagram: -Website: +Website: [Pterodactyl app website](https://pterodactyl-app.com/) Project Board: [click here](https://trello.com/b/YqCe05Vl/pterodactyl-app) From 7cdfce735b9af5349e334142bfa9f336447ff590 Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Mon, 20 May 2019 23:16:13 -0300 Subject: [PATCH 25/44] utilization almoste done YVAN fix please one thing XDDD <3 --- assets/lang/de_DE.json | 7 +- assets/lang/dk_DK.json | 7 +- assets/lang/en_UK.json | 7 +- assets/lang/en_US.json | 7 +- assets/lang/fr_FR.json | 7 +- assets/lang/it_IT.json | 7 +- assets/lang/nl_NL.json | 7 +- assets/lang/no_NO.json | 7 +- assets/lang/pl_PL.json | 7 +- assets/lang/se_SE.json | 7 +- assets/lang/si_SI.json | 7 +- assets/lang/zh_CN.json | 7 +- assets/lang/zh_TW.json | 7 +- lib/page/client/actionserver.dart | 26 ++++++- lib/page/client/utilization.dart | 124 ++++++++++++++++++++++++------ 15 files changed, 187 insertions(+), 54 deletions(-) diff --git a/assets/lang/de_DE.json b/assets/lang/de_DE.json index ff1b158..a62d416 100644 --- a/assets/lang/de_DE.json +++ b/assets/lang/de_DE.json @@ -102,7 +102,10 @@ "updated_at": "Updated at:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } diff --git a/assets/lang/dk_DK.json b/assets/lang/dk_DK.json index c28f4d5..8b756d4 100644 --- a/assets/lang/dk_DK.json +++ b/assets/lang/dk_DK.json @@ -104,6 +104,9 @@ "updated_at": "Updated at:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } \ No newline at end of file diff --git a/assets/lang/en_UK.json b/assets/lang/en_UK.json index 22bae3e..e49ed1c 100644 --- a/assets/lang/en_UK.json +++ b/assets/lang/en_UK.json @@ -104,6 +104,9 @@ "updated_at": "Updated at:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } diff --git a/assets/lang/en_US.json b/assets/lang/en_US.json index dbdd998..8099afe 100644 --- a/assets/lang/en_US.json +++ b/assets/lang/en_US.json @@ -104,6 +104,9 @@ "updated_at": "Updated at:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } diff --git a/assets/lang/fr_FR.json b/assets/lang/fr_FR.json index 7819d1e..4259e4b 100644 --- a/assets/lang/fr_FR.json +++ b/assets/lang/fr_FR.json @@ -104,6 +104,9 @@ "updated_at": "Updated at:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } diff --git a/assets/lang/it_IT.json b/assets/lang/it_IT.json index 23a73a5..aadeceb 100644 --- a/assets/lang/it_IT.json +++ b/assets/lang/it_IT.json @@ -104,6 +104,9 @@ "updated_at": "Updated at:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } diff --git a/assets/lang/nl_NL.json b/assets/lang/nl_NL.json index 4ead1cc..a739e18 100644 --- a/assets/lang/nl_NL.json +++ b/assets/lang/nl_NL.json @@ -104,6 +104,9 @@ "updated_at": "Geupdate op:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } diff --git a/assets/lang/no_NO.json b/assets/lang/no_NO.json index da76168..f825c8d 100644 --- a/assets/lang/no_NO.json +++ b/assets/lang/no_NO.json @@ -104,6 +104,9 @@ "updated_at": "Updated at:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } diff --git a/assets/lang/pl_PL.json b/assets/lang/pl_PL.json index 1d5a747..117124e 100644 --- a/assets/lang/pl_PL.json +++ b/assets/lang/pl_PL.json @@ -104,6 +104,9 @@ "updated_at": "Zaktualizowany o:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } diff --git a/assets/lang/se_SE.json b/assets/lang/se_SE.json index 18ee501..8038c7e 100644 --- a/assets/lang/se_SE.json +++ b/assets/lang/se_SE.json @@ -104,6 +104,9 @@ "updated_at": "Uppdaterades:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } diff --git a/assets/lang/si_SI.json b/assets/lang/si_SI.json index 74e3e86..dff4bd5 100644 --- a/assets/lang/si_SI.json +++ b/assets/lang/si_SI.json @@ -104,6 +104,9 @@ "updated_at": "Updated at:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } diff --git a/assets/lang/zh_CN.json b/assets/lang/zh_CN.json index 63ca68a..adeb769 100644 --- a/assets/lang/zh_CN.json +++ b/assets/lang/zh_CN.json @@ -103,6 +103,9 @@ "updated_at": "更新于:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } \ No newline at end of file diff --git a/assets/lang/zh_TW.json b/assets/lang/zh_TW.json index f1b6e0d..047e3cc 100644 --- a/assets/lang/zh_TW.json +++ b/assets/lang/zh_TW.json @@ -103,7 +103,10 @@ "updated_at": "Updated at:", "admin_actionserver_view_server_info": "View Server info", "admin_actionserver_edit_server_info": "Edit Server info", - "utilization_stats_offline": "Server is offline", - "utilization_stats_online": "Server is online" + "utilization_stats_offline": "Offline", + "utilization_stats_online": "Server is online", + "utilization_stats_starting": "Server is starting", + "utilization_stats_stopping": "Server is stopping", + "utilization_stats_Loading": "Retrieving data" } diff --git a/lib/page/client/actionserver.dart b/lib/page/client/actionserver.dart index 6805423..5701503 100644 --- a/lib/page/client/actionserver.dart +++ b/lib/page/client/actionserver.dart @@ -1,5 +1,6 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; import '../../globals.dart' as globals; import '../auth/shared_preferences_helper.dart'; @@ -300,11 +301,9 @@ class _ActionServerPageState extends State { fontWeight: FontWeight.w700, fontSize: 23.0)), ]), ), - /* onTap: () { - postKill(); + _filelist(); }, - */ ), _buildTile( Padding( @@ -369,4 +368,25 @@ class _ActionServerPageState extends State { }, child: child)); } + + _filelist() { + showDialog( + context: context, + barrierDismissible: false, + child: new CupertinoAlertDialog( + content: new Text( + "this will be soon added", + style: new TextStyle(fontSize: 16.0), + ), + actions: [ + new FlatButton( + onPressed: () { + Navigator.pop(context); + }, + child: new Text(DemoLocalizations.of(context).trans('yes'), + style: TextStyle(color: Colors.black)), + ) + ], + )); + } } diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index 4b79a5c..76c69ed 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -24,6 +24,7 @@ class _StatePageState extends State { int _memorycurrent; int _memorylimit; List _cpu = [0.0].toList(); + //double _cpucurrent; int _diskcurrent; int _disklimit; Timer timer; @@ -55,6 +56,7 @@ class _StatePageState extends State { _memorycurrent = data["attributes"]["memory"]["current"]; _memorylimit = data["attributes"]["memory"]["limit"]; _cpu = parseCpu(data["attributes"]["cpu"]["cores"]); + //_cpucurrent = data["attributes"]["cpu"]["current"]; _diskcurrent = data["attributes"]["disk"]["current"]; _disklimit = data["attributes"]["disk"]["limit"]; }); @@ -64,7 +66,7 @@ class _StatePageState extends State { void initState() { getData(); super.initState(); - timer = Timer.periodic(Duration(seconds: 5), (Timer t) => getData()); + timer = Timer.periodic(Duration(seconds: 3), (Timer t) => getData()); } @override @@ -78,7 +80,7 @@ class _StatePageState extends State { onPressed: () { Navigator.of(context).pop(); timer.cancel(); - }, + }, icon: Icon( Icons.arrow_back, color: globals.isDarkTheme ? Colors.white : Colors.black, @@ -110,21 +112,46 @@ class _StatePageState extends State { "$_stats" == "on" ? DemoLocalizations.of(context) .trans('utilization_stats_online') - : DemoLocalizations.of(context) - .trans('utilization_stats_offline'), + : "$_stats" == "off" + ? DemoLocalizations.of(context) + .trans('utilization_stats_offline') + : "$_stats" == "starting" + ? DemoLocalizations.of(context).trans( + 'utilization_stats_starting') + : "$_stats" == "stopping" + ? DemoLocalizations.of(context) + .trans( + 'utilization_stats_stopping') + : DemoLocalizations.of(context) + .trans( + 'utilization_stats_Loading'), style: TextStyle( fontWeight: FontWeight.w700, fontSize: 20.0)) ], ), Material( - color: "$_stats" == "on" ? Colors.green : Colors.red, + color: "$_stats" == "on" + ? Colors.green + : "$_stats" == "off" + ? Colors.red + : "$_stats" == "starting" + ? Colors.blue + : "$_stats" == "stopping" + ? Colors.red + : Colors.amber, shape: CircleBorder(), child: Padding( padding: const EdgeInsets.all(16.0), child: Icon( "$_stats" == "on" ? Icons.play_arrow - : Icons.stop, + : "$_stats" == "off" + ? Icons.stop + : "$_stats" == "starting" + ? Icons.loop + : "$_stats" == "stopping" + ? Icons.pause + : Icons.data_usage, color: Colors.white, size: 30.0), )), @@ -162,6 +189,12 @@ class _StatePageState extends State { fontSize: 20.0)), ], ), + Text("Yvan Fix did. Current CPU", + style: TextStyle( + color: Colors.blue, + fontWeight: FontWeight.w400, + fontSize: 14.0)), + ], ), Padding(padding: EdgeInsets.only(bottom: 4.0)), @@ -189,23 +222,44 @@ class _StatePageState extends State { .trans('utilization_memory'), style: TextStyle(color: Colors.blueAccent)), Text( - "$_memorycurrent" == null - ? DemoLocalizations.of(context) - .trans('utilization_stats_offline') - : "$_memorycurrent MB / $_memorylimit MB", + "$_stats" == "on" + ? "$_memorycurrent MB / $_memorylimit MB" + : "$_stats" == "off" + ? DemoLocalizations.of(context) + .trans('utilization_stats_offline') + : "$_stats" == "starting" + ? DemoLocalizations.of(context).trans( + 'utilization_stats_starting') + : "$_stats" == "stopping" + ? DemoLocalizations.of(context) + .trans( + 'utilization_stats_stopping') + : DemoLocalizations.of(context) + .trans( + 'utilization_stats_Loading'), style: TextStyle( fontWeight: FontWeight.w700, fontSize: 20.0)) ], ), Material( - color: "$_memorycurrent" == "$_memorylimit" - ? Colors.red - : Colors.green, + color: "$_stats" == "on" + ? Colors.green + : "$_stats" == "off" + ? Colors.red + : "$_stats" == "starting" + ? Colors.blue + : "$_stats" == "stopping" + ? Colors.red + : Colors.amber, shape: CircleBorder(), child: Padding( padding: const EdgeInsets.all(16.0), - child: Icon(Icons.memory, - color: Colors.white, size: 30.0), + child: Icon( + "$_stats" == "on" + ? Icons.memory + : Icons.data_usage, + color: Colors.white, + size: 30.0), )), ]), ), @@ -226,24 +280,44 @@ class _StatePageState extends State { DemoLocalizations.of(context) .trans('utilization_disk'), style: TextStyle(color: Colors.blueAccent)), - Text( - "$_diskcurrent" == null - ? DemoLocalizations.of(context) - .trans('utilization_stats_offline') - : "$_diskcurrent MB / $_disklimit MB", + Text("$_stats" == "on" + ? "$_diskcurrent MB / $_disklimit MB" + : "$_stats" == "off" + ? DemoLocalizations.of(context) + .trans('utilization_stats_offline') + : "$_stats" == "starting" + ? DemoLocalizations.of(context).trans( + 'utilization_stats_starting') + : "$_stats" == "stopping" + ? DemoLocalizations.of(context) + .trans( + 'utilization_stats_stopping') + : DemoLocalizations.of(context) + .trans( + 'utilization_stats_Loading'), style: TextStyle( fontWeight: FontWeight.w700, fontSize: 20.0)) ], ), Material( - color: "$_diskcurrent" == "$_disklimit" - ? Colors.red - : Colors.green, + color: "$_stats" == "on" + ? Colors.green + : "$_stats" == "off" + ? Colors.red + : "$_stats" == "starting" + ? Colors.blue + : "$_stats" == "stopping" + ? Colors.red + : Colors.amber, shape: CircleBorder(), child: Padding( padding: const EdgeInsets.all(16.0), - child: Icon(Icons.sd_storage, - color: Colors.white, size: 30.0), + child: Icon( + "$_stats" == "on" + ? Icons.sd_storage + : Icons.data_usage, + color: Colors.white, + size: 30.0), )), ]), ), From 45bcd8f291ca2efcbcab35e6188d4c8cd39f75a4 Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Mon, 20 May 2019 23:23:07 -0300 Subject: [PATCH 26/44] updated admin login :) --- lib/page/admin/adminlogin.dart | 57 ++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/lib/page/admin/adminlogin.dart b/lib/page/admin/adminlogin.dart index a864dc1..e0634ba 100644 --- a/lib/page/admin/adminlogin.dart +++ b/lib/page/admin/adminlogin.dart @@ -62,29 +62,40 @@ class _AdminLoginPageState extends State { ), ), ), - SizedBox(height: 12.0), - DropdownButton( - value: dropdownValue, - onChanged: (String newValue) { - setState(() { - dropdownValue = newValue; - }); - }, - items: ['https://', 'http://'] - .map>((String value) { - return DropdownMenuItem( - value: value, - child: Text(value), - ); - }).toList(), - ), - AccentColorOverride( - color: Color(0xFFC5032B), - child: TextField( - controller: _urladminController, - decoration: InputDecoration( - labelText: DemoLocalizations.of(context).trans('url_login'), - ), + SizedBox( + height: 60.0, + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + DropdownButton( + value: dropdownValue, + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + }); + }, + items: ['https://', 'http://'] + .map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + AccentColorOverride( + color: Color(0xFFC5032B), + child: new Flexible( + child: TextField( + controller: _urladminController, + decoration: InputDecoration( + labelText: DemoLocalizations.of(context) + .trans('url_login'), + ), + ), + )), + ], ), ), new CheckboxListTile( From 6f37a42dd9911722c43afbfba0258b97e959767c Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Mon, 20 May 2019 23:30:23 -0300 Subject: [PATCH 27/44] fix stats page :+1: --- lib/page/admin/adminusers.dart | 29 ++++++++++++++++++++++++----- lib/page/client/utilization.dart | 28 ++++++++++++++++++++-------- 2 files changed, 44 insertions(+), 13 deletions(-) diff --git a/lib/page/admin/adminusers.dart b/lib/page/admin/adminusers.dart index 65a9e12..59c62d0 100644 --- a/lib/page/admin/adminusers.dart +++ b/lib/page/admin/adminusers.dart @@ -160,11 +160,20 @@ class _AdminUsersListPageState extends State { EdgeInsets.symmetric(horizontal: 4.0), child: Material( borderRadius: BorderRadius.circular(8.0), - color: "${userData[index]["attributes"]["root_admin"]}" == "true" ? Colors.green : Colors.blue, + color: + "${userData[index]["attributes"]["root_admin"]}" == + "true" + ? Colors.green + : Colors.blue, child: Padding( padding: EdgeInsets.all(4.0), child: Text( - '${userData[index]["attributes"]["root_admin"]}' == "true" ? DemoLocalizations.of(context).trans('yes') : DemoLocalizations.of(context).trans('no'), + '${userData[index]["attributes"]["root_admin"]}' == + "true" + ? DemoLocalizations.of(context) + .trans('yes') + : DemoLocalizations.of(context) + .trans('no'), style: TextStyle( fontWeight: FontWeight.w700, color: Colors.white)), @@ -182,11 +191,20 @@ class _AdminUsersListPageState extends State { EdgeInsets.symmetric(horizontal: 4.0), child: Material( borderRadius: BorderRadius.circular(8.0), - color: "${userData[index]["attributes"]["2fa"]}" == "true" ? Colors.green : Colors.red, + color: + "${userData[index]["attributes"]["2fa"]}" == + "true" + ? Colors.green + : Colors.red, child: Padding( padding: EdgeInsets.all(4.0), child: Text( - '${userData[index]["attributes"]["2fa"]}' == "true" ? DemoLocalizations.of(context).trans('yes') : DemoLocalizations.of(context).trans('no'), + '${userData[index]["attributes"]["2fa"]}' == + "true" + ? DemoLocalizations.of(context) + .trans('yes') + : DemoLocalizations.of(context) + .trans('no'), style: TextStyle( fontWeight: FontWeight.w700, color: Colors.white)), @@ -213,7 +231,8 @@ class _AdminUsersListPageState extends State { .push(MaterialPageRoute(builder: (_) => AdminCreateUserPage())); }, icon: Icon(Icons.add), - label: Text(DemoLocalizations.of(context).trans('admin_user_list_user')), + label: + Text(DemoLocalizations.of(context).trans('admin_user_list_user')), ), ); } diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index 76c69ed..f16ae32 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -190,11 +190,10 @@ class _StatePageState extends State { ], ), Text("Yvan Fix did. Current CPU", - style: TextStyle( - color: Colors.blue, - fontWeight: FontWeight.w400, - fontSize: 14.0)), - + style: TextStyle( + color: Colors.blue, + fontWeight: FontWeight.w400, + fontSize: 14.0)), ], ), Padding(padding: EdgeInsets.only(bottom: 4.0)), @@ -257,7 +256,13 @@ class _StatePageState extends State { child: Icon( "$_stats" == "on" ? Icons.memory - : Icons.data_usage, + : "$_stats" == "off" + ? Icons.stop + : "$_stats" == "starting" + ? Icons.loop + : "$_stats" == "stopping" + ? Icons.pause + : Icons.data_usage, color: Colors.white, size: 30.0), )), @@ -280,7 +285,8 @@ class _StatePageState extends State { DemoLocalizations.of(context) .trans('utilization_disk'), style: TextStyle(color: Colors.blueAccent)), - Text("$_stats" == "on" + Text( + "$_stats" == "on" ? "$_diskcurrent MB / $_disklimit MB" : "$_stats" == "off" ? DemoLocalizations.of(context) @@ -315,7 +321,13 @@ class _StatePageState extends State { child: Icon( "$_stats" == "on" ? Icons.sd_storage - : Icons.data_usage, + : "$_stats" == "off" + ? Icons.stop + : "$_stats" == "starting" + ? Icons.loop + : "$_stats" == "stopping" + ? Icons.pause + : Icons.data_usage, color: Colors.white, size: 30.0), )), From 5ef547e0fa3e23ba1b812dca294484e23daa6493 Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Mon, 20 May 2019 23:34:33 -0300 Subject: [PATCH 28/44] Update utilization.dart --- lib/page/client/utilization.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index f16ae32..c6baf2a 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -200,7 +200,11 @@ class _StatePageState extends State { Sparkline( data: _cpu.isNotEmpty ? _cpu : [0.0], lineWidth: 5.0, - lineColor: Colors.greenAccent, + lineGradient: new LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [Colors.green[800], Colors.green[200]], + ), ) ], )), From e6c315c3b4b1451b00fcd03510eacb843f10e50d Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Mon, 20 May 2019 23:47:15 -0300 Subject: [PATCH 29/44] Update login.dart --- lib/page/client/login.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/page/client/login.dart b/lib/page/client/login.dart index 7feb389..fea90b7 100644 --- a/lib/page/client/login.dart +++ b/lib/page/client/login.dart @@ -135,6 +135,7 @@ class _LoginPageState extends State { ), ], ), + SizedBox(height: 50.0), new FlatButton( child: new Text( DemoLocalizations.of(context).trans('login_admin_account')), From f0d704f997c074ccaabec7faf8f787622d1e9dc0 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Tue, 21 May 2019 09:39:31 +0200 Subject: [PATCH 30/44] Hotfix navigation context --- lib/page/auth/auth.dart | 20 ++++++++++++++++++++ lib/page/client/home.dart | 31 ++++++++++++++++++++----------- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/lib/page/auth/auth.dart b/lib/page/auth/auth.dart index 3627a32..aab1703 100644 --- a/lib/page/auth/auth.dart +++ b/lib/page/auth/auth.dart @@ -14,6 +14,9 @@ class Splash extends StatefulWidget { } class SplashState extends State { + + BuildContext context; + Future checkFirstSeen() async { SharedPreferences prefs = await SharedPreferences.getInstance(); var bool2 = prefs.getBool('seen'); @@ -52,6 +55,13 @@ class SplashState extends State { String _urladmin = await SharedPreferencesHelper.getString("panelAdminUrl"); + if(_urladmin.isEmpty) { + SharedPreferencesHelper.remove('apiAdminKey'); + Navigator.of(context).pushNamedAndRemoveUntil( + '/adminlogin', (Route route) => false); + return false; + } + http.Response response = await http.get( "$_adminhttps$_urladmin/api/application/servers", headers: { @@ -74,6 +84,13 @@ class SplashState extends State { String _adminhttps = await SharedPreferencesHelper.getString("https"); String _urladmin = await SharedPreferencesHelper.getString("panelUrl"); + if(_urladmin.isEmpty) { + SharedPreferencesHelper.remove('apiKey'); + Navigator.of(context).pushNamedAndRemoveUntil( + '/login', (Route route) => false); + return false; + } + http.Response response = await http.get( "$_adminhttps$_urladmin/api/client", headers: { @@ -82,6 +99,8 @@ class SplashState extends State { }, ); + print(response.statusCode); + if (response.statusCode == 401) { // Todo fix Navigation context for logging out if key isn't available SharedPreferencesHelper.remove('apiKey'); @@ -103,6 +122,7 @@ class SplashState extends State { @override Widget build(BuildContext context) { + this.context = context; return new Scaffold( body: new Center( child: new Text('Loading...'), diff --git a/lib/page/client/home.dart b/lib/page/client/home.dart index 452f24c..979184a 100644 --- a/lib/page/client/home.dart +++ b/lib/page/client/home.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import '../auth/shared_preferences_helper.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:http/http.dart' as http; +import 'dart:io'; import '../../globals.dart' as globals; import 'dart:async'; import 'dart:convert'; @@ -25,18 +26,26 @@ class _MyHomePageState extends State { String _url = await SharedPreferencesHelper.getString("panelUrl"); String _https = await SharedPreferencesHelper.getString("https"); - http.Response response = await http.get( - "$_https$_url/api/client", - headers: { - "Accept": "Application/vnd.pterodactyl.v1+json", - "Authorization": "Bearer $_api" - }, - ); + try { + http.Response response = await http.get( + "$_https$_url/api/client", + headers: { + "Accept": "Application/vnd.pterodactyl.v1+json", + "Authorization": "Bearer $_api" + }, + ); - data = json.decode(response.body); - setState(() { - userTotalServers = data["meta"]["pagination"]["total"]; - }); + data = await json.decode(response.body); + setState(() { + userTotalServers = data["meta"]["pagination"]["total"]; + }); + + } on SocketException catch(e) { + print('Error occured: ' + e.message); + print(_url); + print(_https); + print('End debug'); + } } @override From 2ba6924a3396dfcc5f4036764035d45c95bb36ca Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Tue, 21 May 2019 09:57:03 +0200 Subject: [PATCH 31/44] Locale update --- lib/page/client/utilization.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index c6baf2a..f7cfa13 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -106,7 +106,7 @@ class _StatePageState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("Stats:", + Text("Status:", style: TextStyle(color: Colors.blueAccent)), Text( "$_stats" == "on" From e6615b3ef7d1170751205ebabc6de84661304f8e Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Tue, 21 May 2019 11:03:55 +0200 Subject: [PATCH 32/44] Firebase is application specific. --- ios/Flutter/Generated.xcconfig | 9 - ios/GoogleService-Info.plist | 36 -- ios/Podfile.lock | 55 --- ios/Runner.xcodeproj/project.pbxproj | 597 --------------------------- 4 files changed, 697 deletions(-) delete mode 100644 ios/Flutter/Generated.xcconfig delete mode 100644 ios/GoogleService-Info.plist delete mode 100644 ios/Podfile.lock delete mode 100644 ios/Runner.xcodeproj/project.pbxproj diff --git a/ios/Flutter/Generated.xcconfig b/ios/Flutter/Generated.xcconfig deleted file mode 100644 index dd8fcc4..0000000 --- a/ios/Flutter/Generated.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -// This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=E:\Pterodactly\flutter -FLUTTER_APPLICATION_PATH=E:\Pterodactly\app v1\pterodactyl_app -FLUTTER_TARGET=lib/main.dart -FLUTTER_BUILD_DIR=build -SYMROOT=${SOURCE_ROOT}/../build\ios -FLUTTER_FRAMEWORK_DIR=E:\Pterodactly\flutter\bin\cache\artifacts\engine\ios -FLUTTER_BUILD_NAME=2.4.6 -FLUTTER_BUILD_NUMBER=26 diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist deleted file mode 100644 index cf35d2f..0000000 --- a/ios/GoogleService-Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CLIENT_ID - 565795306919-7c4v8abdnaq30dd9f0s338tsjrc4rhrv.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.565795306919-7c4v8abdnaq30dd9f0s338tsjrc4rhrv - API_KEY - AIzaSyAECYr3uGoXnDLU_wfYphnKuvxri6AfN9g - GCM_SENDER_ID - 565795306919 - PLIST_VERSION - 1 - BUNDLE_ID - nl.rubentalstra.pterodactyl - PROJECT_ID - pterodactyl-app - STORAGE_BUCKET - pterodactyl-app.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:565795306919:ios:f3d6ac38704170ba - DATABASE_URL - https://pterodactyl-app.firebaseio.com - - \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index 126f5b8..0000000 --- a/ios/Podfile.lock +++ /dev/null @@ -1,55 +0,0 @@ -PODS: - - Flutter (1.0.0) - - FMDB (2.7.5): - - FMDB/standard (= 2.7.5) - - FMDB/standard (2.7.5) - - get_version (0.0.1): - - Flutter - - package_info (0.0.1): - - Flutter - - path_provider (0.0.1): - - Flutter - - shared_preferences (0.0.1): - - Flutter - - sqflite (0.0.1): - - Flutter - - FMDB (~> 2.7.2) - -DEPENDENCIES: - - Flutter (from `.symlinks/flutter/ios`) - - get_version (from `.symlinks/plugins/get_version/ios`) - - package_info (from `.symlinks/plugins/package_info/ios`) - - path_provider (from `.symlinks/plugins/path_provider/ios`) - - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - - sqflite (from `.symlinks/plugins/sqflite/ios`) - -SPEC REPOS: - https://github.com/cocoapods/specs.git: - - FMDB - -EXTERNAL SOURCES: - Flutter: - :path: ".symlinks/flutter/ios" - get_version: - :path: ".symlinks/plugins/get_version/ios" - package_info: - :path: ".symlinks/plugins/package_info/ios" - path_provider: - :path: ".symlinks/plugins/path_provider/ios" - shared_preferences: - :path: ".symlinks/plugins/shared_preferences/ios" - sqflite: - :path: ".symlinks/plugins/sqflite/ios" - -SPEC CHECKSUMS: - Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a - FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a - get_version: 2bc18c4e26a265571662cab5d38f8b50dc8c1c77 - package_info: 78cabb3c322943c55d39676f4a5bfc748c01d055 - path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259 - shared_preferences: 1feebfa37bb57264736e16865e7ffae7fc99b523 - sqflite: ff1d9da63c06588cc8d1faf7256d741f16989d5a - -PODFILE CHECKSUM: ebd43b443038e611b86ede96e613bd6033c49497 - -COCOAPODS: 1.7.0.beta.2 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 3b29139..0000000 --- a/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,597 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - DB7E9C82A3AFA078DBEDF06C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A36AC808902E28D3A3C0FA5A /* Pods_Runner.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2034445006643433BC67AAEB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 283443764A58ECB64F9D2871 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A36AC808902E28D3A3C0FA5A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F73F98BB815154249FB01F86 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - DB7E9C82A3AFA078DBEDF06C /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1B60C51CCA3C5DCF099C0298 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A36AC808902E28D3A3C0FA5A /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B80C3931E831B6300D905FE /* App.framework */, - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - FCE3B62A4E4E7E2B14E3E9CC /* Pods */, - 1B60C51CCA3C5DCF099C0298 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - ); - name = "Supporting Files"; - sourceTree = ""; - }; - FCE3B62A4E4E7E2B14E3E9CC /* Pods */ = { - isa = PBXGroup; - children = ( - 2034445006643433BC67AAEB /* Pods-Runner.debug.xcconfig */, - 283443764A58ECB64F9D2871 /* Pods-Runner.release.xcconfig */, - F73F98BB815154249FB01F86 /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 16E59CFB0C54EDEB854923B9 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 2C6E10C84D7D65DAF7C879B6 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0910; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = DK3J6J3HJR; - LastSwiftMigration = 0910; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 16E59CFB0C54EDEB854923B9 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 2C6E10C84D7D65DAF7C879B6 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", - "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", - "${BUILT_PRODUCTS_DIR}/get_version/get_version.framework", - "${BUILT_PRODUCTS_DIR}/package_info/package_info.framework", - "${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework", - "${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework", - "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/get_version.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = DK3J6J3HJR; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.example.pterodactyl-app"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = DK3J6J3HJR; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.example.pterodactyl-app"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = DK3J6J3HJR; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = "com.example.pterodactyl-app"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} From 6c054ae8fa4dc60cc714dde1f4d733a8b46a8bd8 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Tue, 21 May 2019 11:34:41 +0200 Subject: [PATCH 33/44] fix current usage --- lib/page/client/utilization.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index f7cfa13..b8bee9a 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -24,7 +24,7 @@ class _StatePageState extends State { int _memorycurrent; int _memorylimit; List _cpu = [0.0].toList(); - //double _cpucurrent; + double _currentCpu; int _diskcurrent; int _disklimit; Timer timer; @@ -56,7 +56,7 @@ class _StatePageState extends State { _memorycurrent = data["attributes"]["memory"]["current"]; _memorylimit = data["attributes"]["memory"]["limit"]; _cpu = parseCpu(data["attributes"]["cpu"]["cores"]); - //_cpucurrent = data["attributes"]["cpu"]["current"]; + _currentCpu = data["attributes"]["cpu"]["current"].toDouble(); _diskcurrent = data["attributes"]["disk"]["current"]; _disklimit = data["attributes"]["disk"]["limit"]; }); @@ -189,7 +189,7 @@ class _StatePageState extends State { fontSize: 20.0)), ], ), - Text("Yvan Fix did. Current CPU", + Text("$_currentCpu", style: TextStyle( color: Colors.blue, fontWeight: FontWeight.w400, From 732e82b3ae4c76b682a0333037b02b760ba53c62 Mon Sep 17 00:00:00 2001 From: "Yvan E. Watchman" Date: Tue, 21 May 2019 13:17:55 +0200 Subject: [PATCH 34/44] Redo color to blue accent --- lib/page/client/utilization.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index b8bee9a..855c03a 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -177,7 +177,7 @@ class _StatePageState extends State { Text( DemoLocalizations.of(context) .trans('utilization_performance_cpu'), - style: TextStyle(color: Colors.redAccent)), + style: TextStyle(color: Colors.blueAccent)), Text( DemoLocalizations.of(context) .trans('utilization_cpu'), From def8d354e891a41320589c7ce94981aec4e8fdc9 Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Tue, 21 May 2019 10:08:14 -0300 Subject: [PATCH 35/44] Update utilization.dart --- lib/page/client/utilization.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index 855c03a..294211a 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -261,11 +261,11 @@ class _StatePageState extends State { "$_stats" == "on" ? Icons.memory : "$_stats" == "off" - ? Icons.stop + ? Icons.memory : "$_stats" == "starting" - ? Icons.loop + ? Icons.memory : "$_stats" == "stopping" - ? Icons.pause + ? Icons.memory : Icons.data_usage, color: Colors.white, size: 30.0), @@ -326,11 +326,11 @@ class _StatePageState extends State { "$_stats" == "on" ? Icons.sd_storage : "$_stats" == "off" - ? Icons.stop + ? Icons.sd_storage : "$_stats" == "starting" - ? Icons.loop + ? Icons.sd_storage : "$_stats" == "stopping" - ? Icons.pause + ? Icons.sd_storage : Icons.data_usage, color: Colors.white, size: 30.0), From ec690556bcda6dea1d860fb928776e5f9ad2161b Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Tue, 21 May 2019 11:23:24 -0300 Subject: [PATCH 36/44] Update utilization.dart --- lib/page/client/utilization.dart | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/page/client/utilization.dart b/lib/page/client/utilization.dart index 294211a..60f6f9d 100644 --- a/lib/page/client/utilization.dart +++ b/lib/page/client/utilization.dart @@ -25,6 +25,7 @@ class _StatePageState extends State { int _memorylimit; List _cpu = [0.0].toList(); double _currentCpu; + int _limitCpu; int _diskcurrent; int _disklimit; Timer timer; @@ -57,6 +58,7 @@ class _StatePageState extends State { _memorylimit = data["attributes"]["memory"]["limit"]; _cpu = parseCpu(data["attributes"]["cpu"]["cores"]); _currentCpu = data["attributes"]["cpu"]["current"].toDouble(); + _limitCpu = data["attributes"]["cpu"]["limit"]; _diskcurrent = data["attributes"]["disk"]["current"]; _disklimit = data["attributes"]["disk"]["limit"]; }); @@ -189,7 +191,16 @@ class _StatePageState extends State { fontSize: 20.0)), ], ), - Text("$_currentCpu", + Text( + "$_stats" == "on" + ? "${_limitCpu.toString()}" != 0 + ? "$_currentCpu % / ∞ %" + : "$_currentCpu % / ${_limitCpu.toString()} %" + : "$_stats" == "off" + ? DemoLocalizations.of(context) + .trans('utilization_stats_offline') + : DemoLocalizations.of(context) + .trans('utilization_stats_Loading'), style: TextStyle( color: Colors.blue, fontWeight: FontWeight.w400, From 629aebc51a0cd6dfd5888b696a810ee0ffa6eae7 Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Tue, 21 May 2019 12:23:54 -0300 Subject: [PATCH 37/44] UI update --- lib/page/admin/adminlogin.dart | 1 + lib/page/client/login.dart | 67 ++++++++++++++++++---------------- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/lib/page/admin/adminlogin.dart b/lib/page/admin/adminlogin.dart index e0634ba..9e9ffbf 100644 --- a/lib/page/admin/adminlogin.dart +++ b/lib/page/admin/adminlogin.dart @@ -62,6 +62,7 @@ class _AdminLoginPageState extends State { ), ), ), + SizedBox(height: 12.0), SizedBox( height: 60.0, child: new Row( diff --git a/lib/page/client/login.dart b/lib/page/client/login.dart index fea90b7..539969e 100644 --- a/lib/page/client/login.dart +++ b/lib/page/client/login.dart @@ -62,38 +62,43 @@ class _LoginPageState extends State { ), ), ), - SizedBox(height: 60.0, child: new Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - DropdownButton( - value: dropdownValue, - onChanged: (String newValue) { - setState(() { - dropdownValue = newValue; - }); - }, - items: ['https://', 'http://'] - .map>((String value) { - return DropdownMenuItem( - value: value, - child: Text(value), - ); - }).toList(), - ), - AccentColorOverride( - color: Color(0xFFC5032B), - child: new Flexible(child: TextField( - controller: _urlController, - decoration: InputDecoration( - labelText: DemoLocalizations.of(context).trans('url_login'), - ), + SizedBox(height: 12.0), + SizedBox( + height: 60.0, + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + DropdownButton( + value: dropdownValue, + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + }); + }, + items: ['https://', 'http://'] + .map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), ), - ) - ), - ], - ),), + AccentColorOverride( + color: Color(0xFFC5032B), + child: new Flexible( + child: TextField( + controller: _urlController, + decoration: InputDecoration( + labelText: DemoLocalizations.of(context) + .trans('url_login'), + ), + ), + )), + ], + ), + ), new CheckboxListTile( value: checkValue, onChanged: _onChanged, From d17ac5fb3c7a8fc6787474df75be51c1c5b660d9 Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Tue, 21 May 2019 22:48:46 -0300 Subject: [PATCH 38/44] hole shit i get an headache of this , hahah:( needed to change the hole UI design love it XDDD 4 hours later done finaly --- lib/page/admin/adminallocations.dart | 162 ++++++++++++++ lib/page/admin/adminnodes.dart | 269 +++++++++++++----------- lib/page/admin/adminservers.dart | 298 +++++++++++++++----------- lib/page/admin/adminusers.dart | 303 +++++++++++++++------------ lib/page/client/servers.dart | 271 +++++++++++++----------- 5 files changed, 797 insertions(+), 506 deletions(-) diff --git a/lib/page/admin/adminallocations.dart b/lib/page/admin/adminallocations.dart index 2f1a5a9..ecc7fde 100644 --- a/lib/page/admin/adminallocations.dart +++ b/lib/page/admin/adminallocations.dart @@ -64,6 +64,168 @@ class _AdminAllocationsPageState extends State { body: ListView.builder( itemCount: userData == null ? 0 : userData.length, itemBuilder: (BuildContext context, int index) { + + return InkWell( + child: Padding( + padding: EdgeInsets.only(bottom: 16.0), + child: Stack( + children: [ + /// Item card + Align( + alignment: Alignment.topCenter, + child: SizedBox.fromSize( + size: Size.fromHeight(140.0), + child: Stack( + fit: StackFit.expand, + children: [ + /// Item description inside a material + Container( + margin: EdgeInsets.only(top: 24.0), + child: Material( + elevation: 14.0, + borderRadius: BorderRadius.circular(12.0), + shadowColor: globals.isDarkTheme + ? Colors.grey[700] + : Color(0x802196F3), + child: InkWell( + /* + onTap: () { + }, + */ + child: Container( + child: Padding( + padding: EdgeInsets.all(24.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + /// Title and rating + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + '${userData[index]["attributes"]["alias"]}', + style: + TextStyle(color: Colors.blueAccent)), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + 'IP: ${userData[index]['attributes']['ip']}', + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + fontWeight: FontWeight.w700, + fontSize: 18.0)), + ], + ), + ], + ), + + /// Infos + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + DemoLocalizations.of(context) + .trans('admin_allocations_id'), + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + fontSize: 18.0, + )), + Padding( + padding: + EdgeInsets.symmetric(horizontal: 4.0), + child: Material( + borderRadius: BorderRadius.circular(8.0), + color: Colors.green, + child: Padding( + padding: EdgeInsets.all(4.0), + child: Text( + '${userData[index]["attributes"]["id"]}', + style: TextStyle( + fontWeight: FontWeight.w700, + color: Colors.white)), + ), + ), + ), + Text( + DemoLocalizations.of(context) + .trans('admin_allocations_assigned'), + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + fontSize: 18.0, + )), + Padding( + padding: + EdgeInsets.symmetric(horizontal: 4.0), + child: Material( + borderRadius: BorderRadius.circular(8.0), + color: Colors.green, + child: Padding( + padding: EdgeInsets.all(4.0), + child: Text( + '${userData[index]["attributes"]["assigned"]}', + style: TextStyle( + fontWeight: FontWeight.w700, + color: Colors.white)), + ), + ), + ), + Text( + DemoLocalizations.of(context) + .trans('admin_allocations_port'), + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + fontSize: 18.0, + )), + Padding( + padding: + EdgeInsets.symmetric(horizontal: 4.0), + child: Material( + borderRadius: BorderRadius.circular(8.0), + color: Colors.green, + child: Padding( + padding: EdgeInsets.all(4.0), + child: Text( + '${userData[index]["attributes"]["port"]}', + style: TextStyle( + fontWeight: FontWeight.w700, + color: Colors.white)), + ), + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + ) + ], + )), + ), + ], + ), + )); + return InkWell( child: Padding( padding: const EdgeInsets.all(8.0), diff --git a/lib/page/admin/adminnodes.dart b/lib/page/admin/adminnodes.dart index 43d4151..cbdd2ea 100644 --- a/lib/page/admin/adminnodes.dart +++ b/lib/page/admin/adminnodes.dart @@ -68,133 +68,158 @@ class _AdminNodesListPageState extends State { itemCount: userData == null ? 0 : userData.length, itemBuilder: (BuildContext context, int index) { return InkWell( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(top: 16.0), - child: Material( - elevation: 14.0, - borderRadius: BorderRadius.circular(12.0), - shadowColor: globals.isDarkTheme - ? Colors.grey[700] - : Color(0x802196F3), - color: - globals.isDarkTheme ? Colors.grey[850] : Colors.white, - child: InkWell( - onTap: () { - var route = new MaterialPageRoute( - builder: (BuildContext context) => - new AdminActionNodesPage( - server: Nodes( - adminids: userData[index]["attributes"]["id"] - .toString(), - adminname: userData[index]["attributes"] - ["name"], - adminnodeip: userData[index]["attributes"]["ip"] - )), - ); - Navigator.of(context).push(route); - }, - child: Padding( - padding: EdgeInsets.all(30.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - /// Title and rating - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '${userData[index]["attributes"]["description"]} ${userData[index]["attributes"]["id"]}', - style: - TextStyle(color: Colors.blueAccent)), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Text( - '${userData[index]["attributes"]["name"]}', - style: TextStyle( - color: globals.isDarkTheme - ? Colors.white - : Colors.black, - fontWeight: FontWeight.w700, - fontSize: 18.0)), - ], - ), - ], - ), + child: Padding( + padding: EdgeInsets.only(bottom: 16.0), + child: Stack( + children: [ + /// Item card + Align( + alignment: Alignment.topCenter, + child: SizedBox.fromSize( + size: Size.fromHeight(140.0), + child: Stack( + fit: StackFit.expand, + children: [ + /// Item description inside a material + Container( + margin: EdgeInsets.only(top: 24.0), + child: Material( + elevation: 14.0, + borderRadius: BorderRadius.circular(12.0), + shadowColor: globals.isDarkTheme + ? Colors.grey[700] + : Color(0x802196F3), + child: InkWell( + onTap: () { + var route = new MaterialPageRoute( + builder: (BuildContext context) => + new AdminActionNodesPage( + server: Nodes( + adminids: userData[index] + ["attributes"]["id"] + .toString(), + adminname: userData[index] + ["attributes"]["name"], + adminnodeip: userData[index] + ["attributes"]["ip"])), + ); + Navigator.of(context).push(route); + }, + child: Container( + child: Padding( + padding: EdgeInsets.all(24.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + /// Title and rating + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + '${userData[index]["attributes"]["description"]} ${userData[index]["attributes"]["id"]}', + style: TextStyle( + color: Colors.blueAccent)), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + '${userData[index]["attributes"]["name"]}', + style: TextStyle( + color: + globals.isDarkTheme + ? Colors.white + : Colors.black, + fontWeight: + FontWeight.w700, + fontSize: 20.0)), + ], + ), + ], + ), - /// Infos - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - DemoLocalizations.of(context) - .trans('total_ram'), - style: TextStyle( - color: globals.isDarkTheme - ? Colors.white - : Colors.black, - )), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 4.0), - child: Material( - borderRadius: BorderRadius.circular(8.0), - color: Colors.green, - child: Padding( - padding: EdgeInsets.all(4.0), - child: Text( - '${userData[index]["attributes"]["memory"]} MB', - style: TextStyle( - fontWeight: FontWeight.w700, - color: Colors.white)), - ), - ), - ), - Text( - DemoLocalizations.of(context) - .trans('total_disk'), - style: TextStyle( - color: globals.isDarkTheme - ? Colors.white - : Colors.black, - )), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 4.0), - child: Material( - borderRadius: BorderRadius.circular(8.0), - color: Colors.green, - child: Padding( - padding: EdgeInsets.all(4.0), - child: Text( - '${userData[index]["attributes"]["disk"]} MB', - style: TextStyle( - fontWeight: FontWeight.w700, - color: Colors.white)), - ), + /// Infos + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + DemoLocalizations.of(context) + .trans('total_ram'), + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + )), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 4.0), + child: Material( + borderRadius: + BorderRadius.circular(8.0), + color: Colors.green, + child: Padding( + padding: EdgeInsets.all(4.0), + child: Text( + '${userData[index]["attributes"]["memory"]} MB', + style: TextStyle( + fontWeight: + FontWeight.w700, + color: Colors.white)), + ), + ), + ), + Text( + DemoLocalizations.of(context) + .trans('total_disk'), + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + )), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 4.0), + child: Material( + borderRadius: + BorderRadius.circular(8.0), + color: Colors.green, + child: Padding( + padding: EdgeInsets.all(4.0), + child: Text( + '${userData[index]["attributes"]["disk"]} MB', + style: TextStyle( + fontWeight: + FontWeight.w700, + color: Colors.white)), + ), + ), + ), + ], + ), + ], ), ), - ], + ), ), - ], - ), - ), - ), - ), - ), - ], - ), + ), + ) + ], + )), + ), + ], ), - ); + )); }, ), ); diff --git a/lib/page/admin/adminservers.dart b/lib/page/admin/adminservers.dart index 6b792b6..17f7049 100644 --- a/lib/page/admin/adminservers.dart +++ b/lib/page/admin/adminservers.dart @@ -8,7 +8,14 @@ import '../../main.dart'; import 'adminactionserver.dart'; class Admin { - final String adminid, adminuser, adminname, admindescription, adminmemory, admindisk, admincpu, adminstartupcommand; + final String adminid, + adminuser, + adminname, + admindescription, + adminmemory, + admindisk, + admincpu, + adminstartupcommand; const Admin({ this.adminid, this.adminuser, @@ -89,136 +96,177 @@ class _AdminServerListPageState extends State { itemCount: userData == null ? 0 : userData.length, itemBuilder: (BuildContext context, int index) { return InkWell( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(top: 16.0), - child: Material( - elevation: 14.0, - borderRadius: BorderRadius.circular(12.0), - shadowColor: globals.isDarkTheme - ? Colors.grey[700] - : Color(0x802196F3), - color: - globals.isDarkTheme ? Colors.grey[850] : Colors.white, - child: InkWell( - onTap: () { - var route = new MaterialPageRoute( - builder: (BuildContext context) => - new AdminActionServerPage( - server: Admin( - adminid: userData[index]["attributes"]["id"].toString(), - adminname: userData[index]["attributes"]["name"], - adminuser: userData[index]["attributes"]["user"].toString(), - admindescription: userData[index]["attributes"]["description"], - adminmemory: userData[index]["attributes"]["limits"]["memory"].toString(), - admindisk: userData[index]["attributes"]["limits"]["disk"].toString(), - admincpu: userData[index]["attributes"]["limits"]["cpu"].toString(), - adminstartupcommand: userData[index]["attributes"]["container"]["startup_command"], + child: Padding( + padding: EdgeInsets.only(bottom: 16.0), + child: Stack( + children: [ + /// Item card + Align( + alignment: Alignment.topCenter, + child: SizedBox.fromSize( + size: Size.fromHeight(140.0), + child: Stack( + fit: StackFit.expand, + children: [ + /// Item description inside a material + Container( + margin: EdgeInsets.only(top: 24.0), + child: Material( + elevation: 14.0, + borderRadius: BorderRadius.circular(12.0), + shadowColor: globals.isDarkTheme + ? Colors.grey[700] + : Color(0x802196F3), + child: InkWell( + onTap: () { + var route = new MaterialPageRoute( + builder: (BuildContext context) => + new AdminActionServerPage( + server: Admin( + adminid: userData[index]["attributes"] + ["id"] + .toString(), + adminname: userData[index] + ["attributes"]["name"], + adminuser: userData[index] + ["attributes"]["user"] + .toString(), + admindescription: userData[index] + ["attributes"]["description"], + adminmemory: userData[index] + ["attributes"]["limits"] + ["memory"] + .toString(), + admindisk: userData[index] + ["attributes"]["limits"] + ["disk"] + .toString(), + admincpu: userData[index] + ["attributes"]["limits"] + ["cpu"] + .toString(), + adminstartupcommand: userData[index] + ["attributes"]["container"] + ["startup_command"], )), - ); - Navigator.of(context).push(route); - }, - child: Padding( - padding: EdgeInsets.all(30.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - /// Title and rating - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '${userData[index]["attributes"]["description"]}', - style: - TextStyle(color: Colors.blueAccent)), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Text( - '${userData[index]["attributes"]["name"]}', - style: TextStyle( - color: globals.isDarkTheme - ? Colors.white - : Colors.black, - fontWeight: FontWeight.w700, - fontSize: 18.0)), - ], - ), - ], - ), + ); + Navigator.of(context).push(route); + }, + child: Container( + child: Padding( + padding: EdgeInsets.all(24.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + /// Title and rating + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + '${userData[index]["attributes"]["description"]}', + style: TextStyle( + color: Colors.blueAccent)), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + '${userData[index]["attributes"]["name"]}', + style: TextStyle( + color: + globals.isDarkTheme + ? Colors.white + : Colors.black, + fontWeight: + FontWeight.w700, + fontSize: 18.0)), + ], + ), + ], + ), - /// Infos - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - DemoLocalizations.of(context) - .trans('total_ram'), - style: TextStyle( - color: globals.isDarkTheme - ? Colors.white - : Colors.black, - )), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 4.0), - child: Material( - borderRadius: BorderRadius.circular(8.0), - color: Colors.green, - child: Padding( - padding: EdgeInsets.all(4.0), - child: Text( - '${userData[index]["attributes"]["limits"]["memory"]} MB', - style: TextStyle( - fontWeight: FontWeight.w700, - color: Colors.white)), - ), + /// Infos + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + DemoLocalizations.of(context) + .trans('total_ram'), + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + )), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 4.0), + child: Material( + borderRadius: + BorderRadius.circular(8.0), + color: Colors.green, + child: Padding( + padding: EdgeInsets.all(4.0), + child: Text( + '${userData[index]["attributes"]["limits"]["memory"]} MB', + style: TextStyle( + fontWeight: + FontWeight.w700, + color: Colors.white)), + ), + ), + ), + Text( + DemoLocalizations.of(context) + .trans('total_disk'), + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + )), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 4.0), + child: Material( + borderRadius: + BorderRadius.circular(8.0), + color: Colors.green, + child: Padding( + padding: EdgeInsets.all(4.0), + child: Text( + '${userData[index]["attributes"]["limits"]["disk"]} MB', + style: TextStyle( + fontWeight: + FontWeight.w700, + color: Colors.white)), + ), + ), + ), + ], + ), + ], ), ), - Text( - DemoLocalizations.of(context) - .trans('total_disk'), - style: TextStyle( - color: globals.isDarkTheme - ? Colors.white - : Colors.black, - )), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 4.0), - child: Material( - borderRadius: BorderRadius.circular(8.0), - color: Colors.green, - child: Padding( - padding: EdgeInsets.all(4.0), - child: Text( - '${userData[index]["attributes"]["limits"]["disk"]} MB', - style: TextStyle( - fontWeight: FontWeight.w700, - color: Colors.white)), - ), - ), - ), - ], + ), ), - ], - ), - ), - ), - ), - ), - ], - ), + ), + ) + ], + )), + ), + ], ), - ); + )); }, ), ); diff --git a/lib/page/admin/adminusers.dart b/lib/page/admin/adminusers.dart index 59c62d0..2ff59d2 100644 --- a/lib/page/admin/adminusers.dart +++ b/lib/page/admin/adminusers.dart @@ -81,148 +81,177 @@ class _AdminUsersListPageState extends State { itemCount: userData == null ? 0 : userData.length, itemBuilder: (BuildContext context, int index) { return InkWell( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(top: 16.0), - child: Material( - elevation: 14.0, - borderRadius: BorderRadius.circular(12.0), - shadowColor: globals.isDarkTheme - ? Colors.grey[700] - : Color(0x802196F3), - color: - globals.isDarkTheme ? Colors.grey[850] : Colors.white, - child: InkWell( - onTap: () { - var route = new MaterialPageRoute( - builder: (BuildContext context) => - new AdminUserInfoPage( - server: Admin( - adminid: userData[index]["attributes"] - ["id"] - .toString(), - username: userData[index]["attributes"] - ["username"])), - ); - Navigator.of(context).push(route); - }, - child: Padding( - padding: EdgeInsets.all(30.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - /// Title and rating - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '${userData[index]["attributes"]["first_name"]} ${userData[index]["attributes"]["last_name"]}', - style: TextStyle( - color: globals.isDarkTheme - ? Colors.white - : Colors.black, - fontWeight: FontWeight.w700, - fontSize: 18.0)), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Text( - '${userData[index]["attributes"]["email"]}', - style: TextStyle( - color: Colors.blueAccent, - fontWeight: FontWeight.w700, - fontSize: 14.0)), - ], - ), - ], - ), + child: Padding( + padding: EdgeInsets.only(bottom: 16.0), + child: Stack( + children: [ + /// Item card + Align( + alignment: Alignment.topCenter, + child: SizedBox.fromSize( + size: Size.fromHeight(140.0), + child: Stack( + fit: StackFit.expand, + children: [ + /// Item description inside a material + Container( + margin: EdgeInsets.only(top: 24.0), + child: Material( + elevation: 14.0, + borderRadius: BorderRadius.circular(12.0), + shadowColor: globals.isDarkTheme + ? Colors.grey[700] + : Color(0x802196F3), + child: InkWell( + onTap: () { + var route = new MaterialPageRoute( + builder: (BuildContext context) => + new AdminUserInfoPage( + server: Admin( + adminid: userData[index] + ["attributes"]["id"] + .toString(), + username: userData[index] + ["attributes"] + ["username"])), + ); + Navigator.of(context).push(route); + }, + child: Container( + child: Padding( + padding: EdgeInsets.all(24.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + /// Title and rating + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + '${userData[index]["attributes"]["first_name"]} ${userData[index]["attributes"]["last_name"]}', + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + fontWeight: FontWeight.w700, + fontSize: 20.0)), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + '${userData[index]["attributes"]["email"]}', + style: TextStyle( + color: + Colors.blueAccent, + fontWeight: + FontWeight.w700, + fontSize: 18.0)), + ], + ), + ], + ), - /// Infos - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text('Superuser', - style: TextStyle( - color: globals.isDarkTheme - ? Colors.white - : Colors.black, - )), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 4.0), - child: Material( - borderRadius: BorderRadius.circular(8.0), - color: - "${userData[index]["attributes"]["root_admin"]}" == - "true" - ? Colors.green - : Colors.blue, - child: Padding( - padding: EdgeInsets.all(4.0), - child: Text( - '${userData[index]["attributes"]["root_admin"]}' == - "true" - ? DemoLocalizations.of(context) - .trans('yes') - : DemoLocalizations.of(context) - .trans('no'), - style: TextStyle( - fontWeight: FontWeight.w700, - color: Colors.white)), - ), + /// Infos + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text('Superuser', + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + )), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 4.0), + child: Material( + borderRadius: + BorderRadius.circular(8.0), + color: + "${userData[index]["attributes"]["root_admin"]}" == + "true" + ? Colors.green + : Colors.blue, + child: Padding( + padding: EdgeInsets.all(4.0), + child: Text( + '${userData[index]["attributes"]["root_admin"]}' == + "true" + ? DemoLocalizations + .of(context) + .trans('yes') + : DemoLocalizations + .of(context) + .trans('no'), + style: TextStyle( + fontWeight: + FontWeight.w700, + color: Colors.white)), + ), + ), + ), + Text('2FA', + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + )), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 4.0), + child: Material( + borderRadius: + BorderRadius.circular(8.0), + color: + "${userData[index]["attributes"]["2fa"]}" == + "true" + ? Colors.green + : Colors.red, + child: Padding( + padding: EdgeInsets.all(4.0), + child: Text( + '${userData[index]["attributes"]["2fa"]}' == + "true" + ? DemoLocalizations + .of(context) + .trans('yes') + : DemoLocalizations + .of(context) + .trans('no'), + style: TextStyle( + fontWeight: + FontWeight.w700, + color: Colors.white)), + ), + ), + ), + ], + ), + ], ), ), - Text('2FA', - style: TextStyle( - color: globals.isDarkTheme - ? Colors.white - : Colors.black, - )), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 4.0), - child: Material( - borderRadius: BorderRadius.circular(8.0), - color: - "${userData[index]["attributes"]["2fa"]}" == - "true" - ? Colors.green - : Colors.red, - child: Padding( - padding: EdgeInsets.all(4.0), - child: Text( - '${userData[index]["attributes"]["2fa"]}' == - "true" - ? DemoLocalizations.of(context) - .trans('yes') - : DemoLocalizations.of(context) - .trans('no'), - style: TextStyle( - fontWeight: FontWeight.w700, - color: Colors.white)), - ), - ), - ), - ], + ), ), - ], - ), - ), - ), - ), - ), - ], - ), + ), + ) + ], + )), + ), + ], ), - ); + )); }, ), floatingActionButton: FloatingActionButton.extended( diff --git a/lib/page/client/servers.dart b/lib/page/client/servers.dart index d05b70f..f343e61 100644 --- a/lib/page/client/servers.dart +++ b/lib/page/client/servers.dart @@ -69,132 +69,159 @@ class _ServerListPageState extends State { itemCount: userData == null ? 0 : userData.length, itemBuilder: (BuildContext context, int index) { return InkWell( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(top: 16.0), - child: Material( - elevation: 14.0, - borderRadius: BorderRadius.circular(12.0), - shadowColor: globals.isDarkTheme - ? Colors.grey[700] - : Color(0x802196F3), - color: - globals.isDarkTheme ? Colors.grey[850] : Colors.white, - child: InkWell( - onTap: () { - var route = new MaterialPageRoute( - builder: (BuildContext context) => - new ActionServerPage( - server: User( - id: - userData[index]["attributes"] - ["identifier"], - name: userData[index]["attributes"] - ["name"])), - ); - Navigator.of(context).push(route); - }, - child: Padding( - padding: EdgeInsets.all(30.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - /// Title and rating - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '${userData[index]["attributes"]["description"]}', - style: - TextStyle(color: Colors.blueAccent)), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Text( - '${userData[index]["attributes"]["name"]}', - style: TextStyle( - color: globals.isDarkTheme - ? Colors.white - : Colors.black, - fontWeight: FontWeight.w700, - fontSize: 18.0)), - ], - ), - ], - ), - - /// Infos - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - DemoLocalizations.of(context) - .trans('total_ram'), - style: TextStyle( - color: globals.isDarkTheme - ? Colors.white - : Colors.black, - )), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 4.0), - child: Material( - borderRadius: BorderRadius.circular(8.0), - color: Colors.green, - child: Padding( - padding: EdgeInsets.all(4.0), - child: Text( - '${userData[index]["attributes"]["limits"]["memory"]} MB', - style: TextStyle( - fontWeight: FontWeight.w700, - color: Colors.white)), - ), - ), - ), - Text( - DemoLocalizations.of(context) - .trans('total_disk'), - style: TextStyle( - color: globals.isDarkTheme - ? Colors.white - : Colors.black, - )), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 4.0), - child: Material( - borderRadius: BorderRadius.circular(8.0), - color: Colors.green, - child: Padding( - padding: EdgeInsets.all(4.0), - child: Text( - '${userData[index]["attributes"]["limits"]["disk"]} MB', - style: TextStyle( - fontWeight: FontWeight.w700, - color: Colors.white)), - ), + child: Padding( + padding: EdgeInsets.only(bottom: 16.0), + child: Stack( + children: [ + /// Item card + Align( + alignment: Alignment.topCenter, + child: SizedBox.fromSize( + size: Size.fromHeight(172.0), + child: Stack( + fit: StackFit.expand, + children: [ + /// Item description inside a material + Container( + margin: EdgeInsets.only(top: 24.0), + child: Material( + elevation: 14.0, + borderRadius: BorderRadius.circular(12.0), + shadowColor: globals.isDarkTheme + ? Colors.grey[700] + : Color(0x802196F3), + child: InkWell( + onTap: () { + var route = new MaterialPageRoute( + builder: (BuildContext context) => + new ActionServerPage( + server: User( + id: userData[index] + ["attributes"] + ["identifier"], + name: userData[index] + ["attributes"]["name"])), + ); + Navigator.of(context).push(route); + }, + child: Container( + child: Padding( + padding: EdgeInsets.all(24.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + /// Title and rating + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + '${userData[index]["attributes"]["description"]}', + style: TextStyle( + color: Colors.blueAccent)), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + '${userData[index]["attributes"]["name"]}', + style: TextStyle( + fontWeight: + FontWeight.w700, + fontSize: 18.0)), + ], + ), + ], + ), +//info + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + DemoLocalizations.of(context) + .trans('total_ram'), + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + )), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 4.0), + child: Material( + borderRadius: + BorderRadius.circular(8.0), + color: Colors.green, + child: Padding( + padding: EdgeInsets.all(4.0), + child: Text( + '${userData[index]["attributes"]["limits"]["memory"]} MB', + style: TextStyle( + fontWeight: + FontWeight.w700, + color: Colors.white)), + ), + ), + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + DemoLocalizations.of(context) + .trans('total_disk'), + style: TextStyle( + color: globals.isDarkTheme + ? Colors.white + : Colors.black, + )), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 4.0), + child: Material( + borderRadius: + BorderRadius.circular(8.0), + color: Colors.green, + child: Padding( + padding: EdgeInsets.all(4.0), + child: Text( + '${userData[index]["attributes"]["limits"]["disk"]} MB', + style: TextStyle( + fontWeight: + FontWeight.w700, + color: Colors.white)), + ), + ), + ), + ], + ), + ], ), ), - ], + ), ), - ], - ), - ), - ), - ), - ), - ], - ), + ), + ) + ], + )), + ), + ], ), - ); + )); }, ), ); From d6bedaa18ea496707ab8d22633e4664580a08836 Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Tue, 21 May 2019 23:20:34 -0300 Subject: [PATCH 39/44] Update servers.dart --- lib/page/client/servers.dart | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/page/client/servers.dart b/lib/page/client/servers.dart index f343e61..0a25992 100644 --- a/lib/page/client/servers.dart +++ b/lib/page/client/servers.dart @@ -64,6 +64,18 @@ class _ServerListPageState extends State { style: TextStyle( color: globals.isDarkTheme ? null : Colors.black, fontWeight: FontWeight.w700)), + actions: [ + Container( + margin: EdgeInsets.only(right: 8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + IconButton(icon: Icon(Icons.search), onPressed: () {}) + ], + ), + ) + ], ), body: ListView.builder( itemCount: userData == null ? 0 : userData.length, @@ -77,11 +89,10 @@ class _ServerListPageState extends State { Align( alignment: Alignment.topCenter, child: SizedBox.fromSize( - size: Size.fromHeight(172.0), + size: Size.fromHeight(140.0), child: Stack( fit: StackFit.expand, children: [ - /// Item description inside a material Container( margin: EdgeInsets.only(top: 24.0), child: Material( @@ -140,7 +151,7 @@ class _ServerListPageState extends State { ), ], ), -//info + Row( mainAxisAlignment: MainAxisAlignment.start, @@ -173,14 +184,6 @@ class _ServerListPageState extends State { ), ), ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ Text( DemoLocalizations.of(context) .trans('total_disk'), From 8b1e67c843e7be9fe06aa72cc8807d580e4e2386 Mon Sep 17 00:00:00 2001 From: Vilhelm Prytz Date: Wed, 22 May 2019 16:00:00 +0200 Subject: [PATCH 40/44] Update the swedish translation --- assets/lang/se_SE.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/lang/se_SE.json b/assets/lang/se_SE.json index 8038c7e..5c03e91 100644 --- a/assets/lang/se_SE.json +++ b/assets/lang/se_SE.json @@ -102,11 +102,11 @@ "2fa": "2FA", "created_at": "Skapades:", "updated_at": "Uppdaterades:", - "admin_actionserver_view_server_info": "View Server info", - "admin_actionserver_edit_server_info": "Edit Server info", + "admin_actionserver_view_server_info": "Visa serverinfo", + "admin_actionserver_edit_server_info": "Redigera serverinfo", "utilization_stats_offline": "Offline", - "utilization_stats_online": "Server is online", - "utilization_stats_starting": "Server is starting", - "utilization_stats_stopping": "Server is stopping", - "utilization_stats_Loading": "Retrieving data" + "utilization_stats_online": "Online", + "utilization_stats_starting": "Servern startar", + "utilization_stats_stopping": "Servern stängs av", + "utilization_stats_Loading": "Hämtar data" } From 030f88206e9e1532e835f468c4672b7268285451 Mon Sep 17 00:00:00 2001 From: Ruben Talstra Date: Wed, 22 May 2019 13:00:46 -0300 Subject: [PATCH 41/44] Update README.md --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index d3a9eb8..0d47325 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ Admin panel This project was made possible by everyone who contributed to this project. [CREDITS](https://github.com/rubentalstra/Pterodactyl-app/blob/master/CREDITS.md) +### :heart: Found this project useful? +If you found this project useful, then please consider giving it a :star: on Github and sharing it with your friends via social media. + ### Currently available on the Play store. @@ -61,3 +64,20 @@ Project Board: [click here](https://trello.com/b/YqCe05Vl/pterodactyl-app) flutter build appbundle --release --target-platform=android-arm flutter build appbundle --release --target-platform=android-arm64 ``` + +License +------- + + Copyright 2018 Ruben Talstra + + Licensed under the GNU General Public License v3.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.gnu.org/licenses/gpl-3.0.en.html + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From c951d6e35071d4692fbb3cfdfa96e222b4c9bc6a Mon Sep 17 00:00:00 2001 From: Ruben Talstra Date: Wed, 22 May 2019 13:33:42 -0300 Subject: [PATCH 42/44] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 0d47325..ff002d9 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,12 @@ If you found this project useful, then please consider giving it a :star: on Git V1.0 may 6 '19 - Original Release +# Donate + +> If you found this project helpful or you learned something from the source code and want to thank me, consider buying me a cup of :coffee: +> +> - [PayPal](https://www.paypal.me/RDTalstra) + ### License From 4b313ad4220debec953c145fb22c8eeaf11e9478 Mon Sep 17 00:00:00 2001 From: Ruben Talstra Date: Wed, 22 May 2019 14:11:14 -0300 Subject: [PATCH 43/44] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ff002d9..113f57b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Pterodactyl Mobile App 🚀 +[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://opensource.org/licenses/gpl-3.0) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/RDTalstra) Patreon donate button [![Codemagic build status](https://api.codemagic.io/apps/5ccaf2ab80113f001c2e4176/5ccaf2ab80113f001c2e4175/status_badge.svg)](https://codemagic.io/apps/5ccaf2ab80113f001c2e4176/5ccaf2ab80113f001c2e4175/latest_build) @@ -80,7 +81,7 @@ License you may not use this file except in compliance with the License. You may obtain a copy of the License at - https://www.gnu.org/licenses/gpl-3.0.en.html + https://www.gnu.org/licenses/gpl-3.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, From c6f1d2e42bde0261e15641259b31d6b2ecd9c526 Mon Sep 17 00:00:00 2001 From: rubentalstra Date: Wed, 22 May 2019 14:58:44 -0300 Subject: [PATCH 44/44] omg big update. there will be an new version in het play store v3.0.0 --- android/app/build.gradle | 2 +- lib/page/admin/admincreateserver.dart | 201 ++++++++++++++++++++++++++ lib/page/admin/adminservers.dart | 11 ++ pubspec.yaml | 2 +- 4 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 lib/page/admin/admincreateserver.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index d9ec251..1b73973 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -13,7 +13,7 @@ if (flutterRoot == null) { def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { - flutterVersionCode = '37' + flutterVersionCode = '38' } def flutterVersionName = localProperties.getProperty('flutter.versionName') diff --git a/lib/page/admin/admincreateserver.dart b/lib/page/admin/admincreateserver.dart new file mode 100644 index 0000000..7e83a1f --- /dev/null +++ b/lib/page/admin/admincreateserver.dart @@ -0,0 +1,201 @@ +import 'package:flutter/material.dart'; +import '../auth/shared_preferences_helper.dart'; +import 'package:http/http.dart' as http; +import '../../globals.dart' as globals; +import 'dart:async'; +import 'dart:convert'; +import '../../main.dart'; + +class AdminCreateServerPage extends StatefulWidget { + @override + _AdminCreateServerPageState createState() => new _AdminCreateServerPageState(); +} + +class _AdminCreateServerPageState extends State { + final _usernameController = TextEditingController(); + final _emailController = TextEditingController(); + final _firstnameController = TextEditingController(); + final _lastnameController = TextEditingController(); + final _passwordController = TextEditingController(); + + Future postSend() async { + //-----create---// + String _usermane = await SharedPreferencesHelper.getString("username"); + String _email = await SharedPreferencesHelper.getString("email"); + String _firstname = await SharedPreferencesHelper.getString("first_name"); + String _lastname = await SharedPreferencesHelper.getString("last_name"); + String _password = await SharedPreferencesHelper.getString("password"); + //-----login----// + String _apiadmin = await SharedPreferencesHelper.getString("apiAdminKey"); + String _urladmin = await SharedPreferencesHelper.getString("panelAdminUrl"); + String _adminhttps = await SharedPreferencesHelper.getString("adminhttps"); + var url = '$_adminhttps$_urladmin/api/application/users'; + + Map data = { + "username": "$_usermane", + "email": "$_email", + "first_name": "$_firstname", + "last_name": "$_lastname", + "password": "$_password" + }; + //encode Map to JSON + var body = json.encode(data); + + var response = await http.post(url, + headers: { + "Accept": "Application/vnd.pterodactyl.v1+json", + "Content-Type": "application/json", + "Authorization": "Bearer $_apiadmin" + }, + body: body); + print("${response.statusCode}"); + print("${response.body}"); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + elevation: 0.0, + backgroundColor: globals.isDarkTheme ? null : Colors.transparent, + leading: IconButton( + color: globals.isDarkTheme ? Colors.white : Colors.black, + onPressed: () { + Navigator.of(context).pop(); + SharedPreferencesHelper.remove("username"); + SharedPreferencesHelper.remove("email"); + SharedPreferencesHelper.remove("first_name"); + SharedPreferencesHelper.remove("last_name"); + SharedPreferencesHelper.remove("password"); + }, + icon: Icon(Icons.arrow_back, + color: globals.isDarkTheme ? Colors.white : Colors.black), + ), + title: Text( + DemoLocalizations.of(context).trans('admin_create_user_title'), + style: TextStyle( + color: globals.isDarkTheme ? Colors.white : Colors.black, + fontWeight: FontWeight.w700)), + ), + body: SafeArea( + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 24.0), + children: [ + SizedBox(height: 20.0), + AccentColorOverride( + color: Colors.red, + child: TextField( + controller: _usernameController, + decoration: InputDecoration( + labelText: ('username'), + ), + ), + ), + SizedBox(height: 12.0), + AccentColorOverride( + color: Colors.red, + child: TextField( + controller: _emailController, + decoration: InputDecoration( + labelText: ('email'), + ), + ), + ), + SizedBox(height: 12.0), + AccentColorOverride( + color: Colors.red, + child: TextField( + controller: _firstnameController, + decoration: InputDecoration( + labelText: ('first name'), + ), + ), + ), + SizedBox(height: 12.0), + AccentColorOverride( + color: Colors.red, + child: TextField( + controller: _lastnameController, + decoration: InputDecoration( + labelText: ('last name'), + ), + ), + ), + SizedBox(height: 12.0), + AccentColorOverride( + color: Colors.red, + child: TextField( + controller: _passwordController, + decoration: InputDecoration( + labelText: ('password'), + ), + ), + ), + ButtonBar( + children: [ + FlatButton( + child: Text('Clear'), + shape: BeveledRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(7.0)), + ), + onPressed: () { + _usernameController.clear(); + _emailController.clear(); + _firstnameController.clear(); + _lastnameController.clear(); + _passwordController.clear(); + SharedPreferencesHelper.remove("username"); + SharedPreferencesHelper.remove("email"); + SharedPreferencesHelper.remove("first_name"); + SharedPreferencesHelper.remove("last_name"); + SharedPreferencesHelper.remove("password"); + }, + ), + RaisedButton( + child: Text(DemoLocalizations.of(context) + .trans('admin_create_user_create_a_user')), + elevation: 8.0, + shape: BeveledRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(7.0)), + ), + onPressed: () async { + await SharedPreferencesHelper.setString( + "username", _usernameController.text); + await SharedPreferencesHelper.setString( + "email", _emailController.text); + await SharedPreferencesHelper.setString( + "first_name", _firstnameController.text); + await SharedPreferencesHelper.setString( + "last_name", _lastnameController.text); + await SharedPreferencesHelper.setString( + "password", _passwordController.text); + postSend(); + }, + ), + ], + ), + ], + ), + ), + ); + } +} + +class AccentColorOverride extends StatelessWidget { + const AccentColorOverride({Key key, this.color, this.child}) + : super(key: key); + + final Color color; + final Widget child; + + @override + Widget build(BuildContext context) { + return Theme( + child: child, + data: Theme.of(context).copyWith( + accentColor: color, + brightness: Brightness.dark, + ), + ); + } +} \ No newline at end of file diff --git a/lib/page/admin/adminservers.dart b/lib/page/admin/adminservers.dart index 17f7049..3669059 100644 --- a/lib/page/admin/adminservers.dart +++ b/lib/page/admin/adminservers.dart @@ -6,6 +6,7 @@ import 'dart:async'; import 'dart:convert'; import '../../main.dart'; import 'adminactionserver.dart'; +import 'admincreateserver.dart'; class Admin { final String adminid, @@ -269,6 +270,16 @@ class _AdminServerListPageState extends State { )); }, ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () { + /* + Navigator.of(context) + .push(MaterialPageRoute(builder: (_) => AdminCreateServerPage())); + */ + }, + icon: Icon(Icons.add), + label: Text("Server"), + ), ); } } diff --git a/pubspec.yaml b/pubspec.yaml index a914288..8db98f3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A Pterodactyl Mobile App. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 2.6.6+37 +version: 3.0.0+38 authors: - Ruben Talstra - Arnaud Lier