Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 28 additions & 22 deletions src/features/cx/components/MaterialCXOverviewTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@
<th>CI1</th>
<th>IC1</th>
<th>NC1</th>
<th>UNIVERSE</th>
<th>{{ $t("cx_info_table.universe") }}</th>
</tr>
</thead>
<tbody class="child:child:first:font-bold child:child:px-2!">
<tr
class="border-b-2 border-t-2 border-dark-gray child:bg-dark-gray/50">
<td colspan="6">VWAP</td>
<td colspan="6">{{ $t("cx_info_table.vwap") }}</td>
</tr>
<tr
class="[&>td:nth-child(6)]:border-l-2 [&>td:nth-child(6)]:border-dark-gray">
<td>7D</td>
<td>{{ $t("terms.7d") }}</td>
<td
v-for="cx in exchangeTypesArray"
:key="`vwap_7d#${cx}`"
Expand All @@ -92,7 +92,7 @@
</tr>
<tr
class="[&>td:nth-child(6)]:border-l-2 [&>td:nth-child(6)]:border-dark-gray">
<td>30D</td>
<td>{{ $t("terms.30d") }}</td>
<td
v-for="cx in exchangeTypesArray"
:key="`vwap_30d#${cx}`"
Expand All @@ -102,7 +102,7 @@
</tr>
<tr
class="[&>td:nth-child(6)]:border-l-2 [&>td:nth-child(6)]:border-dark-gray">
<td>Trend</td>
<td>{{ $t("terms.trend") }}</td>
<td
v-for="cx in exchangeTypesArray"
:key="`vwap_7d#${cx}`"
Expand Down Expand Up @@ -148,11 +148,11 @@
</tr>
<tr
class="border-b-2 border-t-2 border-dark-gray child:bg-dark-gray/50">
<td colspan="6">Traded Volume</td>
<td colspan="6">{{ $t("cx_info_table.traded_volume") }}</td>
</tr>
<tr
class="[&>td:nth-child(6)]:border-l-2 [&>td:nth-child(6)]:border-dark-gray">
<td>7D</td>
<td>{{ $t("terms.7d") }}</td>
<td
v-for="cx in exchangeTypesArray"
:key="`sum_traded_7d#${cx}`"
Expand All @@ -162,7 +162,7 @@
</tr>
<tr
class="[&>td:nth-child(6)]:border-l-2 [&>td:nth-child(6)]:border-dark-gray">
<td>30D</td>
<td>{{ $t("terms.30d") }}</td>
<td
v-for="cx in exchangeTypesArray"
:key="`sum_traded_30d#${cx}`"
Expand All @@ -172,11 +172,13 @@
</tr>
<tr
class="border-b-2 border-t-2 border-dark-gray child:bg-dark-gray/50">
<td colspan="6">Market Live Data</td>
<td colspan="6">
{{ $t("cx_info_table.market_live_data") }}
</td>
</tr>
<tr
class="[&>td:nth-child(6)]:border-l-2 [&>td:nth-child(6)]:border-dark-gray">
<td>Ask</td>
<td>{{ $t("terms.ask") }}</td>
<td
v-for="cx in exchangeGameTypesArray"
:key="`ask#${cx}`"
Expand All @@ -187,7 +189,7 @@
</tr>
<tr
class="[&>td:nth-child(6)]:border-l-2 [&>td:nth-child(6)]:border-dark-gray">
<td>Bid</td>
<td>{{ $t("terms.bid") }}</td>
<td
v-for="cx in exchangeGameTypesArray"
:key="`bid#${cx}`"
Expand All @@ -198,7 +200,7 @@
</tr>
<tr
class="[&>td:nth-child(6)]:border-l-2 [&>td:nth-child(6)]:border-dark-gray">
<td>Spread</td>
<td>{{ $t("terms.spread") }}</td>
<td
v-for="cx in exchangeGameTypesArray"
:key="`spread#${cx}`"
Expand All @@ -209,7 +211,7 @@
</tr>
<tr
class="[&>td:nth-child(6)]:border-l-2 [&>td:nth-child(6)]:border-dark-gray border-t-2 border-dark-gray">
<td>S / D</td>
<td>{{ $t("cx_info_table.supply_vs_demand") }}</td>
<td
v-for="cx in exchangeTypesArray"
:key="`supply_demand#${cx}`"
Expand All @@ -224,7 +226,7 @@
</tr>
<tr
class="[&>td:nth-child(6)]:border-l-2 [&>td:nth-child(6)]:border-dark-gray">
<td>Delta</td>
<td>{{ $t("terms.delta") }}</td>
<td
v-for="cx in exchangeTypesArray"
:key="`delta_supply_demand#${cx}`"
Expand All @@ -246,7 +248,7 @@
</tr>
<tr
class="border-b-2 border-t-2 border-dark-gray child:bg-dark-gray/50">
<td colspan="6">Insights</td>
<td colspan="6">{{ $t("cx_info_table.insights") }}</td>
</tr>
<tr v-if="overviewData.systemic_health" class="">
<td colspan="6" class="border-t border-b border-dark-gray">
Expand All @@ -255,7 +257,7 @@
<div class="flex flex-col">
<span
class="text-[10px] text-white/50 uppercase">
Market Breadth
{{ $t("cx_info_table.market_breadth") }}
</span>
<span class="text-lg font-mono"
>{{
Expand All @@ -279,7 +281,7 @@
<div class="flex flex-col">
<span
class="text-[10px] text-white/50 uppercase">
Liquidity Ratio
{{ $t("cx_info_table.liquidity_ratio") }}
</span>
<span
class="text-lg font-mono"
Expand All @@ -299,14 +301,14 @@
</span>
<span
class="text-[10px] text-white/50 font-normal">
Demand / Supply
{{ $t("cx_info_table.demand_vs_supply") }}
</span>
</div>

<div class="flex flex-col">
<span
class="text-[10px] text-white/50 uppercase">
Weighted Trend
{{ $t("cx_info_table.weighted_trend") }}
</span>
<span
class="text-lg font-mono"
Expand All @@ -328,14 +330,18 @@
</span>
<span
class="text-[10px] text-white/50 font-normal">
Volume-Adjusted Delta
{{
$t(
"cx_info_table.volume_adjusted_delta"
)
}}
</span>
</div>

<div class="flex flex-col">
<span
class="text-[10px] text-white/50 uppercase">
Price Cohesion
{{ $t("cx_info_table.price_cohesion") }}
</span>
<span
class="text-lg font-mono"
Expand All @@ -355,7 +361,7 @@
</span>
<span
class="text-[10px] text-white/50 font-normal">
Variance Index
{{ $t("cx_info_table.variance_index") }}
</span>
</div>
</div>
Expand Down
64 changes: 40 additions & 24 deletions src/features/resource_roi_overview/components/ResourceROITable.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<script setup lang="ts">
import { ComputedRef, PropType, Ref, computed, ref } from "vue";

import { useI18n } from "vue-i18n";
const { t } = useI18n();

// Util
import { formatNumber } from "@/util/numbers";
import { capitalizeString } from "@/util/text";
Expand Down Expand Up @@ -85,7 +88,10 @@
:building-options="filterOptionBuilding"
:searched-material="searchedMaterial" />
<XNDataTable :data="localResult" striped :pagination="{ pageSize: 50 }">
<XNDataTableColumn key="planetName" title="Planet" sorter="default">
<XNDataTableColumn
key="planetName"
:title="t('resource_roi.table.planet')"
sorter="default">
<template #render-cell="{ rowData }">
<router-link
:to="`/plan/${rowData.planetNaturalId}`"
Expand All @@ -94,38 +100,45 @@
</router-link>
</template>
</XNDataTableColumn>
<XNDataTableColumn key="production" title="Production">
<XNDataTableColumn
key="production"
:title="t('resource_roi.table.production')">
<XNDataTableColumn
key="buildingTicker"
title="Building"
:title="t('resource_roi.table.building')"
sorter="default">
<template #render-cell="{ rowData }">
<span class="font-bold">{{ rowData.buildingTicker }}</span>
</template>
</XNDataTableColumn>
<XNDataTableColumn key="dailyYield" title="Daily" sorter="default">
<XNDataTableColumn
key="dailyYield"
:title="t('resource_roi.table.daily')"
sorter="default">
<template #render-cell="{ rowData }">
{{ formatNumber(rowData.dailyYield) }}
</template>
</XNDataTableColumn>
<XNDataTableColumn
key="percentMaxDailyYield"
title="% Max."
:title="t('resource_roi.table.percent_max')"
sorter="default">
<template #render-cell="{ rowData }">
{{ formatNumber(rowData.percentMaxDailyYield * 100) }} %
</template>
</XNDataTableColumn>
</XNDataTableColumn>
<XNDataTableColumn key="planet" title="Planet">
<XNDataTableColumn key="popr" title="POPR">
<XNDataTableColumn key="planet" :title="t('resource_roi.table.planet')">
<XNDataTableColumn key="popr" :title="t('resource_roi.table.popr')">
<template #render-cell="{ rowData }">
<PlanetPOPRButton
:planet-natural-id="rowData.planetNaturalId"
button-size="sm" />
</template>
</XNDataTableColumn>
<XNDataTableColumn key="planetCOGC" title="COGC">
<XNDataTableColumn
key="planetCOGC"
:title="t('resource_roi.table.cogc')">
<template #render-cell="{ rowData }">
{{
rowData.planetCOGC
Expand All @@ -136,7 +149,9 @@
}}
</template>
</XNDataTableColumn>
<XNDataTableColumn key="environment" title="Environment">
<XNDataTableColumn
key="environment"
:title="t('resource_roi.table.environment')">
<template #render-cell="{ rowData }">
<div class="flex flex-row flex-wrap gap-1">
<MaterialTile
Expand All @@ -160,25 +175,25 @@
</XNDataTableColumn>
<XNDataTableColumn
key="planetInfrastructures"
title="Infrastructure">
:title="t('resource_roi.table.infrastructure')">
<template #render-cell="{ rowData }">
{{ rowData.planetInfrastructures.join(", ") }}
</template>
</XNDataTableColumn>
</XNDataTableColumn>
<XNDataTableColumn key="profit" title="Cost / Profit">
<XNDataTableColumn
key="profit"
:title="t('resource_roi.table.cost_profit')">
<XNDataTableColumn key="cogm" title="COGM">
<template #render-cell="{ rowData }">
<COGMButton :cogm-data="rowData.cogm" />
</template>
</XNDataTableColumn>
<XNDataTableColumn
key="planCost"
title="Plan Cost"
:title="t('resource_roi.table.plan_cost')"
title-align="right"
sorter="default">
<template #title>
<div class="text-end">Plan Cost</div>
</template>
<template #render-cell="{ rowData }">
<div class="text-end text-nowrap">
{{ formatNumber(rowData.planCost) }}
Expand Down Expand Up @@ -208,11 +223,9 @@
</XNDataTableColumn> -->
<XNDataTableColumn
key="dailyProfit"
title="Daily Profit"
:title="t('resource_roi.table.daily_profit')"
title-align="right"
sorter="default">
<template #title>
<div class="text-end">Daily Profit</div>
</template>
<template #render-cell="{ rowData }">
<div
class="text-end text-nowrap"
Expand Down Expand Up @@ -246,10 +259,11 @@
</div>
</template>
</XNDataTableColumn> -->
<XNDataTableColumn key="planROI" title="Plan ROI" sorter="default">
<template #title>
<div class="text-end text-nowrap">Plan ROI</div>
</template>
<XNDataTableColumn
key="planROI"
:title="t('resource_roi.table.plan_roi')"
title-align="right"
sorter="default">
<template #render-cell="{ rowData }">
<div
class="text-end"
Expand All @@ -264,7 +278,9 @@
</template>
</XNDataTableColumn>
</XNDataTableColumn>
<XNDataTableColumn key="distances" title="Distances">
<XNDataTableColumn
key="distances"
:title="t('resource_roi.table.distances')">
<XNDataTableColumn
key="distanceAI1"
title="AI1"
Expand Down
Loading
Loading