Carbon emissions code clean up and minor bug fixes

This commit is contained in:
Rendani Gangazhe
2023-06-02 10:08:17 -04:00
committed by Dannon Baker
parent 385831cf27
commit e4ba07ac7e
3 changed files with 6 additions and 8 deletions
@@ -178,7 +178,7 @@ const barChartData = computed(() => {
if (canShowMemory) {
data.push({
name: "Memory",
value: 20,
value: getPercentage(values.memoryCarbonEmissions, values.totalCarbonEmissions),
});
}
@@ -196,10 +196,10 @@ function prettyPrintValue({
convertValue?: (input: number) => number;
}) {
if (value < threshold) {
return `≤ ${threshold}` + `${unit ? ` ${unit}` : ""}`;
return `≤ ${threshold} ${unit ?? ""}`;
}
return `${value}` + `${unit ? ` ${unit}` : ""}`;
return `${value} ${unit ?? ""}`;
}
function getPercentage(value: number, total: number) {
@@ -1,7 +1,7 @@
<script setup>
<script setup lang="ts">
import ExternalLink from "@/components/ExternalLink.vue";
import Heading from "@/components/Common/Heading.vue";
import Abbreviation from "@/components/Abbreviation.vue";
import Abbreviation from "@/components/Common/Abbreviation.vue";
const dictionary = [
{
@@ -38,8 +38,6 @@ const greenAlgorithmsUrl = "https://www.green-algorithms.org/";
<header>
<Heading h1 separator bold size="h-lg">Carbon Emissions Calculations</Heading>
<Citation class="formatted-reference" :citation="greenAlgorithmsCitation" prefix="-" />
<p>
Our calculations are based off of the work of the
<ExternalLink :href="greenAlgorithmsUrl">Green Algorithms Project</ExternalLink>
+1 -1
View File
@@ -18,7 +18,7 @@ import StorageDashboardRoutes from "entry/analysis/routes/storageDashboardRoutes
// child components
import AboutGalaxy from "components/AboutGalaxy.vue";
import CarbonEmissionsCalculations from "components/CarbonEmissions/CarbonEmissionsCalculations.vue";
import CarbonEmissionsCalculations from "components/JobMetrics/CarbonEmissions/CarbonEmissionsCalculations";
import Citations from "components/Citation/Citations";
import ClientError from "components/ClientError";
import CollectionEditView from "components/Collections/common/CollectionEditView";