File tree Expand file tree Collapse file tree 8 files changed +173
-130
lines changed
trace-frame/script-editor
schedule/auto-mode/auto-mode-button/modes Expand file tree Collapse file tree 8 files changed +173
-130
lines changed Original file line number Diff line number Diff line change 8
8
>
9
9
interrupt
10
10
</VBtn >
11
- <VMenu offset-y >
11
+ <Component :is = " menuComponent " v-bind = " menuAttributes " >
12
12
<template #activator =" { props } " >
13
13
<VBtn variant =" text" v-bind =" props" icon =" mdi-dots-horizontal" density =" compact" >
14
14
</VBtn >
27
27
Kill
28
28
</VListItem >
29
29
</VList >
30
- </VMenu >
30
+ </Component >
31
31
</template >
32
32
33
33
<script setup lang="ts">
34
+ import { computed } from " vue" ;
35
+ import { useDisplay } from " vuetify" ;
34
36
import {
35
37
useCtrlInterruptMutation ,
36
38
useCtrlTerminateMutation ,
@@ -40,4 +42,11 @@ import {
40
42
const { executeMutation : executeInterrupt } = useCtrlInterruptMutation ();
41
43
const { executeMutation : executeTerminate } = useCtrlTerminateMutation ();
42
44
const { executeMutation : executeKill } = useCtrlKillMutation ();
45
+
46
+ const { mobile } = useDisplay ();
47
+
48
+ const menuComponent = computed (() => (mobile .value ? " VBottomSheet" : " VMenu" ));
49
+ const menuAttributes = computed (() =>
50
+ mobile .value ? {} : { location: " top" , offset: 8 }
51
+ );
43
52
</script >
Original file line number Diff line number Diff line change 16
16
>
17
17
save
18
18
</VBtn >
19
- <VMenu location = " top " >
19
+ <Component :is = " menuComponent " v-bind = " menuAttributes " >
20
20
<template #activator =" { props } " >
21
21
<VBtn v-bind =" props" icon =" mdi-dots-horizontal" > </VBtn >
22
22
</template >
34
34
Load Example Script
35
35
</VListItem >
36
36
</VList >
37
- </VMenu >
37
+ </Component >
38
38
</VCardActions >
39
39
</template >
40
40
41
41
<script setup lang="ts">
42
+ import { computed } from " vue" ;
43
+ import { useDisplay } from " vuetify" ;
42
44
import { useDevTool } from " @/utils/dev/enabled" ;
43
45
interface Props {
44
46
editing: boolean ;
@@ -55,4 +57,9 @@ type Emits = {
55
57
56
58
defineProps <Props >();
57
59
const emit = defineEmits <Emits >();
60
+
61
+ const { mobile } = useDisplay ();
62
+
63
+ const menuComponent = computed (() => (mobile .value ? " VBottomSheet" : " VMenu" ));
64
+ const menuAttributes = computed (() => (mobile .value ? {} : { location: " top" }));
58
65
</script >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <VMenu >
2
+ <Component :is = " menuComponent " >
3
3
<template #activator =" { props } " >
4
4
<VBtn v-bind =" props" > Auto Mode: Off </VBtn >
5
5
</template >
6
- <DialogOff ></DialogOff >
7
- </VMenu >
6
+ <div >
7
+ <Dialog class =" dialog" ></Dialog >
8
+ </div >
9
+ </Component >
8
10
</template >
9
11
10
12
<script setup lang="ts">
11
- import DialogOff from " ./Dialog.vue" ;
13
+ import { computed } from " vue" ;
14
+ import { useDisplay } from " vuetify" ;
15
+ import Dialog from " ./Dialog.vue" ;
16
+ const { mobile } = useDisplay ();
17
+ const menuComponent = computed (() => (mobile .value ? " VBottomSheet" : " VMenu" ));
12
18
</script >
19
+
20
+ <style scoped>
21
+ .v-bottom-sheet .dialog {
22
+ border-radius : 0 !important ;
23
+ padding : 4px 4px 24px 4px ;
24
+ }
25
+
26
+ .v-menu .dialog {
27
+ width : 290px ;
28
+ padding : 4px ;
29
+ }
30
+ </style >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div >
3
- <VCard >
4
- <VCardText >
5
- <div class =" mb-1" >
6
- <p class =" font-weight-medium" >
7
- The auto mode is currently <span class =" font-italic" > off </span >.
8
- </p >
9
- <p class =" mt-3" >
10
- If on, it automatically loads and runs the next script after each run
11
- successfully ends.
12
- </p >
13
- <p class =" mt-3" >
14
- The auto mode can load scripts from either the
15
- <span class =" font-italic" > scheduler </span > or the
16
- <span class =" font-italic" > queue </span >.
17
- </p >
18
- <p class =" mt-3" >Turn on auto mode?</p >
19
- </div >
20
- </VCardText >
21
- <VCardActions >
22
- <VSpacer ></VSpacer >
23
- <VBtn variant =" outlined" @click =" turnOnFromScheduler" >
24
- turn on from scheduler
25
- </VBtn >
26
- </VCardActions >
27
- <VCardActions >
28
- <VSpacer ></VSpacer >
29
- <VBtn variant =" outlined" @click =" turnOnFromQueue" > turn on from queue </VBtn >
30
- </VCardActions >
31
- </VCard >
32
- </div >
2
+ <VCard >
3
+ <VCardText >
4
+ <div class =" mb-1" >
5
+ <p class =" font-weight-medium" >
6
+ The auto mode is currently <span class =" font-italic" > off </span >.
7
+ </p >
8
+ <p class =" mt-3" >
9
+ If on, it automatically loads and runs the next script after each run
10
+ successfully ends.
11
+ </p >
12
+ <p class =" mt-3" >
13
+ The auto mode can load scripts from either the
14
+ <span class =" font-italic" > scheduler </span > or the
15
+ <span class =" font-italic" > queue </span >.
16
+ </p >
17
+ <p class =" mt-3" >Turn on auto mode?</p >
18
+ </div >
19
+ </VCardText >
20
+ <VCardActions >
21
+ <VBtn variant =" outlined" @click =" turnOnFromScheduler" class =" flex-grow-1" >
22
+ turn on from scheduler
23
+ </VBtn >
24
+ </VCardActions >
25
+ <VCardActions >
26
+ <VBtn variant =" outlined" @click =" turnOnFromQueue" class =" flex-grow-1" >
27
+ turn on from queue
28
+ </VBtn >
29
+ </VCardActions >
30
+ </VCard >
33
31
</template >
34
32
35
33
<script setup lang="ts">
@@ -45,10 +43,3 @@ async function turnOnFromQueue() {
45
43
await changeMode ({ mode: " queue" });
46
44
}
47
45
</script >
48
-
49
- <style scoped>
50
- :deep(.v-card ) {
51
- width : 290px ;
52
- padding : 4px ;
53
- }
54
- </style >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <VMenu >
2
+ <Component :is = " menuComponent " >
3
3
<template #activator =" { props } " >
4
4
<VBtn v-bind =" props" variant =" tonal" color =" tertiary" > Auto Mode: Queue </VBtn >
5
5
</template >
6
- <DialogOn ></DialogOn >
7
- </VMenu >
6
+ <div >
7
+ <Dialog class =" dialog" ></Dialog >
8
+ </div >
9
+ </Component >
8
10
</template >
9
11
10
12
<script setup lang="ts">
11
- import DialogOn from " ./Dialog.vue" ;
13
+ import { computed } from " vue" ;
14
+ import { useDisplay } from " vuetify" ;
15
+ import Dialog from " ./Dialog.vue" ;
16
+ const { mobile } = useDisplay ();
17
+ const menuComponent = computed (() => (mobile .value ? " VBottomSheet" : " VMenu" ));
12
18
</script >
19
+
20
+ <style scoped>
21
+ .v-bottom-sheet .dialog {
22
+ border-radius : 0 !important ;
23
+ padding : 4px 4px 24px 4px ;
24
+ }
25
+
26
+ .v-menu .dialog {
27
+ width : 290px ;
28
+ padding : 4px ;
29
+ }
30
+ </style >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div >
3
- <VCard >
4
- <VCardText >
5
- <div class =" mb-1" >
6
- <p class =" font-weight-medium" >
7
- The auto mode currently is <span class =" font-italic" > on </span > and loads
8
- scripts from the <span class =" font-italic" > queue </span >.
9
- </p >
10
- <p class =" mt-3" >
11
- The auto mode automatically loads and runs the next script after each run
12
- successfully ends.
13
- </p >
14
- <p class =" mt-3" >
15
- The auto mode can load scripts from either the
16
- <span class =" font-italic" > scheduler </span > or the
17
- <span class =" font-italic" > queue </span >.
18
- </p >
19
- </div >
20
- </VCardText >
21
- <VCardActions >
22
- <VSpacer ></VSpacer >
23
- <VBtn variant =" outlined" @click =" switchToLoadFromScheduler" >
24
- switch to load from scheduler
25
- </VBtn >
26
- </VCardActions >
27
- <VCardActions >
28
- <VSpacer ></VSpacer >
29
- <VBtn variant =" outlined" @click =" turnOff" > turn off auto mode </VBtn >
30
- </VCardActions >
31
- </VCard >
32
- </div >
2
+ <VCard >
3
+ <VCardText >
4
+ <div class =" mb-1" >
5
+ <p class =" font-weight-medium" >
6
+ The auto mode currently is <span class =" font-italic" > on </span > and loads
7
+ scripts from the <span class =" font-italic" > queue </span >.
8
+ </p >
9
+ <p class =" mt-3" >
10
+ The auto mode automatically loads and runs the next script after each run
11
+ successfully ends.
12
+ </p >
13
+ <p class =" mt-3" >
14
+ The auto mode can load scripts from either the
15
+ <span class =" font-italic" > scheduler </span > or the
16
+ <span class =" font-italic" > queue </span >.
17
+ </p >
18
+ </div >
19
+ </VCardText >
20
+ <VCardActions >
21
+ <VBtn variant =" outlined" @click =" switchToLoadFromScheduler" class =" flex-grow-1" >
22
+ switch to load from scheduler
23
+ </VBtn >
24
+ </VCardActions >
25
+ <VCardActions >
26
+ <VBtn variant =" outlined" @click =" turnOff" class =" flex-grow-1" >
27
+ turn off auto mode
28
+ </VBtn >
29
+ </VCardActions >
30
+ </VCard >
33
31
</template >
34
32
35
33
<script setup lang="ts">
@@ -44,10 +42,3 @@ async function turnOff() {
44
42
await changeMode ({ mode: " off" });
45
43
}
46
44
</script >
47
-
48
- <style scoped>
49
- :deep(.v-card ) {
50
- width : 290px ;
51
- padding : 4px ;
52
- }
53
- </style >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <VMenu >
2
+ <Component :is = " menuComponent " >
3
3
<template #activator =" { props } " >
4
4
<VBtn v-bind =" props" variant =" tonal" color =" tertiary" >
5
5
Auto Mode: Scheduler
6
6
</VBtn >
7
7
</template >
8
- <DialogOn ></DialogOn >
9
- </VMenu >
8
+ <div >
9
+ <Dialog class =" dialog" ></Dialog >
10
+ </div >
11
+ </Component >
10
12
</template >
11
13
12
14
<script setup lang="ts">
13
- import DialogOn from " ./Dialog.vue" ;
15
+ import { computed } from " vue" ;
16
+ import { useDisplay } from " vuetify" ;
17
+ import Dialog from " ./Dialog.vue" ;
18
+ const { mobile } = useDisplay ();
19
+ const menuComponent = computed (() => (mobile .value ? " VBottomSheet" : " VMenu" ));
14
20
</script >
21
+
22
+ <style scoped>
23
+ .v-bottom-sheet .dialog {
24
+ border-radius : 0 !important ;
25
+ padding : 4px 4px 24px 4px ;
26
+ }
27
+
28
+ .v-menu .dialog {
29
+ width : 290px ;
30
+ padding : 4px ;
31
+ }
32
+ </style >
You can’t perform that action at this time.
0 commit comments