Skip to content

Commit

Permalink
refactor: remove network average
Browse files Browse the repository at this point in the history
See: BEDS-641
  • Loading branch information
benji-bitfly committed Nov 13, 2024
1 parent 2f208d5 commit 310860a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { formatTsToTime } from '~/utils/format'
import { API_PATH } from '~/types/customFetch'
import {
type AggregationTimeframe,
SUMMARY_CHART_GROUP_NETWORK_AVERAGE,
// SUMMARY_CHART_GROUP_NETWORK_AVERAGE,
SUMMARY_CHART_GROUP_TOTAL,
type SummaryChartFilter,
} from '~/types/dashboard/summary'
Expand Down Expand Up @@ -198,9 +198,9 @@ const loadData = async () => {
if (element.id === SUMMARY_CHART_GROUP_TOTAL) {
name = $t('dashboard.validator.summary.chart.total')
}
else if (element.id === SUMMARY_CHART_GROUP_NETWORK_AVERAGE) {
name = $t('dashboard.validator.summary.chart.average')
}
// else if (element.id === SUMMARY_CHART_GROUP_NETWORK_AVERAGE) {
// name = $t('dashboard.validator.summary.chart.average')
// }
else {
name = getGroupLabel($t, element.id, groups.value, allGroups)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
AggregationTimeframes,
type EfficiencyType,
EfficiencyTypes,
SUMMARY_CHART_GROUP_NETWORK_AVERAGE,
// SUMMARY_CHART_GROUP_NETWORK_AVERAGE,
SUMMARY_CHART_GROUP_TOTAL,
type SummaryChartFilter,
} from '~/types/dashboard/summary'
Expand Down Expand Up @@ -52,10 +52,10 @@ const total = ref(
!chartFilter.value.initialised
|| chartFilter.value.groupIds.includes(SUMMARY_CHART_GROUP_TOTAL),
)
const average = ref(
!chartFilter.value.initialised
|| chartFilter.value.groupIds.includes(SUMMARY_CHART_GROUP_NETWORK_AVERAGE),
)
// const average = ref(
// !chartFilter.value.initialised
// || chartFilter.value.groupIds.includes(SUMMARY_CHART_GROUP_NETWORK_AVERAGE),
// )
const groups = computed(() => {
if (!overview.value?.groups) {
return []
Expand All @@ -80,20 +80,20 @@ watch(
[
selectedGroups,
total,
average,
// average,
],
([
list,
t,
a,
// a,
]) => {
const groupIds: number[] = [ ...list ]
if (t) {
groupIds.push(SUMMARY_CHART_GROUP_TOTAL)
}
if (a) {
groupIds.push(SUMMARY_CHART_GROUP_NETWORK_AVERAGE)
}
// if (a) {
// groupIds.push(SUMMARY_CHART_GROUP_NETWORK_AVERAGE)
// }
chartFilter.value.groupIds = groupIds
chartFilter.value.initialised = true
},
Expand All @@ -120,9 +120,9 @@ const selectedLabel = computed(() => {
'asc',
)
if (average.value) {
list.splice(0, 0, $t('dashboard.validator.summary.chart.average'))
}
// if (average.value) {
// list.splice(0, 0, $t('dashboard.validator.summary.chart.average'))
// }
if (total.value) {
list.splice(0, 0, $t('dashboard.validator.summary.chart.total'))
}
Expand Down Expand Up @@ -164,12 +164,12 @@ const selectedLabel = computed(() => {
$t("dashboard.validator.summary.chart.total")
}}</label>
</div>
<div class="special-groups">
<!-- <div class="special-groups">
<Checkbox v-model="average" input-id="average" :binary="true" />
<label for="average">{{
$t("dashboard.validator.summary.chart.average")
}}</label>
</div>
</div> -->
<span class="pointer" @click="toggleGroups">
{{ $t("dashboard.group.selection.all") }}
</span>
Expand Down
2 changes: 1 addition & 1 deletion frontend/types/dashboard/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export type SummaryTableVisibility = {
}

export const SUMMARY_CHART_GROUP_TOTAL = -1
export const SUMMARY_CHART_GROUP_NETWORK_AVERAGE = -2
// export const SUMMARY_CHART_GROUP_NETWORK_AVERAGE = -2

export type AggregationTimeframe = keyof ChartHistorySeconds
export const AggregationTimeframes: AggregationTimeframe[] = [
Expand Down

0 comments on commit 310860a

Please sign in to comment.