@innertia-solutions/nuxt-theme-spark 0.1.84 → 0.1.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const props = defineProps({ sidebar: { type: Boolean, default: false } })
|
|
3
|
+
|
|
4
|
+
const config = useRuntimeConfig()
|
|
5
|
+
const appEnv = config.public.appEnv
|
|
6
|
+
|
|
7
|
+
const isVisible = computed(() => appEnv && appEnv !== 'production')
|
|
8
|
+
|
|
9
|
+
useHead({
|
|
10
|
+
htmlAttrs: { class: (!props.sidebar && isVisible.value) ? 'has-env-bar' : '' },
|
|
11
|
+
style: [{ children: (!props.sidebar && isVisible.value) ? ':root { --env-bar-height: 1.5rem; }' : ':root { --env-bar-height: 0px; }' }],
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
const envColor = computed(() => {
|
|
15
|
+
const env = appEnv.toLowerCase()
|
|
16
|
+
if (env === 'staging') return props.sidebar ? 'bg-amber-50 text-amber-600 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/30' : 'bg-amber-500 text-white'
|
|
17
|
+
if (env === 'local' || env === 'dev') return props.sidebar ? 'bg-blue-50 text-blue-600 border border-blue-200 dark:bg-blue-500/10 dark:text-blue-400 dark:border-blue-500/30' : 'bg-blue-600 text-white'
|
|
18
|
+
return props.sidebar ? 'bg-red-50 text-red-600 border border-red-200 dark:bg-red-500/10 dark:text-red-400 dark:border-red-500/30' : 'bg-red-600 text-white'
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<!-- Sidebar inline variant -->
|
|
24
|
+
<div v-if="isVisible && sidebar"
|
|
25
|
+
:class="['w-full rounded-lg px-3 py-1.5 flex items-center justify-center gap-x-1.5 select-none', envColor]"
|
|
26
|
+
>
|
|
27
|
+
<span class="text-[9px] font-black tracking-widest uppercase">ENTORNO: {{ appEnv }}</span>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<!-- Full-width fixed bar -->
|
|
31
|
+
<div v-else-if="isVisible && !sidebar"
|
|
32
|
+
class="fixed bottom-0 left-0 right-0 z-[100] h-6 overflow-hidden select-none pointer-events-none"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
class="flex items-center justify-center w-full h-full text-[10px] font-bold tracking-widest uppercase opacity-90 shadow-lg border-t border-white/10"
|
|
36
|
+
:class="envColor"
|
|
37
|
+
>
|
|
38
|
+
<span class="mr-2">━━━━━</span>
|
|
39
|
+
ENTORNO: {{ appEnv }}
|
|
40
|
+
<span class="ml-2">━━━━━</span>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
package/components/Table.vue
CHANGED
|
@@ -154,7 +154,7 @@ const fetchData = async () => {
|
|
|
154
154
|
isDataFromCache.value = false
|
|
155
155
|
|
|
156
156
|
try {
|
|
157
|
-
const res = await api.
|
|
157
|
+
const res = await api.get(props.endpoint, { params: buildRequestParams() })
|
|
158
158
|
if (!res) return
|
|
159
159
|
|
|
160
160
|
tableData.value = Array.isArray(res.data) ? res.data : (Array.isArray(res) ? res : [])
|
|
@@ -392,7 +392,7 @@ const exportTable = async (format, exportAllPages, exportFilteredRows, selectedI
|
|
|
392
392
|
|
|
393
393
|
try {
|
|
394
394
|
const { blob, headers } = await download(props.endpoint, params, {
|
|
395
|
-
method: '
|
|
395
|
+
method: 'GET',
|
|
396
396
|
onProgress: (p) => toast.update(id, { progress: p, progressLabel: `Descargando... ${p}%` }),
|
|
397
397
|
})
|
|
398
398
|
|