Skip to content

Commit 06d18db

Browse files
tonoizerClaiyc
andauthored
feat: new log design and capture area tooltip (#73)
* idea for capture Area tooltip Signed-off-by: Kevin Beier <[email protected]> * fixed log for capture areas Signed-off-by: Kevin Beier <[email protected]> * Update src/components/LogOutput.vue Co-authored-by: Claiyc <[email protected]> * Update src/views/RunPage.vue Co-authored-by: Claiyc <[email protected]> * first run log is open on default Signed-off-by: Kevin Beier <[email protected]> Signed-off-by: Kevin Beier <[email protected]> Co-authored-by: Claiyc <[email protected]>
1 parent a16ae9c commit 06d18db

File tree

4 files changed

+68
-35
lines changed

4 files changed

+68
-35
lines changed

src/App.vue

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,33 @@
2828

2929
<!-- Bottom Navigation -->
3030
<v-bottom-navigation :elevation="24" bg-color="surface" grow>
31-
<v-btn to="/run" tonal prepend-icon="mdi-play" value="run">
31+
<v-btn
32+
:disabled="isRunning"
33+
to="/run"
34+
tonal
35+
prepend-icon="mdi-play"
36+
value="run"
37+
>
3238
Capturing
3339
</v-btn>
3440

35-
<v-btn to="/" tonal prepend-icon="mdi-monitor" value="source">
41+
<v-btn
42+
:disabled="isRunning"
43+
to="/"
44+
tonal
45+
prepend-icon="mdi-monitor"
46+
value="source"
47+
>
3648
Source
3749
</v-btn>
3850

39-
<v-btn to="/regex" tonal prepend-icon="mdi-regex" value="regex">
51+
<v-btn
52+
:disabled="isRunning"
53+
to="/regex"
54+
tonal
55+
prepend-icon="mdi-regex"
56+
value="regex"
57+
>
4058
Regex
4159
</v-btn>
4260
</v-bottom-navigation>
@@ -45,6 +63,7 @@
4563

4664
<script setup lang="ts">
4765
import MainVideoStream from './components/MainVideoStream.vue';
66+
import { isRunning } from './composables/useRunning';
4867
4968
// Handle System Bar Functions for later
5069
async function minimizeScreen() {

src/components/LogOutput.vue

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
<template>
2-
<v-card class="log-output-container mb-4">
3-
<v-card-title>{{ `Capture Area ${captureAreaId}` }}</v-card-title>
4-
<v-list lines="three" disabled class="reverse">
5-
<v-list-item v-for="(item, i) in matchedElements" :key="i">
6-
<template v-slot:prepend>
7-
<v-icon color="primary" icon="mdi-information"></v-icon>
8-
</template>
2+
<v-expansion-panel class="log-output-container">
3+
<v-expansion-panel-title class="pa-4" expand-icon="mdi-menu-down">
4+
Capture area
5+
{{ captureAreaId }}
6+
</v-expansion-panel-title>
7+
<v-expansion-panel-text>
8+
<p v-if="matchedElementsIsEmpty">Start capturing first!</p>
9+
<v-list v-else lines="three" disabled class="reverse">
10+
<v-list-item v-for="(item, i) in matchedElements" :key="i">
11+
<template v-slot:prepend>
12+
<v-icon
13+
:color="item.rating > 0 ? 'success' : 'error'"
14+
icon="mdi-information"
15+
></v-icon>
16+
</template>
917

10-
<v-list-item-title> {{ item.timestamp }}</v-list-item-title>
11-
<v-list-item-subtitle>
18+
<v-list-item-title expand-icon="mdi-menu-down">
19+
{{ item.timestamp }}</v-list-item-title
20+
>
1221
<div>Element: {{ item.match.element }}</div>
1322
<div>Rating: {{ item.rating }}</div>
14-
</v-list-item-subtitle>
15-
</v-list-item>
16-
</v-list>
17-
</v-card>
23+
</v-list-item>
24+
</v-list>
25+
</v-expansion-panel-text>
26+
</v-expansion-panel>
1827
</template>
1928

2029
<script setup lang="ts">
21-
import { ref, watch } from 'vue';
30+
import { computed, ref, watch } from 'vue';
2231
import { Vigad } from '@/proc/Vigad';
2332
import { isRunning } from '@/composables/useRunning';
2433
@@ -41,6 +50,10 @@ interface MatchedElement {
4150
timestamp?: string;
4251
}
4352
53+
const matchedElementsIsEmpty = computed(() => {
54+
return matchedElements.value.length === 0;
55+
});
56+
4457
const matchedElements = ref<MatchedElement[]>([]);
4558
4659
let timerId: string | number | NodeJS.Timeout | undefined;
@@ -70,16 +83,6 @@ watch(isRunning, (newValue) => {
7083
clearTimeout(timerId);
7184
}
7285
});
73-
74-
function getCurrentTime() {
75-
let date = new Date();
76-
let hours = date.getHours();
77-
let minutes = '0' + date.getMinutes();
78-
let seconds = '0' + date.getSeconds();
79-
let formattedTime =
80-
hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
81-
return formattedTime;
82-
}
8386
</script>
8487

8588
<style lang="scss" scoped>

src/components/MainVideoStream.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
ref="drag"
2929
class="center-text"
3030
>
31-
CA: {{ captureArea.getId() }}
31+
<v-tooltip activator="parent" location="top"
32+
>Capture area: {{ captureArea.getId() }}</v-tooltip
33+
>
3234
</VueDragResize>
3335
</v-responsive>
3436
</div>

src/views/RunPage.vue

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@
1919
>
2020
</template>
2121
<template v-slot:default>
22-
<LogOutput
23-
v-for="captureArea in captureAreas"
24-
:key="captureArea.getId()"
25-
:captureAreaId="captureArea.getId()"
26-
/>
22+
<v-expansion-panels v-model="defaultOpenPanel" multiple>
23+
<LogOutput
24+
v-for="captureArea in captureAreas"
25+
:key="captureArea.getId()"
26+
:captureAreaId="captureArea.getId()"
27+
/>
28+
</v-expansion-panels>
2729
</template>
2830
</ViewComponent>
2931
</template>
3032

3133
<script setup lang="ts">
32-
import { onMounted, ref } from 'vue';
34+
import { ref } from 'vue';
3335
import ViewComponent from '@/components/ViewComponent.vue';
3436
import { useRunning, isRunning } from '@/composables/useRunning';
3537
import LogOutput from '@/components/LogOutput.vue';
@@ -44,6 +46,13 @@ const vigad = ref(Vigad.getInstance());
4446
* Get a reactive reference to all of the capture areas
4547
*/
4648
const captureAreas = ref(vigad.value.getAllCaptureAreas());
49+
50+
const defaultOpenPanel = ref<number[]>([0]);
4751
</script>
4852

49-
<style lang="scss" scoped></style>
53+
<style lang="scss" scoped>
54+
.output {
55+
display: flex;
56+
justify-content: row;
57+
}
58+
</style>

0 commit comments

Comments
 (0)