Sfoglia il codice sorgente

Añadido Acerca de...

Celestino Rey 1 anno fa
parent
commit
dbf3a90374

+ 1 - 2
K8S/Makefile

@@ -1,8 +1,7 @@
 export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
 export REGISTRY=registry.reymota.es
-export IMG_VERSION = 0.70
+export IMG_VERSION = 0.72
 export IMG_NGINX_VERSION = 1.0
-export APP_VERSION = 12.0
 
 # limpia todo
 all: imagen clean install

+ 1 - 0
K8S/env-prod-configmap.yaml

@@ -2,6 +2,7 @@ apiVersion: v1
 data:
   DEBUG: "False"
   ENTORNO: "Producción"
+  APP_VERSION: 15.0.0
   SECRET_KEY: change_me
   SQL_HOST: postgresql
   SQL_PORT: "5432"

+ 7 - 2
K8S/reymota-deployment.yaml

@@ -39,8 +39,8 @@ spec:
         name: reymota
         image: $REGISTRY/reymota-$ARQUITECTURA:$IMG_VERSION
         env:
-        - name: APP_VERSION
-          value: "$APP_VERSION"
+        - name: IMG_VERSION
+          value: "$IMG_VERSION"
         - name: OPENSHIFT
           value: "False"
         - name: ENVIRONMENT
@@ -53,6 +53,11 @@ spec:
             configMapKeyRef:
               key: DEBUG
               name: env-prod
+        - name: APP_VERSION
+          valueFrom:
+            configMapKeyRef:
+              key: APP_VERSION
+              name: env-prod
         - name: DATABASE
           valueFrom:
             configMapKeyRef:

+ 1 - 1
README.md

@@ -12,7 +12,7 @@ Crear un proyecto.
 
 A continuación añadir una app desde Agregar, importar desde git.
 
-    oc new-app http://gitea.reymota.es/creylopez/ReyMotaAppsOC.git -e APP_VERSION="12.0.0" -e DEBUG="False" -e OPENSHIFT="True" --name='reymota'
+    oc new-app http://gitea.reymota.es/creylopez/ReyMotaAppsOC.git -e APP_VERSION="15.0.0" -e DEBUG="False" -e OPENSHIFT="True" --name='reymota'
 
 Tal y como está la estructura de directorios, deberia detectar automáticamente una compilación Python
 

+ 4 - 1
src/reymota/settings.py

@@ -14,8 +14,11 @@ from pathlib import Path
 import os
 import logging
 
-# APP_VERSION = "11.0.2"
+
+APP_NAME = "Reymota.es"
 APP_VERSION = os.environ.get("APP_VERSION", "0.0.0-dev")  # Valor por defecto si no está definido
+IMG_VERSION = os.environ.get("IMG_VERSION", "0.0.0-dev")  # Valor por defecto si no está definido
+
 
 # Build paths inside the project like this: BASE_DIR / 'subdir'.
 BASE_DIR = Path(__file__).resolve().parent.parent

+ 2 - 0
src/reymota/urls.py

@@ -40,4 +40,6 @@ urlpatterns = [
 
     path('usuarios/', include("reymotausers.urls")),
 
+    path("acerca-de/", views.acerca_de, name="acerca_de"),
+
 ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

+ 9 - 0
src/reymota/views.py

@@ -29,3 +29,12 @@ def ver_variables_entorno(request):
     }
 
     return render(request, 'ver_entorno.html', contexto)
+
+
+def acerca_de(request):
+    context = {
+        "app_name": settings.APP_NAME,
+        "app_version": settings.APP_VERSION,
+        "img_version": settings.IMG_VERSION
+    }
+    return render(request, "acerca_de.html", context)

+ 21 - 0
src/templates/acerca_de.html

@@ -0,0 +1,21 @@
+{% extends "base.html" %}
+
+{% block content %}
+<div class="container-xl">
+    <h1 class="app-page-title">Acerca de...</h1>
+    <div class="row g-4">
+        <div class="col-12 col-md-6">
+            <div class="app-card app-card-basic d-flex flex-column align-items-start shadow-sm">
+                <div class="app-card-body px-4">
+                    <ul class="list-unstyled">
+                        <li><strong>Nombre de la aplicación:</strong> {{ app_name }}</li>
+                        <li><strong>Versión:</strong> {{ app_version }}</li>
+                        <li><strong>Versión de la imagen:</strong> {{ img_version }}</li>
+                    </ul>
+                </div><!--//app-card-body-->
+            </div><!--//app-card-->
+        </div><!--//col-->
+    </div><!--//row-->
+</div>
+{% endblock %}
+

+ 13 - 0
src/templates/base.html

@@ -142,6 +142,19 @@
                         </div>
                     </li><!--//nav-item-->
                     {% endif %}
+
+                    <li class="nav-item">
+                        <!--//Bootstrap Icons: https://icons.getbootstrap.com/ -->
+                        <a class="nav-link" href="{% url 'acerca_de' %}">
+                           <span class="nav-icon">
+                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-exclamation-square" viewBox="0 0 16 16">
+                              <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/>
+                              <path d="M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0M7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z"/>
+                            </svg>
+                            </span>
+                                <span class="nav-link-text">Acerca de...</span>
+                        </a><!--//nav-link-->
+                    </li><!--//nav-item-->
                 </ul><!--//app-menu-->
             </nav><!--//app-nav-->           
         </div><!--//sidepanel-inner-->