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

refactor: display bit version of OS #1101

Merged
merged 1 commit into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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