4747 >
4848 Reload Clients
4949 </b-dropdown-item-btn >
50+ <b-dropdown-item
51+ v-b-modal.go-to-page
52+ :disabled =" CURRENT_SHOW_SESSION == null || !WEBSOCKET_HEALTHY || stoppingSession || startingSession"
53+ >
54+ Jump To Page
55+ </b-dropdown-item >
5056 </b-nav-item-dropdown >
5157 </template >
5258 <b-nav-item
134140 </b-container >
135141 </template >
136142 <router-view v-else />
143+ <b-modal
144+ id =" go-to-page"
145+ ref =" go-to-page"
146+ title =" Go to Page"
147+ size =" sm"
148+ :hide-header-close =" changingPage"
149+ :hide-footer =" changingPage"
150+ :no-close-on-backdrop =" changingPage"
151+ :no-close-on-esc =" changingPage"
152+ @ok =" goToLivePage"
153+ >
154+ <b-form @submit.stop.prevent =" " >
155+ <b-form-group
156+ id =" page-input-group"
157+ label =" Page"
158+ label-for =" page-input"
159+ label-cols =" auto"
160+ >
161+ <b-form-input
162+ id =" page-input"
163+ v-model =" $v.pageInputFormState.pageNo.$model"
164+ name =" page-input"
165+ type =" number"
166+ :state =" validatePageState('pageNo')"
167+ aria-describedby =" page-feedback"
168+ />
169+ <b-form-invalid-feedback
170+ id =" page-feedback"
171+ >
172+ This is a required field, and must be greater than 0.
173+ </b-form-invalid-feedback >
174+ </b-form-group >
175+ </b-form >
176+ </b-modal >
137177 </div >
138178</template >
139179
@@ -142,6 +182,8 @@ import { mapGetters, mapActions } from 'vuex';
142182import log from ' loglevel' ;
143183import CreateUser from ' @/vue_components/user/CreateUser.vue' ;
144184import { makeURL } from ' @/js/utils' ;
185+ import { notNull , notNullAndGreaterThanZero } from ' @/js/customValidators' ;
186+ import { required , minValue } from ' vuelidate/lib/validators' ;
145187
146188export default {
147189 components: { CreateUser },
@@ -152,8 +194,22 @@ export default {
152194 stoppingSession: false ,
153195 startingSession: false ,
154196 wsStateCheckInterval: null ,
197+ changingPage: false ,
198+ pageInputFormState: {
199+ pageNo: 1 ,
200+ },
155201 };
156202 },
203+ validations: {
204+ pageInputFormState: {
205+ pageNo: {
206+ required,
207+ notNull,
208+ notNullAndGreaterThanZero,
209+ minValue: minValue (1 ),
210+ },
211+ },
212+ },
157213 computed: {
158214 isAllowedScriptConfig () {
159215 return (this .IS_ADMIN_USER
@@ -313,6 +369,18 @@ export default {
313369 });
314370 }
315371 },
372+ validatePageState (name ) {
373+ const { $dirty , $error } = this .$v .pageInputFormState [name];
374+ return $dirty ? ! $error : null ;
375+ },
376+ async goToLivePage () {
377+ this .$socket .sendObj ({
378+ OP : ' LIVE_SHOW_JUMP_TO_PAGE' ,
379+ DATA : {
380+ page: this .pageInputFormState .pageNo ,
381+ },
382+ });
383+ },
316384 },
317385};
318386 </script >
0 commit comments