update
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
<!-- Container Principal -->
|
||||
<div x-data="modals" @keydown.escape="closeModal" class="bg-white rounded-lg shadow">
|
||||
<div class="container mx-auto p-6 w-full ">
|
||||
<h1 class="text-2xl font-bold mb-4">Oficina Virtual</h1>
|
||||
<div class="justify-between w-full md:flex">
|
||||
<p class="mb-4 text-sm">Bienvenido a la oficina virtual de GASES DEL ORIENTE S.A E.S.P</p>
|
||||
<a href="/"><button type="submit" class="bg-[#8eb02f] text-white px-4 py-2 rounded flex space-x-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-5">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18" />
|
||||
</svg>
|
||||
<p> Volver a la pagina principal </p>
|
||||
</button>
|
||||
</a>
|
||||
|
||||
<!-- Agregar el GIF de carga -->
|
||||
<div x-show="loading" class="fixed inset-0 bg-gray-800 bg-opacity-75 flex z-50 justify-center items-center">
|
||||
<img src="../img/loading.gif" alt="Cargando..." class="w-16 h-16" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
@@ -1,10 +1,22 @@
|
||||
<h1>{{.Title}}</h1>
|
||||
{{if .user}}
|
||||
Hello, {{.user.FirstName}} - ID: {{.user.ID}}!
|
||||
<!-- Container Principal -->
|
||||
<div x-data="modals" @keydown.escape="closeModal" class="bg-white rounded-lg shadow">
|
||||
<div class="container mx-auto p-6 w-full ">
|
||||
<h1 class="text-2xl font-bold mb-4">Oficina Virtual</h1>
|
||||
<div class="justify-between w-full md:flex">
|
||||
<p class="mb-4 text-sm">Bienvenido a la oficina virtual de Usite</p>
|
||||
<a href="/"><button type="submit" class="bg-[#8eb02f] text-white px-4 py-2 rounded flex space-x-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" class="w-5">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18" />
|
||||
</svg>
|
||||
<p> Volver a la pagina principal </p>
|
||||
</button>
|
||||
</a>
|
||||
|
||||
<!-- Agregar el GIF de carga -->
|
||||
<div x-show="loading" class="fixed inset-0 bg-gray-800 bg-opacity-75 flex z-50 justify-center items-center">
|
||||
<img src="../img/loading.gif" alt="Cargando..." class="w-16 h-16" />
|
||||
</div>
|
||||
|
||||
|
||||
<script src="/js/payment.js"></script>
|
||||
{{end}}
|
||||
<script src="/js/manifest.js"></script>
|
||||
<script src="/js/vendor.js"></script>
|
||||
{{template "partials/footer" .}}
|
||||
</div>
|
||||
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Gases del Oriente</title>
|
||||
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<!-- Cargar jQuery primero -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<!-- Luego cargar Select2 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
||||
<style>
|
||||
[x-cloak] {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-200 w-full">
|
||||
<main class="flex justify-between w-full">
|
||||
<div class="w-full px-3 py-3 h-[calc(100vh-64px)] overflow-auto">
|
||||
{{embed}}
|
||||
</div>
|
||||
</main>
|
||||
<div x-data="sessionTimeout" x-init="init()" x-cloak class="hidden sm:block">
|
||||
<!-- Contador General de Inactividad -->
|
||||
<div x-show="!showModal" class="fixed top-2 right-20 border text rounded-lg p-2 bg-gray-100 text-sm">
|
||||
<p>Tiempo restante: <span x-text="formatTime(inactivityCountdown)"></span></p>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div x-show="showModal" class="fixed inset-0 flex items-center justify-center bg-gray-800 bg-opacity-75">
|
||||
<div class="bg-white rounded-lg shadow-md p-8 w-[600px] relative">
|
||||
<h2 class="text-xl font-bold mb-6 text-center">¿Deseas continuar?</h2>
|
||||
<p class="text-gray-600 mb-6 text-center text-base">
|
||||
Has estado inactivo. Elige "Continuar" para seguir con tu sesión o "Cerrar sesión" para salir.
|
||||
</p>
|
||||
<!-- Contador del tiempo para responder -->
|
||||
<p class="text-center text-red-500 font-semibold mb-4">
|
||||
Tiempo para responder: <span x-text="countdown"></span> seg
|
||||
</p>
|
||||
<div class="flex justify-around">
|
||||
<button @click="continueSession"
|
||||
class="px-6 py-3 bg-[#8eb02f] text-white text-base rounded-lg hover:bg-[#698126]">
|
||||
Continuar
|
||||
</button>
|
||||
<form action="/do/logout" method="POST" class="inline-block">
|
||||
<button type="submit"
|
||||
class="px-6 py-3 bg-gray-500 text-white text-base rounded-lg hover:bg-gray-600">
|
||||
Cerrar sesión
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,22 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
// RENDER
|
||||
func Index(c *fiber.Ctx) error {
|
||||
data := fiber.Map{
|
||||
//"user": c.Locals("user").(map[string]interface{}),
|
||||
//"modules": c.Locals("userModules"),
|
||||
}
|
||||
|
||||
// Renderiza la vista con el layout layouts/main
|
||||
if err := c.Render("index", data, "layouts/public"); err != nil {
|
||||
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||
"message": "Error rendering template",
|
||||
"error": err.Error(),
|
||||
})
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/sujit-baniya/fiber-boilerplate/rest/controllers"
|
||||
"github.com/sujit-baniya/fiber-boilerplate/rest/middlewares"
|
||||
)
|
||||
|
||||
func RutasPublicas(web fiber.Router) {
|
||||
//web.Get("/", controllers.Landing)
|
||||
web.Get("/index", controllers.Index)
|
||||
web.Get("/ping", Pong)
|
||||
web.Get("/all-routes", AllRoutes)
|
||||
web.Get("/do/verify-email", middlewares.ValidateConfirmToken, controllers.VerifyRegisteredEmail)
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -15,20 +15,4 @@ func LoadRoutes(app *fiber.App) {
|
||||
// Rutas del backend (web)
|
||||
WebRoutes(web)
|
||||
|
||||
vue := app.Group("")
|
||||
// Sirve archivos estáticos de Vue.js desde la carpeta 'dist'
|
||||
vue.Static("/", "./dist") // Sirve archivos estáticos de Vue.js
|
||||
|
||||
// Ruta para acceder a los archivos subidos
|
||||
vue.Get("/uploads/:filename", func(c *fiber.Ctx) error {
|
||||
filename := c.Params("filename")
|
||||
// Devuelve el archivo solicitado desde 'uploads'
|
||||
return c.SendFile("./uploads/" + filename)
|
||||
})
|
||||
|
||||
// Ruta wildcard para manejar las rutas del frontend (SPA)
|
||||
vue.Get("/*", func(c *fiber.Ctx) error {
|
||||
return c.SendFile("./dist/index.html")
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import (
|
||||
func WebRoutes(web fiber.Router) {
|
||||
// Aplicar el middleware para desactivar el caché
|
||||
web.Use(middlewares.LoadCacheHeaders)
|
||||
//publicas
|
||||
RutasPublicas(web)
|
||||
// Rutas específicas del backend
|
||||
LandingRoutes(web)
|
||||
WebAuthRoutes(web)
|
||||
|
||||
Reference in New Issue
Block a user