set pkg to build state when already existing and starting build
add active builds to right cake graph
This commit is contained in:
@ -6,10 +6,12 @@ class BuildsChart extends StatefulWidget {
|
||||
Key? key,
|
||||
required this.nrbuilds,
|
||||
required this.nrfailedbuilds,
|
||||
required this.nrActiveBuilds,
|
||||
}) : super(key: key);
|
||||
|
||||
final int nrbuilds;
|
||||
final int nrfailedbuilds;
|
||||
final int nrActiveBuilds;
|
||||
|
||||
@override
|
||||
_BuildsChartState createState() => _BuildsChartState();
|
||||
@ -36,6 +38,7 @@ class _BuildsChartState extends State<BuildsChart> {
|
||||
pieTouchData: PieTouchData(
|
||||
touchCallback: (pieTouchResponse, touchresponse) {
|
||||
setState(() {
|
||||
// todo hover gesture not working properly
|
||||
if (touchresponse?.touchedSection != null) {
|
||||
touchedIndex = touchresponse!
|
||||
.touchedSection!.touchedSectionIndex;
|
||||
@ -63,7 +66,7 @@ class _BuildsChartState extends State<BuildsChart> {
|
||||
}
|
||||
|
||||
List<PieChartSectionData> showingSections() {
|
||||
return List.generate(2, (i) {
|
||||
return List.generate(3, (i) {
|
||||
final isTouched = i == touchedIndex;
|
||||
final fontSize = isTouched ? 25.0 : 16.0;
|
||||
final radius = isTouched ? 60.0 : 50.0;
|
||||
@ -83,9 +86,24 @@ class _BuildsChartState extends State<BuildsChart> {
|
||||
case 1:
|
||||
return PieChartSectionData(
|
||||
color: const Color(0xff0a7005),
|
||||
value: (widget.nrbuilds - widget.nrfailedbuilds).toDouble(),
|
||||
value: (widget.nrbuilds -
|
||||
widget.nrfailedbuilds -
|
||||
widget.nrActiveBuilds)
|
||||
.toDouble(),
|
||||
title:
|
||||
"${((widget.nrbuilds - widget.nrfailedbuilds) * 100 / widget.nrbuilds).toStringAsFixed(2)}%",
|
||||
"${((widget.nrbuilds - widget.nrfailedbuilds - widget.nrActiveBuilds) * 100 / widget.nrbuilds).toStringAsFixed(2)}%",
|
||||
radius: radius,
|
||||
titleStyle: TextStyle(
|
||||
fontSize: fontSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: const Color(0xffffffff)),
|
||||
);
|
||||
case 2:
|
||||
return PieChartSectionData(
|
||||
color: const Color(0xff9d8d00),
|
||||
value: (widget.nrActiveBuilds).toDouble(),
|
||||
title:
|
||||
"${((widget.nrActiveBuilds) * 100 / widget.nrbuilds).toStringAsFixed(2)}%",
|
||||
radius: radius,
|
||||
titleStyle: TextStyle(
|
||||
fontSize: fontSize,
|
||||
|
@ -42,10 +42,10 @@ class _RecentBuildsState extends State<RecentBuilds> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(defaultPadding),
|
||||
decoration: BoxDecoration(
|
||||
padding: const EdgeInsets.all(defaultPadding),
|
||||
decoration: const BoxDecoration(
|
||||
color: secondaryColor,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10)),
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@ -97,9 +97,12 @@ class _RecentBuildsState extends State<RecentBuilds> {
|
||||
DataCell(Text(build.id.toString())),
|
||||
DataCell(Text(build.pkg_name)),
|
||||
DataCell(Text(build.version)),
|
||||
DataCell(Icon(
|
||||
switchSuccessIcon(build.status),
|
||||
color: switchSuccessColor(build.status),
|
||||
DataCell(IconButton(
|
||||
icon: Icon(
|
||||
switchSuccessIcon(build.status),
|
||||
color: switchSuccessColor(build.status),
|
||||
),
|
||||
onPressed: () {},
|
||||
)),
|
||||
],
|
||||
);
|
||||
|
@ -9,10 +9,12 @@ class SidePanel extends StatelessWidget {
|
||||
Key? key,
|
||||
required this.nrbuilds,
|
||||
required this.nrfailedbuilds,
|
||||
required this.nrActiveBuilds,
|
||||
}) : super(key: key);
|
||||
|
||||
final int nrbuilds;
|
||||
final int nrfailedbuilds;
|
||||
final int nrActiveBuilds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -33,7 +35,10 @@ class SidePanel extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: defaultPadding),
|
||||
BuildsChart(nrbuilds: nrbuilds, nrfailedbuilds: nrfailedbuilds),
|
||||
BuildsChart(
|
||||
nrbuilds: nrbuilds,
|
||||
nrfailedbuilds: nrfailedbuilds,
|
||||
nrActiveBuilds: nrActiveBuilds),
|
||||
ChartCard(
|
||||
color: const Color(0xff0a7005),
|
||||
title: "Successful Builds",
|
||||
@ -48,6 +53,13 @@ class SidePanel extends StatelessWidget {
|
||||
"${(nrfailedbuilds * 100 / nrbuilds).toStringAsFixed(2)}%",
|
||||
subtitle: nrfailedbuilds.toString(),
|
||||
),
|
||||
ChartCard(
|
||||
color: const Color(0xff9d8d00),
|
||||
title: "Active Builds",
|
||||
textRight:
|
||||
"${(nrActiveBuilds * 100 / nrbuilds).toStringAsFixed(2)}%",
|
||||
subtitle: nrActiveBuilds.toString(),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
Reference in New Issue
Block a user