33 <div class =" animatable_content_box " >
44
55 <b-form-input
6+ @input =" currentPage=1"
67 onkeypress =" return event.keyCode != 13;"
78 size =" sm"
89 placeholder =" Search by prompt text"
1617 <div @click =" toggle_order()" style =" float :right ; margin-bottom : 20px ;" class =" l_button" >
1718 {{this.app_state.show_history_in_oldest_first ? "Oldest": "Newest"}} First
1819 </div >
20+ <div @click =" clear_history()" style =" float :right ; margin-bottom : 20px ;" class =" l_button" >
21+ Clear History
22+ </div >
1923 <div v-if =" Object.values(app_state.app_data.history).length > 0" >
20- <div v-for =" history_box in get_history()" :key =" history_box.key" style =" clear : both ;" >
24+ <div v-if =" get_history().length > 30" >
25+ <b-pagination
26+ v-model =" currentPage"
27+ :total-rows =" get_history().length"
28+ :per-page =" 30"
29+ />
30+ </div >
31+ <div v-for =" history_box in get_history().slice((currentPage - 1) * 30, currentPage * 30)" :key =" history_box.key" style =" clear : both ;" >
32+
2133
2234 <div @click =" delete_hist(history_box.key)" style =" float :right ; margin-top : 10px ;" class =" l_button" >Delete</div >
2335 <!-- <div @click="share_on_arthub(history_box)" style="float:right; margin-top: 10px;" class="l_button">Share</div> -->
6577</template >
6678<script >
6779import ImageItem from ' ../components/ImageItem.vue'
80+ import {native_confirm } from " ../native_functions_vue_bridge.js" ;
6881import {share_on_arthub } from ' ../utils.js'
6982
7083import Vue from ' vue'
@@ -83,7 +96,8 @@ export default {
8396 },
8497 data () {
8598 return {
86- searchText: ' '
99+ searchText: ' ' ,
100+ currentPage: 1 ,
87101 };
88102 },
89103 methods: {
@@ -95,7 +109,6 @@ export default {
95109 let history = Object .values (this .app_state .app_data .history );
96110 const that = this ;
97111 const list = this .app_state .show_history_in_oldest_first ? history : history .reverse ();
98-
99112 if (that .searchText .trim () === ' ' ) {
100113 return list;
101114 }
@@ -104,7 +117,7 @@ export default {
104117 keys: [' prompt' ],
105118 useExtendedSearch: true ,
106119 });
107-
120+
108121 return fuse .search (that .searchText ).map (r => r .item );
109122
110123 },
@@ -132,6 +145,12 @@ export default {
132145 return r;
133146 },
134147
148+ clear_history (){
149+ if (native_confirm (" Are you sure you want to clear history?" )){
150+ Vue .set ( this .app_state .app_data , " history" , {});
151+ }
152+ },
153+
135154 share_on_arthub (box ){
136155 this .app_state .global_loader_modal_msg = " Uploading" ;
137156 let params = this .get_box_params_dict (box);
@@ -147,6 +166,24 @@ export default {
147166}
148167 </script >
149168<style >
169+ .page-item .page-link {
170+ outline : none !important ;
171+ box-shadow : none ;
172+ }
173+ .page-item .page-link {
174+ font-size : 13px ;
175+ }
176+ @media (prefers-color-scheme: dark) {
177+ .page-item .page-link , .page-item.disabled .page-link {
178+ background-color :#303030 ;
179+ border-color : #303030 ;
180+ color :rgba (255 , 255 , 255 , 0.5 );
181+ }
182+ .page-item.active .page-link {
183+ background-color :#606060 ;
184+ border-color : #606060 ;
185+ }
186+ }
150187 </style >
151188<style scoped>
152189.history_box_info {
0 commit comments