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:
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
9
frontend/lib/api/statistics.dart
Normal file
9
frontend/lib/api/statistics.dart
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user