mirror of
https://github.com/nicolargo/glances.git
synced 2025-01-05 17:22:02 +03:00
No GPU info on Web View #2796
This commit is contained in:
parent
b8c6c22bb0
commit
52f354d5a0
@ -1,59 +1,75 @@
|
||||
<template>
|
||||
<section id="gpu" class="plugin">
|
||||
<div class="gpu-name title">
|
||||
{{ name }}
|
||||
</div>
|
||||
<div class="table">
|
||||
<div class="table-row" v-if="args.meangpu || gpus.length === 1">
|
||||
<div class="table-cell text-left">proc:</div>
|
||||
<div class="table-cell" :class="getMeanDecoration('proc')" v-if="mean.proc != null">
|
||||
{{ $filters.number(mean.proc, 0) }}%
|
||||
</div>
|
||||
<div class="table-cell" v-if="mean.proc == null">N/A</div>
|
||||
</div>
|
||||
<div class="table-row" v-if="args.meangpu || gpus.length === 1">
|
||||
<div class="table-cell text-left">mem:</div>
|
||||
<div class="table-cell" :class="getMeanDecoration('mem')" v-if="mean.mem != null">
|
||||
{{ $filters.number(mean.mem, 0) }}%
|
||||
</div>
|
||||
<div class="table-cell" v-if="mean.mem == null">N/A</div>
|
||||
</div>
|
||||
<div class="table-row" v-if="args.meangpu || gpus.length === 1">
|
||||
<div class="table-cell text-left">temperature:</div>
|
||||
<div
|
||||
class="table-cell"
|
||||
:class="getMeanDecoration('temperature')"
|
||||
v-if="mean.temperature != null"
|
||||
>
|
||||
{{ $filters.number(mean.temperature, 0) }}°
|
||||
</div>
|
||||
<div class="table-cell" v-if="mean.temperature == null">N/A</div>
|
||||
</div>
|
||||
<template v-if="!args.meangpu && gpus.length > 1">
|
||||
<div class="table-row" v-for="(gpu, gpuId) in gpus" :key="gpuId">
|
||||
<div class="table-cell text-left">
|
||||
{{ gpu.gpu_id }}:
|
||||
<span :class="getDecoration(gpu.gpu_id, 'proc')" v-if="gpu.proc != null">
|
||||
{{ $filters.number(gpu.proc, 0) }}%
|
||||
</span>
|
||||
<span v-if="gpu.proc == null">N/A</span>
|
||||
mem:
|
||||
<span :class="getDecoration(gpu.gpu_id, 'mem')" v-if="gpu.mem != null">
|
||||
{{ $filters.number(gpu.mem, 0) }}%
|
||||
</span>
|
||||
<span v-if="gpu.mem == null">N/A</span>
|
||||
temp:
|
||||
<span
|
||||
:class="getDecoration(gpu.gpu_id, 'temperature')"
|
||||
v-if="gpu.temperature != null"
|
||||
>
|
||||
{{ $filters.number(gpu.temperature, 0) }}C
|
||||
</span>
|
||||
<span v-if="gpu.temperature == null">N/A</span>
|
||||
<section class="plugin" id="gpu" v-if="gpus != undefined">
|
||||
<!-- single gpu -->
|
||||
<template v-if="gpus.length === 1">
|
||||
<div class="title gpu-name">{{ name }}</div>
|
||||
<div class="table">
|
||||
<template v-for="(gpu, gpuId) in gpus" :key="gpuId">
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">proc:</div>
|
||||
<div class="table-cell" :class="getDecoration(gpu.gpu_id, 'proc')" v-if="gpu.proc != null">{{ $filters.number(gpu.proc, 0) }}%</div>
|
||||
<div class="table-cell" v-if="gpu.proc == null">N/A</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">mem:</div>
|
||||
<div class="table-cell" :class="getDecoration(gpu.gpu_id, 'mem')" v-if="gpu.mem != null">{{ $filters.number(gpu.mem, 0) }}%</div>
|
||||
<div class="table-cell" v-if="gpu.mem == null">N/A</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">temp:</div>
|
||||
<div class="table-cell" :class="getDecoration(gpu.gpu_id, 'temperature')" v-if="gpu.temperature != null">{{ $filters.number(gpu.temperature, 0) }}°C</div>
|
||||
<div class="table-cell" v-if="gpu.temperature == null">N/A</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- multiple gpus - one line per gpu (no mean) -->
|
||||
<template v-if="!args.meangpu && gpus.length > 1">
|
||||
<div class="title gpu-name">{{ name }}</div>
|
||||
<div class="table">
|
||||
<div class="table-row" v-for="(gpu, gpuId) in gpus" :key="gpuId">
|
||||
<div class="table-cell text-left">{{ gpu.gpu_id }}:</div>
|
||||
<div class="table-cell" :class="getDecoration(gpu.gpu_id, 'proc')" v-if="gpu.proc != null">{{ $filters.number(gpu.proc, 0) }}%</div>
|
||||
<div class="table-cell" v-if="gpu.proc == null">N/A</div>
|
||||
<div class="table-cell text-left" style="padding-left: 10px">mem:</div>
|
||||
<div class="table-cell" :class="getDecoration(gpu.gpu_id, 'mem')" v-if="gpu.mem != null">{{ $filters.number(gpu.mem, 0) }}%</div>
|
||||
<div class="table-cell" v-if="gpu.mem == null">N/A</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- multiple gpus - mean -->
|
||||
<template v-if="args.meangpu && gpus.length > 1">
|
||||
<div class="title gpu-name">{{ name }}</div>
|
||||
<div class="table">
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">proc mean:</div>
|
||||
<div class="table-cell" :class="getMeanDecoration('proc')" v-if="mean.proc != null">
|
||||
{{ $filters.number(mean.proc, 0) }}%
|
||||
</div>
|
||||
<div class="table-cell" v-if="mean.proc == null">N/A</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">mem mean:</div>
|
||||
<div class="table-cell" :class="getMeanDecoration('mem')" v-if="mean.mem != null">
|
||||
{{ $filters.number(mean.mem, 0) }}%
|
||||
</div>
|
||||
<div class="table-cell" v-if="mean.mem == null">N/A</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">temp mean:</div>
|
||||
<div
|
||||
class="table-cell"
|
||||
:class="getMeanDecoration('temperature')"
|
||||
v-if="mean.temperature != null"
|
||||
>
|
||||
{{ $filters.number(mean.temperature, 0) }}°
|
||||
</div>
|
||||
<div class="table-cell" v-if="mean.temperature == null">N/A</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@ -124,7 +140,7 @@ export default {
|
||||
return this.view[gpuId][value].decoration.toLowerCase();
|
||||
},
|
||||
getMeanDecoration(value) {
|
||||
return this.getDecoration(0, value);
|
||||
return 'DEFAULT';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
2
glances/outputs/static/public/glances.js
vendored
2
glances/outputs/static/public/glances.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user