diff --git a/components/displayRunningTime.vue b/components/displayRunningTime.vue
index 291d3d4..643f675 100644
--- a/components/displayRunningTime.vue
+++ b/components/displayRunningTime.vue
@@ -7,9 +7,18 @@ const toast = useToast()
const runningTimeInfo = ref({})
+const projects = ref([])
+const platform = ref("default")
+
const setupPage = async () => {
- runningTimeInfo.value = (await supabase.from("workingtimes").select().eq("profile", profileStore.activeProfile.id).is("endDate", null).single()).data || {}
- console.log(runningTimeInfo.value)
+ runningTimeInfo.value = (await supabase.from("times").select().eq("profile", profileStore.activeProfile.id).is("endDate", null).single()).data || {}
+
+ projects.value = (await useSupabaseSelect("projects"))
+
+ if(await useCapacitor().getIsPhone()) {
+ platform.value = "mobile"
+ }
+
}
setupPage()
@@ -24,12 +33,12 @@ const startTime = async () => {
profile: profileStore.activeProfile.id,
startDate: dayjs(),
tenant: profileStore.currentTenant,
- state: "Im Web gestartet",
+ state: platform.value === "mobile" ? "In der App gestartet" : "Im Web gestartet",
source: "Dashboard"
}
const {data,error} = await supabase
- .from("workingtimes")
+ .from("times")
.insert([runningTimeInfo.value])
.select()
if(error) {
@@ -38,16 +47,16 @@ const startTime = async () => {
} else if(data) {
toast.add({title: "Zeit erfolgreich gestartet"})
runningTimeInfo.value = data[0]
- console.log(runningTimeInfo.value)
+ //console.log(runningTimeInfo.value)
}
}
const stopStartedTime = async () => {
runningTimeInfo.value.endDate = dayjs()
- runningTimeInfo.value.state = "Im Web gestoppt"
+ runningTimeInfo.value.state = platform.value === "mobile" ? "In der App gestoppt" : "Im Web gestoppt"
const {error,status} = await supabase
- .from("workingtimes")
+ .from("times")
.update(runningTimeInfo.value)
.eq('id',runningTimeInfo.value.id)
@@ -79,6 +88,20 @@ const stopStartedTime = async () => {
v-model="runningTimeInfo.notes"
/>
+
Keine Anwesenheit gestartet
+Keine Zeit gestartet