mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-10-26 00:01:11 +00:00
fix(container): reset sort to default when cleared (#14140)
The container list opens with name ascending but shows no sort indicator. Clearing the name sort kept the previous descending order, so two no-indicator states represented different orders. Reset the request to the default name ascending when the sort is cleared.
This commit is contained in:
@@ -540,14 +540,15 @@ const portsDialogContainer = ref('');
|
||||
const portFilter = ref('');
|
||||
const showIPv6Ports = ref(true);
|
||||
const selects = ref<any>([]);
|
||||
const defaultSort = { prop: 'name', order: 'ascending' };
|
||||
const paginationConfig = reactive({
|
||||
cacheSizeKey: 'container-page-size',
|
||||
currentPage: 1,
|
||||
pageSize: Number(localStorage.getItem('container-page-size')) || 20,
|
||||
total: 0,
|
||||
state: 'all',
|
||||
orderBy: 'name',
|
||||
order: 'ascending',
|
||||
orderBy: defaultSort.prop,
|
||||
order: defaultSort.order,
|
||||
});
|
||||
const searchName = ref();
|
||||
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
|
||||
@@ -723,8 +724,10 @@ const search = async (column?: any) => {
|
||||
}
|
||||
localStorage.setItem('includeAppStore', includeAppStore.value ? 'true' : 'false');
|
||||
let filterItem = (router.currentRoute.value.query?.filters as string) || '';
|
||||
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
|
||||
paginationConfig.order = column?.order ? column.order : paginationConfig.order;
|
||||
if (column) {
|
||||
paginationConfig.orderBy = column.order ? column.prop : defaultSort.prop;
|
||||
paginationConfig.order = column.order || defaultSort.order;
|
||||
}
|
||||
let params = {
|
||||
name: searchName.value,
|
||||
state: paginationConfig.state || 'all',
|
||||
|
||||
Reference in New Issue
Block a user