1818 :item =" getItem(tab)"
1919 :summaryTimeForWholeDay =" summaryTime"
2020 />
21+
22+ <div class =" show-all" v-if =" showOnlyFirst100Items" >
23+ <button @click =" showAllWebSites()" >Show all websites</button >
24+ </div >
2125 </div >
2226</template >
2327
@@ -48,6 +52,7 @@ const props = defineProps<{
4852
4953const isShowOverallStats = computed (() => props .showAllStats && props .type == TypeOfList .All );
5054
55+ let loadedTabs: Tab [] = [];
5156const tabs = ref <Tab []>();
5257const dataForOvarallStats = ref <OverallStats >();
5358
@@ -60,6 +65,13 @@ const countOfActiveDays = ref<number>();
6065
6166const countOfSites = computed (() => (tabs .value != undefined ? tabs .value .length : 0 ));
6267
68+ const showOnlyFirst100Items = ref <boolean >();
69+
70+ function showAllWebSites() {
71+ showOnlyFirst100Items .value = false ;
72+ tabs .value = loadedTabs ;
73+ }
74+
6375async function loadList(sortingBy : SortingBy ) {
6476 let tabSummary = null ;
6577 if (props .type == TypeOfList .Today ) tabSummary = await useTodayTabListSummary (sortingBy );
@@ -71,10 +83,16 @@ async function loadList(sortingBy: SortingBy) {
7183 }
7284
7385 if (tabSummary != null ) {
86+ loadedTabs = tabSummary .tabs ;
7487 tabs .value = tabSummary .tabs ;
7588 summaryTime .value = tabSummary .summaryTime ;
7689 timeForChart .value = tabSummary .chart .timeForChart ;
7790 sitesForChart .value = tabSummary .chart .sitesForChart ;
91+
92+ if (props .type == TypeOfList .All && loadedTabs .length > 100 ) {
93+ showOnlyFirst100Items .value = true ;
94+ tabs .value = tabSummary .tabs .slice (0 , 100 );
95+ } else showOnlyFirst100Items .value = false ;
7896 }
7997}
8098
@@ -108,3 +126,19 @@ onMounted(async () => {
108126 await loadList (SortingBy .UsageTime );
109127});
110128 </script >
129+
130+ <style scoped>
131+ .show-all {
132+ text-align : center ;
133+ padding-bottom : 10px ;
134+ }
135+
136+ .show-all button {
137+ background-color : aliceblue ;
138+ border-radius : 5px ;
139+ border : 1px rgb (202 , 202 , 202 ) solid ;
140+ font-size : 13px ;
141+ cursor : pointer ;
142+ padding : 5px 25px ;
143+ }
144+ </style >
0 commit comments