mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-04 23:24:20 +00:00
feat(ui): Make Snapshot List page show fab button
- Resolve https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/issues/290
This commit is contained in:
commit
5a33bec6bd
|
@ -103,7 +103,7 @@ class BackblazeApi extends RestApiMap {
|
||||||
} else {
|
} else {
|
||||||
throw Exception('code: ${response.statusCode}');
|
throw Exception('code: ${response.statusCode}');
|
||||||
}
|
}
|
||||||
} on DioException catch (e) {
|
} on DioError catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
return GenericResult(
|
return GenericResult(
|
||||||
data: false,
|
data: false,
|
||||||
|
|
|
@ -144,7 +144,7 @@ class CloudflareApi extends RestApiMap {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
await Future.wait(allCreateFutures);
|
await Future.wait(allCreateFutures);
|
||||||
} on DioException catch (e) {
|
} on DioError catch (e) {
|
||||||
print(e.message);
|
print(e.message);
|
||||||
rethrow;
|
rethrow;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -133,7 +133,7 @@ class DigitalOceanDnsApi extends RestApiMap {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
await Future.wait(allCreateFutures);
|
await Future.wait(allCreateFutures);
|
||||||
} on DioException catch (e) {
|
} on DioError catch (e) {
|
||||||
print(e.message);
|
print(e.message);
|
||||||
rethrow;
|
rethrow;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -15,8 +15,8 @@ abstract class RestApiMap {
|
||||||
dio.interceptors.add(PrettyDioLogger());
|
dio.interceptors.add(PrettyDioLogger());
|
||||||
}
|
}
|
||||||
dio.interceptors.add(ConsoleInterceptor());
|
dio.interceptors.add(ConsoleInterceptor());
|
||||||
(dio.httpClientAdapter as IOHttpClientAdapter).createHttpClient = () {
|
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
|
||||||
final HttpClient client = HttpClient();
|
(final HttpClient client) {
|
||||||
client.badCertificateCallback =
|
client.badCertificateCallback =
|
||||||
(final X509Certificate cert, final String host, final int port) =>
|
(final X509Certificate cert, final String host, final int port) =>
|
||||||
true;
|
true;
|
||||||
|
@ -25,7 +25,7 @@ abstract class RestApiMap {
|
||||||
|
|
||||||
dio.interceptors.add(
|
dio.interceptors.add(
|
||||||
InterceptorsWrapper(
|
InterceptorsWrapper(
|
||||||
onError: (final DioException e, final ErrorInterceptorHandler handler) {
|
onError: (final DioError e, final ErrorInterceptorHandler handler) {
|
||||||
print(e.requestOptions.path);
|
print(e.requestOptions.path);
|
||||||
print(e.requestOptions.data);
|
print(e.requestOptions.data);
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class ConsoleInterceptor extends InterceptorsWrapper {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> onError(
|
Future<void> onError(
|
||||||
final DioException err,
|
final DioError err,
|
||||||
final ErrorInterceptorHandler handler,
|
final ErrorInterceptorHandler handler,
|
||||||
) async {
|
) async {
|
||||||
final Response? response = err.response;
|
final Response? response = err.response;
|
||||||
|
|
|
@ -87,7 +87,7 @@ class HetznerApi extends RestApiMap {
|
||||||
final String stagingAcme = TlsOptions.stagingAcme ? 'true' : 'false';
|
final String stagingAcme = TlsOptions.stagingAcme ? 'true' : 'false';
|
||||||
Response? serverCreateResponse;
|
Response? serverCreateResponse;
|
||||||
HetznerServerInfo? serverInfo;
|
HetznerServerInfo? serverInfo;
|
||||||
DioException? hetznerError;
|
DioError? hetznerError;
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
|
@ -117,7 +117,7 @@ class HetznerApi extends RestApiMap {
|
||||||
serverCreateResponse.data['server'],
|
serverCreateResponse.data['server'],
|
||||||
);
|
);
|
||||||
success = true;
|
success = true;
|
||||||
} on DioException catch (e) {
|
} on DioError catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
hetznerError = e;
|
hetznerError = e;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -31,6 +31,7 @@ class BackupsListPage extends StatelessWidget {
|
||||||
context.watch<BackupsCubit>().state.preventActions;
|
context.watch<BackupsCubit>().state.preventActions;
|
||||||
return BrandHeroScreen(
|
return BrandHeroScreen(
|
||||||
heroTitle: 'backup.snapshots_title'.tr(),
|
heroTitle: 'backup.snapshots_title'.tr(),
|
||||||
|
hasFlashButton: true,
|
||||||
children: [
|
children: [
|
||||||
if (backups.isEmpty)
|
if (backups.isEmpty)
|
||||||
Center(
|
Center(
|
||||||
|
|
|
@ -65,7 +65,7 @@ class CpuChart extends StatelessWidget {
|
||||||
isCurved: false,
|
isCurved: false,
|
||||||
barWidth: 2,
|
barWidth: 2,
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
dotData: const FlDotData(
|
dotData: FlDotData(
|
||||||
show: false,
|
show: false,
|
||||||
),
|
),
|
||||||
belowBarData: BarAreaData(
|
belowBarData: BarAreaData(
|
||||||
|
@ -86,7 +86,7 @@ class CpuChart extends StatelessWidget {
|
||||||
maxY: 100,
|
maxY: 100,
|
||||||
minX: 0,
|
minX: 0,
|
||||||
titlesData: FlTitlesData(
|
titlesData: FlTitlesData(
|
||||||
topTitles: const AxisTitles(
|
topTitles: AxisTitles(
|
||||||
sideTitles: SideTitles(showTitles: false),
|
sideTitles: SideTitles(showTitles: false),
|
||||||
),
|
),
|
||||||
bottomTitles: AxisTitles(
|
bottomTitles: AxisTitles(
|
||||||
|
@ -109,12 +109,12 @@ class CpuChart extends StatelessWidget {
|
||||||
showTitles: true,
|
showTitles: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
leftTitles: const AxisTitles(
|
leftTitles: AxisTitles(
|
||||||
sideTitles: SideTitles(
|
sideTitles: SideTitles(
|
||||||
showTitles: false,
|
showTitles: false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
rightTitles: const AxisTitles(
|
rightTitles: AxisTitles(
|
||||||
sideTitles: SideTitles(
|
sideTitles: SideTitles(
|
||||||
showTitles: false,
|
showTitles: false,
|
||||||
),
|
),
|
||||||
|
|
|
@ -73,7 +73,7 @@ class NetworkChart extends StatelessWidget {
|
||||||
isCurved: false,
|
isCurved: false,
|
||||||
barWidth: 2,
|
barWidth: 2,
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
dotData: const FlDotData(
|
dotData: FlDotData(
|
||||||
show: false,
|
show: false,
|
||||||
),
|
),
|
||||||
belowBarData: BarAreaData(
|
belowBarData: BarAreaData(
|
||||||
|
@ -94,7 +94,7 @@ class NetworkChart extends StatelessWidget {
|
||||||
isCurved: false,
|
isCurved: false,
|
||||||
barWidth: 2,
|
barWidth: 2,
|
||||||
color: Theme.of(context).colorScheme.tertiary,
|
color: Theme.of(context).colorScheme.tertiary,
|
||||||
dotData: const FlDotData(
|
dotData: FlDotData(
|
||||||
show: false,
|
show: false,
|
||||||
),
|
),
|
||||||
belowBarData: BarAreaData(
|
belowBarData: BarAreaData(
|
||||||
|
@ -118,7 +118,7 @@ class NetworkChart extends StatelessWidget {
|
||||||
1.2,
|
1.2,
|
||||||
minX: 0,
|
minX: 0,
|
||||||
titlesData: FlTitlesData(
|
titlesData: FlTitlesData(
|
||||||
topTitles: const AxisTitles(
|
topTitles: AxisTitles(
|
||||||
sideTitles: SideTitles(showTitles: false),
|
sideTitles: SideTitles(showTitles: false),
|
||||||
),
|
),
|
||||||
bottomTitles: AxisTitles(
|
bottomTitles: AxisTitles(
|
||||||
|
@ -141,7 +141,7 @@ class NetworkChart extends StatelessWidget {
|
||||||
showTitles: true,
|
showTitles: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
leftTitles: const AxisTitles(
|
leftTitles: AxisTitles(
|
||||||
sideTitles: SideTitles(showTitles: false),
|
sideTitles: SideTitles(showTitles: false),
|
||||||
),
|
),
|
||||||
rightTitles: AxisTitles(
|
rightTitles: AxisTitles(
|
||||||
|
|
Loading…
Reference in a new issue