-
Notifications
You must be signed in to change notification settings - Fork 270
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
feat(xo-lite): add host network tab and pif table / status component … #8180
base: master
Are you sure you want to change the base?
Conversation
8406813
to
a0ba86d
Compare
9ddb152
to
2e181e3
Compare
const status = computed(() => { | ||
if (pifStatus) { | ||
return 'connected' | ||
} | ||
return 'disconnected' | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const status = computed(() => { | |
if (pifStatus) { | |
return 'connected' | |
} | |
return 'disconnected' | |
}) | |
const status = computed(() => (pifStatus ? 'connected' : 'disconnected')) |
import { useI18n } from 'vue-i18n' | ||
|
||
const { pifStatus, card } = defineProps<{ | ||
pifStatus: any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using any
return 'disconnected' | ||
}) | ||
|
||
const getStatusProps = (status: Status) => states.value[status] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this function.
Looking at the template, we can see it only receives the status
computed property, so it could be a computed property itself:
const getStatusProps = (status: Status) => states.value[status] | |
const statusProps = computed(() => states.value[status.value]) |
However, the status
computed property only returns either 'connected' or 'disconnected', while the states
object contains three properties: 'connected', 'disconnected', and 'partial'.
This means the 'partial' property appears to never be used.
Furthermore, we can see that the status
computed property is only used within the statusProps
computed property. This creates redundancy, suggesting that all this logic could likely be simplified by combining it into a single computed property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sure
2e181e3
to
98b38d2
Compare
Description
add host network tab and pif table / status component and pif store
Screenshot
Checklist
Fixes #007
,See xoa-support#42
,See https://...
)Introduced by
CHANGELOG.unreleased.md
Review process
Notes: