File tree Expand file tree Collapse file tree 3 files changed +54
-6
lines changed
Expand file tree Collapse file tree 3 files changed +54
-6
lines changed Original file line number Diff line number Diff line change 11import { createRouter , createWebHistory } from 'vue-router'
22import ControlButtons from './views/ControlButtons.vue'
33import ChangeKeeper from './views/ChangeKeeper.vue'
4+ import ConfirmChallengeFlag from './views/ConfirmChallengeFlag.vue'
45
56const router = createRouter ( {
67 history : createWebHistory ( ) ,
@@ -15,6 +16,11 @@ const router = createRouter({
1516 name : 'ChangeKeeper' ,
1617 component : ChangeKeeper
1718 } ,
19+ {
20+ path : '/confirm-challenge-flag' ,
21+ name : 'ConfirmChallengeFlag' ,
22+ component : ConfirmChallengeFlag
23+ } ,
1824 ]
1925} )
2026
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import {inject , ref } from ' vue' ;
3+ import {RemoteControlToController_Request } from ' ../proto/ssl_gc_rcon_remotecontrol' ;
4+ import {ApiController } from ' ../services/ApiController' ;
5+ import router from ' ../router' ;
6+
7+ const api = inject <ApiController >(' api' )
8+
9+ const requestChallengeFlag = () => {
10+ api ?.Send ({
11+ msg: {
12+ $case: ' request' ,
13+ request: RemoteControlToController_Request .CHALLENGE_FLAG
14+ }
15+ })
16+ router .push (' /' )
17+ }
18+ </script >
19+
20+ <template >
21+ <div class =" num-pad" >
22+ <button
23+ class =" button red"
24+ @click =" router.push('/')"
25+ >
26+ Cancel
27+ </button >
28+ <button
29+ class =" button green"
30+ @click =" requestChallengeFlag"
31+ >
32+ Confirm
33+ </button >
34+ </div >
35+ </template >
36+
37+ <style scoped>
38+ .num-pad {
39+ display : grid ;
40+ grid-template-columns : 1fr ;
41+ grid-template-rows : 1fr 1fr ;
42+ gap : 1em 1em ;
43+ padding : 1em ;
44+ height : 100% ;
45+ box-sizing : border-box ;
46+ }
47+ </style >
Original file line number Diff line number Diff line change @@ -23,12 +23,7 @@ const emergencyStopRequested = computed(() => state.value.activeRequests.include
2323const timeoutRequested = computed (() => state .value .activeRequests .includes (RemoteControlRequestType .TIMEOUT ))
2424const robotSubstitutionRequested = computed (() => state .value .activeRequests .includes (RemoteControlRequestType .ROBOT_SUBSTITUTION ))
2525
26- const requestChallengeFlag = () => api ?.Send ({
27- msg: {
28- $case: ' request' ,
29- request: RemoteControlToController_Request .CHALLENGE_FLAG
30- }
31- })
26+ const requestChallengeFlag = () => router .push (' /confirm-challenge-flag' )
3227const requestEmergencyStop = (request : boolean ) => api ?.Send ({
3328 msg: {
3429 $case: ' requestEmergencyStop' ,
You can’t perform that action at this time.
0 commit comments