add endpoint for general stats

load build data to graph
redesign top info tiles
place add button on header
folder restructure
This commit is contained in:
2023-12-30 00:45:33 +01:00
parent ce7a260760
commit 600c2057fe
38 changed files with 563 additions and 886 deletions

View File

@ -1,4 +1,4 @@
import '../core/models/build.dart';
import '../models/build.dart';
import 'api_client.dart';
extension BuildsAPI on ApiClient {
@ -7,7 +7,7 @@ extension BuildsAPI on ApiClient {
final responseObject = resp.data as List;
final List<Build> packages =
responseObject.map((e) => Build.fromJson(e)).toList(growable: false);
responseObject.map((e) => Build.fromJson(e)).toList(growable: false);
return packages;
}
}

View File

@ -1,4 +1,4 @@
import '../core/models/package.dart';
import '../models/package.dart';
import 'api_client.dart';
extension PackagesAPI on ApiClient {
@ -15,8 +15,8 @@ extension PackagesAPI on ApiClient {
}
Future<void> addPackage({bool force = false, required String name}) async {
final resp = await getRawClient().post("/packages/add", data: {'force_build': force, 'name': name});
final resp = await getRawClient()
.post("/packages/add", data: {'force_build': force, 'name': name});
print(resp.data);
}
}

View File

@ -0,0 +1,9 @@
import '../models/stats.dart';
import 'api_client.dart';
extension StatsAPI on ApiClient {
Future<Stats> listStats() async {
final resp = await getRawClient().get("/stats");
return Stats.fromJson(resp.data);
}
}