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

feat(xo-6): add host network view #8198

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ad30871
feat(xo-6): implement network view
CzechSebastian Nov 15, 2024
c66fcee
feat(xo-6): Add css
CzechSebastian Nov 18, 2024
c7cddbb
feat(xo-6): add behavior
CzechSebastian Nov 18, 2024
5ba4762
feat(xo-6): add stores
CzechSebastian Nov 19, 2024
d2f47b8
feat(xo-6): remove locales
CzechSebastian Nov 19, 2024
e2f61dc
feat(xo-6): locales change
CzechSebastian Nov 19, 2024
bc1040c
feat(xo-6): locales migration
CzechSebastian Nov 19, 2024
fda6d12
feat(xo-6): PR feedback
CzechSebastian Nov 20, 2024
45fd76e
feat(xo6): feedback
CzechSebastian Nov 21, 2024
aab732d
feat(xo6): refactor store
CzechSebastian Nov 22, 2024
cf84b09
feat(xo6): refactor store
CzechSebastian Nov 25, 2024
d9aa25f
feat(xo-6): remove code not relevant of store
CzechSebastian Nov 27, 2024
d6bebdb
feat(xo-6): remove code not relevant of store
CzechSebastian Nov 27, 2024
a22fb2f
feat(xo-6): remove locale
CzechSebastian Nov 29, 2024
ba5c963
feat(xo-6): add locale
CzechSebastian Nov 29, 2024
a169de5
feat(xo-6): feedback
CzechSebastian Dec 4, 2024
85e6a35
feat(xo-6): implement network view
CzechSebastian Nov 15, 2024
dbcdd9e
feat(xo6): Update with checkbox composable
CzechSebastian Nov 25, 2024
a3a66f7
feat(xo6): remove duplicated
CzechSebastian Nov 25, 2024
eef4d02
feat(xo6): wip make pif table component
CzechSebastian Nov 25, 2024
4c51cb5
feat(xo-6): display table with filter
CzechSebastian Nov 26, 2024
0ee0348
feat(xo-6): css on table
CzechSebastian Nov 26, 2024
95284d3
feat(xo-6):handle fake store
CzechSebastian Nov 28, 2024
32e33d4
feat(xo-6):update info
CzechSebastian Nov 28, 2024
d296e7a
feat(xo-6):update with new card key component
CzechSebastian Nov 28, 2024
edcf124
feat(web-core): update css alignment, tooltip and ellipsis on text
CzechSebastian Nov 28, 2024
9e91081
feat(xo-6): add row selection
CzechSebastian Nov 29, 2024
d0f63fa
feat(web-core): add state for empty panel (wip)
CzechSebastian Nov 29, 2024
e85fdad
feat(web-core): wip
CzechSebastian Dec 2, 2024
ca79d92
feat(xo-6): add table scrolling bar
CzechSebastian Dec 2, 2024
2d205b7
feat(xo-6): add responsiveness for table
CzechSebastian Dec 2, 2024
1467416
feat(xo-6): update headers
CzechSebastian Dec 3, 2024
1c4e908
feat(xo-6): add no-selection panel
CzechSebastian Dec 3, 2024
224192e
feat(x0-6): typing
CzechSebastian Dec 5, 2024
1a132fd
feat(xo-6): remove classes
CzechSebastian Dec 5, 2024
b93e8aa
feat(xo-6): add store
CzechSebastian Dec 5, 2024
24b71fa
feat(xo-6): handle None values
CzechSebastian Dec 5, 2024
906bf3d
feat(xo-6): simplify functions
CzechSebastian Dec 5, 2024
3c61e25
feat(xo-6): handle header width
CzechSebastian Dec 6, 2024
539222e
feat(xo-6): update table container
CzechSebastian Dec 11, 2024
c714f7a
feat(xo-6): remove media queries
CzechSebastian Dec 11, 2024
c24b24e
feat(xo-6): add copyToClipboard function
CzechSebastian Dec 17, 2024
c2a5c07
feat(xo-6): add loader on table
CzechSebastian Dec 17, 2024
2682dfe
add connection status for pifs
CzechSebastian Dec 19, 2024
1021ed2
remove pifStatus
CzechSebastian Dec 19, 2024
ac125ac
add pagination
CzechSebastian Dec 19, 2024
8d9ed99
add locales
CzechSebastian Dec 19, 2024
4eae898
wip
CzechSebastian Dec 19, 2024
6f7d7d3
reactive pagination
CzechSebastian Dec 20, 2024
eb4ed38
update component
CzechSebastian Jan 6, 2025
907f423
add selction by id
CzechSebastian Jan 6, 2025
6a1ad05
add selction by id
CzechSebastian Jan 7, 2025
8183a77
feat(web-core): add reactivity to pagination
CzechSebastian Jan 10, 2025
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
Prev Previous commit
Next Next commit
wip
  • Loading branch information
CzechSebastian committed Dec 19, 2024
commit 4eae89863431274a420e08bb66c90b7d260d8a9a
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!-- v2 -->
<template>
{{ pageSize }}
<div class="ui-table-pagination">
<div class="buttons-container">
<PaginationButton :disabled="isFirstPage || disabled" :icon="faAngleDoubleLeft" @click="goToFirstPage()" />
Expand Down Expand Up @@ -33,7 +34,7 @@ import {
faAngleRight,
} from '@fortawesome/free-solid-svg-icons'
import { useOffsetPagination } from '@vueuse/core'
import { computed, ref, watch } from 'vue'
import { computed, ref, watchEffect } from 'vue'

export type PaginationPayload = {
currentPage: number
Expand All @@ -49,9 +50,13 @@ const { totalItems, disabled = false } = defineProps<{

const emit = defineEmits<{
change: [payload: PaginationPayload]
'update:modelValue': number
'update:per-page': number
'update:start-index': number
'update:end-index': number
}>()

const pageSize = ref(50)
const pageSize = ref(10)
const pageSizeOptions = [10, 50, 100, 150, 200]
const {
currentPage,
Expand All @@ -75,10 +80,14 @@ const goToLastPage = () => {
currentPage.value = pageCount.value
}

watch([currentPage, currentPageSize], ([newPage, newPageSize]) => {
watchEffect(() => {
emit('update:modelValue', currentPage.value)
emit('update:per-page', pageSize.value)
emit('update:start-index', startIndex.value)
emit('update:end-index', endIndex.value)
emit('change', {
currentPage: newPage,
pageSize: newPageSize,
currentPage: currentPage.value,
pageSize: currentPageSize.value,
startIndex: startIndex.value,
endIndex: endIndex.value,
})
Expand Down
33 changes: 28 additions & 5 deletions @xen-orchestra/web/src/components/pif/PifTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@
:total-items="usableIds.length"
@toggle-select-all="toggleSelect"
/>
<UiTablePagination :total-items="usableIds.length" />
{{ pagination }}
<UiTablePagination
v-model="pagination.currentPage"
v-model:per-page="pagination.pageSize"
v-model:start-index="pagination.startIndex"
v-model:end-index="pagination.endIndex"
:total-items="usableIds.length"
/>
<!-- <UiTablePagination :total-items="usableIds.length" @change="handle($event)" /> -->
</div>
</div>
<div class="table-container">
Expand Down Expand Up @@ -90,7 +98,14 @@
:total-items="usableIds.length"
@toggle-select-all="toggleSelect"
/>
<UiTablePagination :total-items="usableIds.length" />
{{ pagination.pageSize }}
<UiTablePagination
v-model="pagination.currentPage"
v-model:per-page="pagination.pageSize"
v-model:start-index="pagination.startIndex"
v-model:end-index="pagination.endIndex"
:total-items="usableIds.length"
/>
</div>
</div>
</template>
Expand All @@ -111,7 +126,7 @@ import UiCheckbox from '@core/components/ui/checkbox/UiCheckbox.vue'
import UiComplexIcon from '@core/components/ui/complex-icon/UiComplexIcon.vue'
import UiQuerySearchBar from '@core/components/ui/query-search-bar/UiQuerySearchBar.vue'
import UiTableActions from '@core/components/ui/table-actions/UiTableActions.vue'
import UiTablePagination from '@core/components/ui/table-pagination/UiTablePagination.vue'
import UiTablePagination, { type PaginationPayload } from '@core/components/ui/table-pagination/UiTablePagination.vue'
import UiTitle from '@core/components/ui/title/UiTitle.vue'
import UiTopBottomTable from '@core/components/ui/top-bottom-table/UiTopBottomTable.vue'
import useMultiSelect from '@core/composables/table/multi-select.composable'
Expand Down Expand Up @@ -142,6 +157,12 @@ const emit = defineEmits<{
}>()

const { get, isReady } = useNetworkStore().subscribe()
const pagination = ref<PaginationPayload>({
currentPage: 0,
pageSize: 0,
startIndex: 0,
endIndex: 0,
})

const getNetworkName = (pif: XoPif) => {
const network: XoNetwork = get(pif.$network)!
Expand All @@ -154,10 +175,12 @@ const getPifData = (pif: XoPif, type: keyof XoPif) =>
const searchQuery = ref('')

const filteredPifs = computed(() => {
if (!searchQuery.value) return props.pifs
return props.pifs.filter(pif =>
let filtered = props.pifs
if (!searchQuery.value) return props.pifs.slice(pagination.value.startIndex - 1, pagination.value.endIndex)
filtered = props.pifs.filter(pif =>
Object.values(pif).some(value => String(value).toLowerCase().includes(searchQuery.value.toLowerCase()))
)
return filtered.slice(pagination.value.startIndex - 1, pagination.value.endIndex)
})

const usableIds = computed(() => props.pifs.map(item => item.id))
Expand Down