Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feat: Show connection status at the bottom of Navbar (#255)
- Loading branch information
Showing
2 changed files
with
64 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<v-tooltip top> | ||
<template #activator="{ on }"> | ||
<div class="d-flex justify-center fill-height"> | ||
<v-icon class="white--text" v-on="on"> | ||
{{ currentIcon }} | ||
</v-icon> | ||
</div> | ||
</template> | ||
|
||
<span>{{ status || 'unknown' }}</span> | ||
</v-tooltip> | ||
</template> | ||
|
||
<script> | ||
import { | ||
mdiCheckNetwork, | ||
mdiNetworkOff, | ||
mdiCloseNetwork, | ||
mdiHelpNetwork | ||
} from '@mdi/js' | ||
export default { | ||
props: ['status'], | ||
computed: { | ||
currentIcon() { | ||
const icons = { | ||
connected: mdiCheckNetwork, | ||
disconnected: mdiNetworkOff, | ||
firewalled: mdiCloseNetwork | ||
} | ||
const icon = icons?.[this.status] | ||
if (!this.status || !icon) return mdiHelpNetwork | ||
return icon | ||
} | ||
} | ||
} | ||
</script> |
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