Skip to content

Commit

Permalink
Merge pull request #3137 from threefoldtech/development_nodes_card
Browse files Browse the repository at this point in the history
Show the node price if the node is rentable or rented by the logged-in user
  • Loading branch information
samaradel authored Jul 22, 2024
2 parents 8882aad + 4fb1019 commit fc61e87
Showing 1 changed file with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
<span class="font-weight-bold" v-text="toReadableDate(node.uptime)" />
</span>
<span class="ml-2" v-if="node"
>Last Deployment Time: {{ lastDeploymentTime === 0 ? "N/A" : toHumanDate(lastDeploymentTime) }}
>Last Deployment Time:
{{ lastDeploymentTime === 0 ? "N/A" : toHumanDate(lastDeploymentTime) }}
</span>
</template>

Expand Down Expand Up @@ -175,7 +176,7 @@
</VRow>

<VRow>
<VCol class="tf-node-resource">
<VCol class="tf-node-resource mb-5">
<ResourceDetails
name="SSD Disks"
:used="(node?.used_resources.sru ?? 0) + selectedMachines.reduce((r, m) => r + m.disk * 1e9, 0)"
Expand All @@ -192,7 +193,7 @@
/>
</VCol>
</VRow>
<div class="mt-5 ml-auto text-right">
<div class="ml-auto text-right" v-if="node && (rentedByUser || (node.status !== 'down' && node.rentable))">
<v-tooltip bottom color="primary" close-delay="100" :disabled="!(node && node.dedicated)">
<template v-slot:activator="{ isActive, props }">
<span v-bind="props" v-on="isActive" class="font-weight-bold"
Expand All @@ -210,9 +211,24 @@
hover
:loading="loadingdiscountTableItems"
:headers="[
{ title: 'Packages', align: 'center', key: 'name', sortable: false },
{ title: 'Discount', align: 'center', key: 'discount', sortable: false },
{ title: 'TFTs Required', align: 'center', key: 'tfts', sortable: false },
{
title: 'Packages',
align: 'center',
key: 'name',
sortable: false,
},
{
title: 'Discount',
align: 'center',
key: 'discount',
sortable: false,
},
{
title: 'TFTs Required',
align: 'center',
key: 'tfts',
sortable: false,
},
]"
:items="discountTableItems"
disable-sort="true"
Expand Down Expand Up @@ -278,8 +294,7 @@ import type { GridClient, NodeInfo, NodeResources } from "@threefold/grid_client
import { discountPackages } from "@threefold/grid_client";
import { CertificationType, type GridNode } from "@threefold/gridproxy_client";
import { QueryClient } from "@threefold/tfchain_client";
import { computed, onMounted, ref, watch } from "vue";
import { capitalize, type PropType } from "vue";
import { capitalize, computed, onMounted, type PropType, ref, watch } from "vue";
import { gridProxyClient } from "@/clients";
import ReserveBtn from "@/dashboard/components/reserve_action_btn.vue";
Expand Down

0 comments on commit fc61e87

Please sign in to comment.