Skip to content
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
2 changes: 1 addition & 1 deletion .env.gui
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RELEASE=PRE-ALPHA-test
VERSION=3
BUILD=3
FIX=3-test
FIX=4-test
2 changes: 1 addition & 1 deletion .github/workflows/ci-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and publish GUI

on:
push:
branches: [ v3.3.1 ]
branches: [ v3.3.2 ]
paths:
- '.env.gui'

Expand Down
16 changes: 14 additions & 2 deletions GUI/src/components/ServicesTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,23 @@ type ServicesTableProps = {
isCommon?: boolean;
};

const DEFAULT_PAGE_SIZE = 10;
const PAGE_SIZE_OPTIONS = new Set([10, 20, 30, 50]);
const PAGE_SIZE_STORAGE_KEY = 'page-size';

const getStoredPageSize = (): number => {
const stored = Number(localStorage.getItem(PAGE_SIZE_STORAGE_KEY));
return PAGE_SIZE_OPTIONS.has(stored) ? stored : DEFAULT_PAGE_SIZE;
};

const ServicesTable: FC<ServicesTableProps> = ({ isCommon = false }) => {
const { t } = useTranslation();
const [isDeletePopupVisible, setIsDeletePopupVisible] = useState(false);
const services = useServiceListStore((state) => (isCommon ? state.commonServices : state.notCommonServices));
const navigate = useNavigate();
const [pagination, setPagination] = useState<PaginationState>({
pageIndex: 0,
pageSize: 10,
pageSize: getStoredPageSize(),
});
const [sorting, setSorting] = useState<SortingState>([{ id: 'name', desc: false }]);

Expand Down Expand Up @@ -121,6 +130,9 @@ const ServicesTable: FC<ServicesTableProps> = ({ isCommon = false }) => {
sorting={sorting}
setPagination={(state: PaginationState) => {
if (state.pageIndex === pagination.pageIndex && state.pageSize === pagination.pageSize) return;
if (state.pageSize !== pagination.pageSize) {
localStorage.setItem(PAGE_SIZE_STORAGE_KEY, String(state.pageSize));
}
setPagination(state);
if (isCommon) {
loadCommonServices(state, sorting);
Expand All @@ -137,7 +149,7 @@ const ServicesTable: FC<ServicesTableProps> = ({ isCommon = false }) => {
}
}}
isClientSide={false}
pagesCount={services[services.length - 1]?.totalPages ?? 1}
pagesCount={services.at(-1)?.totalPages ?? 1}
/>
</Card>
);
Expand Down
2 changes: 1 addition & 1 deletion release.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
main
MAJOR=3
MINOR=3
PATCH=1
PATCH=2
Loading