From 1c667cf0cec3df777a17c2d42cb9e0e11fd0a15c Mon Sep 17 00:00:00 2001 From: Wiktor-Wojciechowski <109503651+Wiktor-Wojciechowski@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:00:02 +0200 Subject: [PATCH] changed colors json, colors still not working --- resources/data/colors.json | 23 ++++++++++------------- resources/js/Pages/Repositories.vue | 14 ++++++++++---- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/resources/data/colors.json b/resources/data/colors.json index c29a2ec1..f6c392fc 100644 --- a/resources/data/colors.json +++ b/resources/data/colors.json @@ -1,13 +1,10 @@ -{ - "colors": [ - "bg-gray-400", - "bg-blue-400", - "bg-red-400", - "bg-green-400", - "bg-yellow-400", - "bg-indigo-400", - "bg-purple-400", - "bg-pink-400" - ] - } - \ No newline at end of file +[ +"bg-gray-400", +"bg-blue-400", +"bg-red-400", +"bg-green-400", +"bg-yellow-400", +"bg-indigo-400", +"bg-purple-400", +"bg-pink-400" +] diff --git a/resources/js/Pages/Repositories.vue b/resources/js/Pages/Repositories.vue index 41e435ec..610930dc 100644 --- a/resources/js/Pages/Repositories.vue +++ b/resources/js/Pages/Repositories.vue @@ -10,7 +10,9 @@ const colors = ref([]) async function fetchColors() { const response = await fetch('api/data/colors') const data = await response.json() - return data.colors + return new Promise((resolve, reject) => { + resolve((data)) + }) } const logsStore = useLogsStore() @@ -117,10 +119,14 @@ async function parseLogs(){ const data = Papa.parse(logs.value) const parsedData = data.data - colors.value = await fetchColors() + fetchColors().then((response)=>{ + colors.value = response + console.log(colors.value) + + var parsed = parsedData.slice(1,-1).map((line) => parseLineToLog(line)) + tables.value.logs.items = parsed + }) - var parsed = parsedData.slice(1,-1).map((line) => parseLineToLog(line)) - tables.value.logs.items = parsed }