Skip to content

Commit

Permalink
refactor: display bit version of OS (#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Sep 30, 2022
1 parent 6a40e60 commit 37c9fa8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
32 changes: 22 additions & 10 deletions src/components/panels/Machine/SystemPanelHost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@
<v-row class="py-0 pr-4">
<v-col class="pl-6">
<strong style="cursor: pointer" @click="hostDetailsDialog = true">Host</strong>
<template v-if="hostStats.cpuDesc">
<v-tooltip top>
<template #activator="{ on, attrs }">
<small v-if="hostStats.cpuName" class="ml-2" v-bind="attrs" v-on="on">
({{ hostStats.cpuName }})
</small>
</template>
<span>{{ hostStats.cpuDesc }}</span>
</v-tooltip>
</template>
<v-tooltip top>
<template #activator="{ on, attrs }">
<small v-if="hostStats.cpuName" class="ml-2" v-bind="attrs" v-on="on">({{ cpuName }})</small>
</template>
<span>{{ cpuDesc }}</span>
</v-tooltip>
<br />
<div class="text-body-2">
<div v-if="hostStats.version">
Expand Down Expand Up @@ -261,5 +257,21 @@ export default class SystemPanelHost extends Mixins(BaseMixin) {
return null
}
get cpuDesc() {
let output = this.hostStats.cpuDesc
return output
}
get cpuName() {
let output = this.hostStats.cpuName
if (this.hostStats.bits) {
output += `, ${this.hostStats.bits}`
}
return output
}
}
</script>
2 changes: 2 additions & 0 deletions src/store/server/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const getters: GetterTree<ServerState, any> = {
interface HostStats {
cpuName: string | null
cpuDesc: string | null
bits: string | null
version: string | null
pythonVersion: string | null
os: string | null
Expand Down Expand Up @@ -119,6 +120,7 @@ export const getters: GetterTree<ServerState, any> = {
output = {
cpuName: state.system_info?.cpu_info?.processor ?? null,
cpuDesc: state.system_info?.cpu_info?.cpu_desc ?? null,
bits: state.system_info?.cpu_info?.bits ?? null,
version,
pythonVersion,
os: state.system_info?.distribution?.name ?? null,
Expand Down

0 comments on commit 37c9fa8

Please sign in to comment.