@@ -8,7 +8,7 @@ from apps.cloudmanager.db_interaction import DB_generation,Check_server_supposed
|
||||
def hello(request):
|
||||
list_schedule = ['schedule1','schedule2']
|
||||
list_servers_up = [['wiki', 'wikijs', 2], ['book', 'bookstack-db', 1]]
|
||||
return render(request, 'index.html', {'list_schedule':list_schedule,'list_servers_up':list_servers_up})
|
||||
return render(request, 'cloudmanager/index.html', {'list_schedule':list_schedule,'list_servers_up':list_servers_up})
|
||||
|
||||
def print(request):
|
||||
print("Im here")
|
||||
@@ -26,5 +26,5 @@ def redirect(request):
|
||||
|
||||
list_servers_up = Check_server_supposed_XXX(generated_db, "up", Give_current_hour(),Give_current_weekday())
|
||||
print(list_servers_up)
|
||||
return render(request, 'cmm_blank_page.html', {'list_servers_up':list_servers_up})
|
||||
return render(request, 'cloudmanager/cmm_blank_page.html', {'list_servers_up':list_servers_up})
|
||||
|
||||
|
||||
@@ -3,19 +3,19 @@ from django.shortcuts import render
|
||||
|
||||
def home(request):
|
||||
thislist = ["apple", "banana", "cherry"]
|
||||
return render(request, 'home.html',{'thislist': thislist})
|
||||
return render(request, 'dashboard/home.html',{'thislist': thislist})
|
||||
|
||||
def about(request):
|
||||
thislist = ["apple", "banana", "cherry"]
|
||||
return render(request, 'about.html',{'thislist': thislist})
|
||||
return render(request, 'dashboard/about.html',{'thislist': thislist})
|
||||
|
||||
def success(request):
|
||||
return render(request, 'start.html',{'deployment': 'django','url':'https://google.com'})
|
||||
return render(request, 'dashboard/start.html',{'deployment': 'django','url':'https://google.com'})
|
||||
|
||||
def scale_up(request,namespace_name,deploy_name):
|
||||
baseurl = "{0}://{1}{2}".format(request.scheme, request.get_host(), request.path)
|
||||
return render(request, 'start.html', {'namespace':namespace_name,'deployment': deploy_name, 'url': 'https://namespace.com','baseurl': baseurl})
|
||||
return render(request, 'dashboard/start.html', {'namespace':namespace_name,'deployment': deploy_name, 'url': 'https://namespace.com','baseurl': baseurl})
|
||||
|
||||
def scale_down(request,namespace_name,deploy_name):
|
||||
baseurl = "{0}://{1}{2}".format(request.scheme, request.get_host(), request.path)
|
||||
return render(request, 'shutdown.html', {'namespace':namespace_name,'deployment': deploy_name, 'url': 'https://namespace.com','baseurl': baseurl})
|
||||
return render(request, 'dashboard/shutdown.html', {'namespace':namespace_name,'deployment': deploy_name, 'url': 'https://namespace.com','baseurl': baseurl})
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@@ -0,0 +1,9 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class DatabaseInteractionConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'apps.database_interaction'
|
||||
|
||||
def return_hello():
|
||||
return "hello"
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
@@ -29,7 +29,7 @@ def scale_up(request,namespace_name,deploy_name,replicas=1):
|
||||
resp = api.patch_namespaced_deployment(
|
||||
name=deploy_name, namespace=namespace_name, body=deployment);
|
||||
#return HttpResponse('<h1>Scaled up !</h1>')
|
||||
return render(request, 'start.html', {'namespace':namespace_name,'deployment': deploy_name, 'url': 'https://namespace.com'})
|
||||
return render(request, 'dashboard/start.html', {'namespace':namespace_name,'deployment': deploy_name, 'url': 'https://namespace.com'})
|
||||
|
||||
|
||||
def scale_down(request,namespace_name,deploy_name):
|
||||
@@ -40,7 +40,7 @@ def scale_down(request,namespace_name,deploy_name):
|
||||
resp = api.patch_namespaced_deployment(
|
||||
name=deploy_name, namespace=namespace_name, body=deployment);
|
||||
#return HttpResponse('<h1>Scaled down !</h1>')
|
||||
return render(request, 'shutdown.html',
|
||||
return render(request, 'dashboard/shutdown.html',
|
||||
{'namespace': namespace_name, 'deployment': deploy_name, 'url': 'https://namespace.com'})
|
||||
|
||||
def Import_Deployments():
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
from django.apps import AppConfig
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
from django.shortcuts import redirect
|
||||
#from django.template.loader import render_to_string
|
||||
from django.template import loader
|
||||
#import time
|
||||
#import random
|
||||
|
||||
def hello(request):
|
||||
# htmlContent = '
|
||||
#<!DOCTYPE html>
|
||||
#<html lang="en">
|
||||
#<body>
|
||||
#<strong>Hello World from const</strong>
|
||||
#</body>
|
||||
#</html>
|
||||
#'
|
||||
# response = "coucou"
|
||||
# context = {'response': HttpResponse(response)}
|
||||
# return HttpResponse(htmlContent)
|
||||
# return HttpResponse('<h1>Hello onenote! <h1>')
|
||||
# return render(request, 'hello.html', context)
|
||||
|
||||
template = loader.get_template('onenote/hello.html')
|
||||
# template = loader.get_template('onenote/Roser.mht')
|
||||
return HttpResponse(template.render())
|
||||
@@ -1,6 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<body>
|
||||
<strong>Hello World</strong>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,16 +0,0 @@
|
||||
from django.apps import AppConfig
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
from django.shortcuts import redirect
|
||||
import time
|
||||
import random
|
||||
|
||||
def hello(request):
|
||||
return HttpResponse('<h1>Hello paperless! <h1>')
|
||||
|
||||
def redirect_authenticated(request):
|
||||
|
||||
final_url = "https://paperless.tryton.geeraert.eu/"
|
||||
print(final_url)
|
||||
|
||||
return redirect(str(final_url))
|
||||
@@ -63,7 +63,7 @@ def download_mo(request,file):
|
||||
return response
|
||||
|
||||
#def template(request):
|
||||
# rendered = render_to_string("my_template.html", {"foo": "bar"})
|
||||
# rendered = render_to_string("random_simpsons/my_template.html", {"foo": "bar"})
|
||||
#return HttpResponse('<h1>Hello !</h1>')
|
||||
|
||||
def simpsons(request):
|
||||
|
||||
@@ -38,11 +38,11 @@ destination_folder = "/stash/"
|
||||
def hello(request):
|
||||
return HttpResponse('<h1>Hello stash!</h1>')
|
||||
def form(request):
|
||||
return render(request, 'stash_form.html',{})
|
||||
return render(request, 'stash/stash_form.html',{})
|
||||
def album(request):
|
||||
return render(request, 'album_form.html',{})
|
||||
return render(request, 'stash/album_form.html',{})
|
||||
def simple(request):
|
||||
return render(request, 'simple_form.html',{})
|
||||
return render(request, 'stash/simple_form.html',{})
|
||||
def check_and_create_destination_folder(name):
|
||||
#check if the output directory exist and create if not
|
||||
if not os.path.isdir(destination_folder):
|
||||
@@ -179,7 +179,7 @@ def redgif_donloader(username):
|
||||
#and you get the URLS , needs to be parsedw
|
||||
return 0
|
||||
def incremental(request):
|
||||
return render(request, 'incremental_form.html',{})
|
||||
return render(request, 'stash/incremental_form.html',{})
|
||||
|
||||
def incremental_form(request):
|
||||
name = request.GET.get('name')
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<h1>Hello template!</h1>
|
||||
@@ -9,4 +9,4 @@ def hello(request):
|
||||
|
||||
|
||||
def home(request):
|
||||
return render(request, 'listing.html')
|
||||
return render(request, 'stash/listing.html')
|
||||
|
||||
@@ -14,7 +14,7 @@ def hello(request):
|
||||
|
||||
|
||||
def redirect(request):
|
||||
return render(request, 'redirect_form.html',{})
|
||||
return render(request, 'website_redirection/redirect_form.html',{})
|
||||
|
||||
def clearkey_process(request):
|
||||
key = request.GET.get('key')
|
||||
@@ -45,7 +45,7 @@ def redirect_to_key(request,key):
|
||||
if icon_url == None:
|
||||
icon_url = "https://cdn-icons-png.flaticon.com/512/6402/6402576.png"
|
||||
print(key+" is not setup, displaying default page")
|
||||
return render(request, 'blank_page.html', {'title': key,'icon_url':icon_url})
|
||||
return render(request, 'website_redirection/blank_page.html', {'title': key,'icon_url':icon_url})
|
||||
else:
|
||||
value_extracted = str(value.decode('utf-8'))
|
||||
print(key+" is setup to : "+value_extracted)
|
||||
|
||||
@@ -41,6 +41,7 @@ INSTALLED_APPS = [
|
||||
'bootstrap5',
|
||||
'django_hosts',
|
||||
'apps.cloudmanager',
|
||||
'apps.database_interaction',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
@@ -64,7 +65,9 @@ TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
#'DIRS': ["/code/django_code/templates","/code/django_code/dashboard/templates/"],
|
||||
'DIRS': [BASE_DIR / "templates","django_code/dashboard/templates/","django_code/stash_management/templates","django_code/website_redirection/templates","django_code/cloudmanager/templates"],
|
||||
'DIRS': [
|
||||
BASE_DIR / "templates"
|
||||
],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
@@ -127,9 +130,12 @@ USE_TZ = True
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
STATIC_ROOT= os.path.join(BASE_DIR,'django_code/apps/cloudmanager/templates/')
|
||||
|
||||
STATICFILES_DIRS = ["django_code/apps/cloudmanager/templates/css","django_code/apps/cloudmanager/templates/fonts","django_code/apps/cloudmanager/templates/images","django_code/apps/cloudmanager/templates/js"]
|
||||
STATICFILES_DIRS = [
|
||||
BASE_DIR / "templates/cloudmanager/css",
|
||||
BASE_DIR / "templates/cloudmanager/fonts",
|
||||
BASE_DIR / "templates/cloudmanager/images",
|
||||
BASE_DIR / "templates/cloudmanager/js"
|
||||
]
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
||||
@@ -141,6 +147,6 @@ CELERY_BROKER_URL = "redis://django-redis-svc:6379"
|
||||
CELERY_RESULT_BACKEND = "redis://django-redis-svc:6379"
|
||||
|
||||
CELERY_IMPORTS = [
|
||||
'stash_management.apps', # This line imports the tasks.py file
|
||||
'apps.stash_management.apps', # This line imports the tasks.py file
|
||||
# Add other app tasks here if needed
|
||||
]
|
||||
|
||||
@@ -20,8 +20,6 @@ from apps.cloudmanager import (credentials,db_interaction)
|
||||
from apps.cloudmanager import apps as cloudmanager_apps
|
||||
from apps.cloudmanager import views as cloudmanager_views
|
||||
from apps.random_simpsons import apps as random_simpsons
|
||||
from apps.paperless_django import apps as paperless_django
|
||||
from apps.onenote import apps as onenote
|
||||
from apps.dashboard import apps as dashboardapp
|
||||
from apps.dashboard import views as dashboardview
|
||||
from apps.kubernetes_connection import apps as kubernetes_connection
|
||||
@@ -46,14 +44,6 @@ urlpatterns = [
|
||||
path('redirect/redirect-form/', website_redirectionapp.redirect_process, name='submit_form'),
|
||||
path('redirect/clearkey/', website_redirectionapp.clearkey_process, name='submit_form'),
|
||||
|
||||
|
||||
################### paperless ###################
|
||||
path('paperless/hello/', paperless_django.hello),
|
||||
# path('simpsons/', random_simpsons.simpsons),
|
||||
|
||||
################### onenote ###################
|
||||
path('onenote/hello/', onenote.hello),
|
||||
|
||||
################### onenote ###################
|
||||
path('dashboard/hello/', dashboardapp.hello),
|
||||
path('dashboard/view/about', dashboardview.about),
|
||||
|
||||
|
Before Width: | Height: | Size: 434 KiB After Width: | Height: | Size: 434 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 184 KiB |
|
Before Width: | Height: | Size: 281 KiB After Width: | Height: | Size: 281 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 121 B After Width: | Height: | Size: 121 B |
|
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 142 B |
|
Before Width: | Height: | Size: 137 B After Width: | Height: | Size: 137 B |
|
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 136 B |
|
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 142 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 227 B |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 206 KiB After Width: | Height: | Size: 206 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |