@@ -5,7 +5,7 @@ import { NIcon, NSelect, NSwitch, type SelectOption } from 'naive-ui';
5
5
import { type Component , computed , h , onBeforeMount , ref } from ' vue' ;
6
6
7
7
import SettingsFormItem from ' ~/components/views/settings/SettingsFormItem.vue' ;
8
- import { pageSizeOptions } from ' ~/models/page-size.model' ;
8
+ import { pageSizeOptions , pageSizeOptionsWithZero } from ' ~/models/page-size.model' ;
9
9
import { ProgressType } from ' ~/models/progress-type.model' ;
10
10
import { Route } from ' ~/models/router.model' ;
11
11
import { useCalendarStoreRefs } from ' ~/stores/data/calendar.store' ;
@@ -17,6 +17,7 @@ import {
17
17
useListsStoreRefs ,
18
18
useListStoreRefs ,
19
19
} from ' ~/stores/data/list.store' ;
20
+ import { useRatingsStoreRefs } from ' ~/stores/data/ratings.store' ;
20
21
import { useSearchStoreRefs } from ' ~/stores/data/search.store' ;
21
22
import {
22
23
useExtensionSettingsStore ,
@@ -78,6 +79,13 @@ onBeforeMount(() => {
78
79
const { pageSize : historyPageSize } = useHistoryStoreRefs ();
79
80
const { pageSize : listPageSize } = useListStoreRefs ();
80
81
const { pageSize : searchPageSize } = useSearchStoreRefs ();
82
+ const { pageSize : ratingPageSize } = useRatingsStoreRefs ();
83
+
84
+ const pageSizeLoadListWarning = computed (() => {
85
+ if (! loadLists .value .length ) return i18n (' label_load_lists_warning' );
86
+ if (! loadListsPageSize .value ) return i18n (' label_page_size_warning' );
87
+ return undefined ;
88
+ });
81
89
82
90
const tabsOptions = computed (() =>
83
91
enabledTabs .value .map (([route , state ]) => ({
@@ -146,17 +154,6 @@ const container = ref();
146
154
</NSwitch >
147
155
</SettingsFormItem >
148
156
149
- <!-- Enable Ratings -->
150
- <SettingsFormItem
151
- :label =" i18n('label_enable_ratings')"
152
- :warning =" enableRatings ? i18n('label_enable_ratings_warning') : undefined"
153
- >
154
- <NSwitch v-model:value =" enableRatings" class =" form-switch" >
155
- <template #checked >{{ i18n('on', 'common', 'button') }}</template >
156
- <template #unchecked >{{ i18n('off', 'common', 'button') }}</template >
157
- </NSwitch >
158
- </SettingsFormItem >
159
-
160
157
<!-- Enable tabs -->
161
158
<template v-for =" [route , state ] of enabledTabs " :key =" route " >
162
159
<SettingsFormItem
@@ -224,17 +221,32 @@ const container = ref();
224
221
</SettingsFormItem >
225
222
</template >
226
223
227
- <!-- Page Size -->
228
- <SettingsFormItem :label =" i18n('label_load_lists_page_size')" >
224
+ <!-- Enable Ratings -->
225
+ <SettingsFormItem
226
+ :label =" i18n('label_enable_ratings')"
227
+ :warning =" enableRatings ? i18n('label_enable_ratings_warning') : undefined"
228
+ >
229
+ <NSwitch v-model:value =" enableRatings" class =" form-switch" >
230
+ <template #checked >{{ i18n('on', 'common', 'button') }}</template >
231
+ <template #unchecked >{{ i18n('off', 'common', 'button') }}</template >
232
+ </NSwitch >
233
+ </SettingsFormItem >
234
+
235
+ <!-- Rating Page Sizes -->
236
+ <SettingsFormItem
237
+ :label =" i18n('label_ratings_page_size')"
238
+ :warning =" !ratingPageSize ? i18n('label_page_size_warning') : undefined"
239
+ >
229
240
<NSelect
230
- v-model:value =" loadListsPageSize "
231
- :disabled =" !loadLists.length "
241
+ v-model:value =" ratingPageSize "
242
+ :disabled =" !enableRatings "
232
243
class =" form-select"
233
244
:to =" container"
234
- :options =" pageSizeOptions "
245
+ :options =" pageSizeOptionsWithZero "
235
246
/>
236
247
</SettingsFormItem >
237
248
249
+ <!-- History Page Sizes -->
238
250
<SettingsFormItem :label =" i18n('label_history_page_size')" >
239
251
<NSelect
240
252
v-model:value =" historyPageSize"
@@ -245,6 +257,7 @@ const container = ref();
245
257
/>
246
258
</SettingsFormItem >
247
259
260
+ <!-- List Page Sizes -->
248
261
<SettingsFormItem :label =" i18n('label_list_page_size')" >
249
262
<NSelect
250
263
v-model:value =" listPageSize"
@@ -255,6 +268,21 @@ const container = ref();
255
268
/>
256
269
</SettingsFormItem >
257
270
271
+ <!-- Load List Page Sizes -->
272
+ <SettingsFormItem
273
+ :label =" i18n('label_load_lists_page_size')"
274
+ :warning =" pageSizeLoadListWarning"
275
+ >
276
+ <NSelect
277
+ v-model:value =" loadListsPageSize"
278
+ :disabled =" !loadLists.length"
279
+ class =" form-select"
280
+ :to =" container"
281
+ :options =" pageSizeOptionsWithZero"
282
+ />
283
+ </SettingsFormItem >
284
+
285
+ <!-- Search page size -->
258
286
<SettingsFormItem :label =" i18n('label_search_page_size')" >
259
287
<NSelect
260
288
v-model:value =" searchPageSize"
0 commit comments