web/admin: fix negative count for policies when more cached than total policies
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
253f345fc4
commit
7f25b6311d
|
@ -42,7 +42,9 @@ export class PolicyStatusChart extends AKChart<PolicyMetrics> {
|
||||||
})).pagination.count;
|
})).pagination.count;
|
||||||
this.centerText = count.toString();
|
this.centerText = count.toString();
|
||||||
return {
|
return {
|
||||||
count: count - cached - unbound,
|
// If we have more cache than total policies, only show that
|
||||||
|
// otherwise show count without unbound
|
||||||
|
count: cached >= count ? cached : count - unbound,
|
||||||
cached: cached,
|
cached: cached,
|
||||||
unbound: unbound,
|
unbound: unbound,
|
||||||
};
|
};
|
||||||
|
|
Reference in New Issue