Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mycelium IP column in workers table #3590

Closed
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@
{ title: 'PLACEHOLDER', key: 'data-table-select' },
{ title: 'Contract ID', key: 'contractId' },
{ title: 'Name', key: 'name' },
{ title: 'Public IPv4', key: 'publicIP.ip' },
{ title: 'CPU(vCores)', key: 'capacity.cpu' },
{ title: 'Memory(MB)', key: 'capacity.memory' },
{ title: 'Disk(GB)', key: 'disk' },
{
title: 'Networks',
key: 'networks',
sortable: false,
children: [
{ title: 'Public IPv4', key: 'publicIP.ip', sortable: false },
{ title: 'MyCelium IP', key: 'myceliumIP', sortable: false },
samaradel marked this conversation as resolved.
Show resolved Hide resolved
],
},
{ title: 'Created At', key: 'created' },
{ title: 'Health', key: 'status', sortable: false },
]"
:items="data"
:loading="false"
Expand All @@ -31,6 +38,27 @@
{{ data.indexOf(item) + 1 }}
</template>

<template #[`item.myceliumIP`]="{ item }">
{{ item.myceliumIP || "-" }}
</template>

<template #[`item.created`]="{ item }">
{{ toHumanDate(item.created) }}
</template>

<template #[`item.status`]="{ item }">
<v-chip :color="getNodeHealthColor(item.status as string).color">
<v-tooltip v-if="item.status == NodeHealth.Error" activator="parent" location="top">{{
item.message
}}</v-tooltip>
<v-tooltip v-if="item.status == NodeHealth.Paused" activator="parent" location="top"
>The deployment contract is in grace period</v-tooltip
>
<span class="text-uppercase">
{{ getNodeHealthColor(item.status as string).type }}
</span>
</v-chip>
</template>
<template #[`item.disk`]="{ item }">
{{ calcDiskSize(item.mounts) }}
</template>
Expand Down Expand Up @@ -81,6 +109,9 @@
<script lang="ts" setup>
import { ref } from "vue";

import toHumanDate from "@/utils/date";
import { getNodeHealthColor, NodeHealth } from "@/utils/get_nodes";

import { useGrid } from "../stores";
import { addMachine, deleteMachine, loadVM } from "../utils/deploy_vm";

Expand Down Expand Up @@ -135,6 +166,7 @@ async function deploy(layout: any) {
region: worker.value.selectionDetails!.location?.region,
planetary: true,
publicIpv4: true,
mycelium: worker.value.mycelium,
envs: [
{ key: "SWM_NODE_MODE", value: "worker" },
{ key: "PUBLIC_KEY", value: props.master.env.PUBLIC_KEY },
Expand Down
Loading