-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #706 from threefoldtech/development_dashboard_expl…
…orerGPU support gpu in explorer
- Loading branch information
Showing
8 changed files
with
178 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
packages/dashboard/src/explorer/components/GPUDetails.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<template> | ||
<v-card flat color="transparent" tag="div"> | ||
<v-list-item> | ||
<v-list-item-icon> | ||
<v-icon size="40" class="mr-2">mdi-expansion-card-variant</v-icon> | ||
</v-list-item-icon> | ||
<v-list-item-content> | ||
<v-list-item-title style="font-size: 30px"> GPU Details </v-list-item-title> | ||
</v-list-item-content> | ||
</v-list-item> | ||
<!-- Details --> | ||
<v-row> | ||
<v-col cols="12" class="pt-0"> | ||
<!-- :cols="screen_max_800.matches ? 12 : screen_max_1000.matches ? 6 : 4" --> | ||
<v-list v-if="gpuItem"> | ||
<v-list-item> | ||
<v-list-item-content> | ||
<v-tooltip top nudge-bottom="30"> | ||
<template v-slot:activator="{ on, attrs }"> | ||
<v-list-item-title class="pt-3" v-bind="attrs" v-on="on" | ||
>Card ID | ||
<v-chip | ||
lose-icon="mdi-delete" | ||
:color="gpuItem.contract ? 'warning' : 'success'" | ||
small | ||
class="mb-1 ml-2" | ||
>{{ gpuItem.contract ? "Reserved" : "Available" }}</v-chip | ||
> | ||
</v-list-item-title> | ||
</template> | ||
<span>Card id that's used in a deployment</span> | ||
</v-tooltip> | ||
</v-list-item-content> | ||
<v-col class="mr-n4"> | ||
<v-select | ||
v-if="nodeGPUitems.length > 1" | ||
append-outer-icon="mdi-content-copy" | ||
hide-details | ||
solo | ||
v-model="gpuItem" | ||
:items="nodeGPUitems" | ||
@input.native="gpuItem = $event.srcElement.value.value" | ||
@click:append-outer="copy(gpuItem.id)" | ||
/> | ||
<v-text-field | ||
v-else | ||
:value="gpuItem.id" | ||
readonly | ||
hide-details | ||
append-outer-icon="mdi-content-copy" | ||
@click:append-outer="copy(gpuItem.id)" | ||
solo | ||
></v-text-field> | ||
</v-col> | ||
</v-list-item> | ||
<v-divider /> | ||
<v-list-item> | ||
<v-list-item-content> | ||
<v-list-item-title> Vendor </v-list-item-title> | ||
</v-list-item-content> | ||
{{ gpuItem?.vendor }} | ||
</v-list-item> | ||
<v-divider /> | ||
|
||
<v-list-item> | ||
<v-list-item-content> | ||
<v-list-item-title> Device </v-list-item-title> | ||
</v-list-item-content> | ||
{{ gpuItem?.device }} | ||
</v-list-item> | ||
<v-divider /> | ||
<v-list-item v-if="gpuItem.contract !== undefined"> | ||
<v-tooltip top nudge-bottom="30"> | ||
<template v-slot:activator="{ on, attrs }"> | ||
<v-list-item-content v-bind="attrs" v-on="on"> | ||
<v-list-item-title> Contract ID</v-list-item-title> | ||
</v-list-item-content> | ||
</template> | ||
<span>The contract id that reserves this GPU card</span> | ||
</v-tooltip> | ||
{{ gpuItem?.contract }} | ||
</v-list-item> | ||
<v-divider /> | ||
</v-list> </v-col | ||
></v-row> | ||
</v-card> | ||
</template> | ||
<script lang="ts"> | ||
import { Component, Prop, Vue } from "vue-property-decorator"; | ||
|
||
import { INodeGPU } from "../graphql/api"; | ||
|
||
@Component({}) | ||
export default class GPUDetails extends Vue { | ||
@Prop({ required: true }) nodeGPU!: INodeGPU[]; | ||
nodeGPUitems: { | ||
text: string; | ||
value: INodeGPU; | ||
|
||
disabled: false; | ||
}[] = this.$props.nodeGPU.map((item: INodeGPU) => { | ||
return { | ||
text: item.id, | ||
value: item, | ||
disabled: false, | ||
}; | ||
}); | ||
|
||
gpuItem = this.$props.nodeGPU[0]; | ||
copy(id: string) { | ||
navigator.clipboard.writeText(id); | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
.v-data-table > .v-data-table__wrapper tbody tr.v-data-table__expanded__content { | ||
box-shadow: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters