Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
fe6e6a0
mejoras css
NIOY-5677 Apr 1, 2025
5f27810
Uhs
NIOY-5677 Apr 1, 2025
255de5b
Footer
NIOY-5677 Apr 1, 2025
3fdcd70
Footer UPdate
NIOY-5677 Apr 1, 2025
e3b3365
Ceo mejorado
NIOY-5677 Apr 1, 2025
302910c
INA FREE
NIOY-5677 Apr 1, 2025
2fdc9f1
Subir con texto
NIOY-5677 Apr 1, 2025
32da443
Nombre de subida
NIOY-5677 Apr 1, 2025
8679ab1
wtf
NIOY-5677 Apr 1, 2025
191e047
ADS
NIOY-5677 Apr 1, 2025
d4270d3
ADS
NIOY-5677 Apr 1, 2025
6cf499b
Update Mejorado
NIOY-5677 Apr 2, 2025
90694ad
Error 404
NIOY-5677 Apr 2, 2025
eb8712f
EXE
NIOY-5677 Apr 2, 2025
835156e
Mejoras del la UX
NIOY-5677 Apr 2, 2025
8d0be26
Qr y Mejoras en subida de datos
NIOY-5677 Apr 2, 2025
75cf50d
10 megas maxicmo
NIOY-5677 Apr 2, 2025
8424a7e
MEjora de carga de img
NIOY-5677 Apr 2, 2025
a955847
INA FREE
NIOY-5677 Apr 2, 2025
14eedb7
Sin border
NIOY-5677 Apr 2, 2025
125881d
LEy
NIOY-5677 Apr 2, 2025
fbb2a20
AW
NIOY-5677 Apr 2, 2025
16b1434
Alerta
NIOY-5677 Apr 2, 2025
f35596f
FREE
NIOY-5677 Apr 2, 2025
89ba3b3
Alertas agregadas
NIOY-5677 Apr 2, 2025
ea3759c
Alertas
NIOY-5677 Apr 2, 2025
20fcff6
FREE
NIOY-5677 Apr 2, 2025
c73d976
NUevos comunicados
NIOY-5677 Apr 2, 2025
c575894
R
NIOY-5677 Apr 2, 2025
0dd320a
Debug 0
NIOY-5677 Apr 2, 2025
97500db
C
NIOY-5677 Apr 2, 2025
3bcc037
Mejoras en css
NIOY-5677 Apr 2, 2025
fd8ceb9
Contactos
NIOY-5677 Apr 2, 2025
de2b078
Mejoras en el texto
NIOY-5677 Apr 3, 2025
065521e
Mejoras de rendimiento
NIOY-5677 Apr 3, 2025
d643c72
Error solucionado
NIOY-5677 Apr 3, 2025
9931bff
Mejoras pequeñas
NIOY-5677 Apr 3, 2025
5436dab
Logos Agregados
NIOY-5677 Apr 3, 2025
5d3c10f
un + de más xd
NIOY-5677 Apr 3, 2025
d362e4b
Trabajo hecho
NIOY-5677 Apr 3, 2025
110ba9d
AAAAAA
Ezxquiel Apr 3, 2025
f342b5e
Mejoras
NIOY-5677 Apr 3, 2025
8398ef3
Mejoraw
NIOY-5677 Apr 3, 2025
5720523
Mejoras
NIOY-5677 Apr 3, 2025
a2d6226
Mejoras
NIOY-5677 Apr 3, 2025
7a361c2
Mejoras
NIOY-5677 Apr 4, 2025
fb34799
IMG
NIOY-5677 Apr 4, 2025
33b7021
Reacciones
NIOY-5677 Apr 4, 2025
9dd1ded
Create File
NIOY-5677 Apr 4, 2025
90ca309
Rplace
NIOY-5677 Apr 4, 2025
afbfe21
Merge branch 'Developer' of https://github.com/NioyJadelkaFp/NetDrop …
NIOY-5677 Apr 4, 2025
c3067bc
retorno mi bto
NIOY-5677 Apr 4, 2025
e03a953
wataa
NIOY-5677 Apr 4, 2025
7aa0517
JEJEJE
NIOY-5677 Apr 4, 2025
c01151e
W
NIOY-5677 Apr 10, 2025
196d0dc
Para subir a render
NIOY-5677 Apr 14, 2025
7b84701
GOOD
NIOY-5677 Apr 20, 2025
b1b2beb
sevira
NIOY-5677 Apr 20, 2025
25862db
<
NIOY-5677 Apr 20, 2025
fabb917
Mejoras
NIOY-5677 Apr 20, 2025
02d9c7e
Delete static/File/Metas.jpg
NIOY-5677 Apr 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ Pipfile.lock
*.envrc
.env

File/
Qr/
26 changes: 26 additions & 0 deletions Comunicados.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"titulo": "Nueva Actualización",
"autor": "@Nioy - Developer",
"texto": "Mejor formato, ajuste de la forma visual de la web y corrección de errores menores.",
"fecha": "2025-04-20T00:00:00Z"
},
{
"titulo": "Nueva Actualización",
"autor": "@Nioy - Developer",
"texto": "En esta actualización, presentamos un nuevo apartado diseñado para mantener informada a nuestra comunidad sobre actualizaciones, reclamos y la incorporación de nuevos miembros a nuestro equipo de desarrollo.",
"fecha": "2025-04-02T00:00:00Z"
},
{
"titulo": "Aviso Importante",
"autor": "@Admin - Support",
"texto": "Hemos implementado mejoras en la sección de publicaciones de la comunidad, así como un nuevo apartado de sugerencias para que los usuarios puedan contribuir con ideas para optimizar la plataforma.",
"fecha": "2025-04-05T00:00:00Z"
},
{
"titulo": "Nuevo Logo de Favicon y Compartir",
"autor": "@Admin - Support",
"texto": "Hemos agregado un nuevo logo como favicon para la web y una imagen representativa para mostrar al compartir la web en redes sociales. Ahora, la experiencia visual es más coherente y atractiva.",
"fecha": "2025-04-05T00:00:00Z"
}
]
30 changes: 0 additions & 30 deletions Funciones/Qr_Generator.py

This file was deleted.

1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn app:app
214 changes: 166 additions & 48 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,89 +1,207 @@
from flask import Flask, redirect, render_template, send_file, request
from Funciones import Qr_Generator
from flask import Flask, redirect, render_template, send_file, request, jsonify, session
from Funciones import Show_File as Show_File
from flask_socketio import SocketIO, send
from flask_socketio import SocketIO
import os
import webbrowser
import socket as sok
import json
import secrets

Files_Carpet = './static/File/'

app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret'
app.secret_key = secrets.token_hex(16)
socketio = SocketIO(app)

Qr_Generator.Generar_QR()
REACTIONS_FILE = 'reactions.json'

USER_REACTIONS_FILE = 'user_reactions.json'

def init_reactions():
if not os.path.exists(REACTIONS_FILE):
with open(REACTIONS_FILE, 'w') as f:
json.dump({}, f)


with open(REACTIONS_FILE, 'r') as f:
try:
return json.load(f)
except json.JSONDecodeError:
return {}

def init_user_reactions():
if not os.path.exists(USER_REACTIONS_FILE):
with open(USER_REACTIONS_FILE, 'w') as f:
json.dump({}, f)


with open(USER_REACTIONS_FILE, 'r') as f:
try:
return json.load(f)
except json.JSONDecodeError:
return {}


def save_reactions(reactions_data):
with open(REACTIONS_FILE, 'w') as f:
json.dump(reactions_data, f)


def save_user_reactions(user_reactions_data):
with open(USER_REACTIONS_FILE, 'w') as f:
json.dump(user_reactions_data, f)

@app.route('/login')
def Login():
return render_template('Login.html')

@app.route('/')
def index():

if 'user_id' not in session:
session['user_id'] = secrets.token_hex(8)

File = Show_File.Show_File()
reactions = init_reactions()
user_reactions = init_user_reactions()
user_id = session['user_id']

for file in File:
file_id = file['nombre']
if file_id in reactions:
file['likes'] = reactions[file_id].get('likes', 0)
file['dislikes'] = reactions[file_id].get('dislikes', 0)
file['love'] = reactions[file_id].get('love', 0)
file['laugh'] = reactions[file_id].get('laugh', 0)

file['user_reacted'] = False
file['user_reaction'] = None

if user_id in user_reactions and file_id in user_reactions[user_id]:
file['user_reacted'] = True
file['user_reaction'] = user_reactions[user_id][file_id]
else:
file['likes'] = 0
file['dislikes'] = 0
file['love'] = 0
file['laugh'] = 0
file['user_reacted'] = False
file['user_reaction'] = None

# Calcula el total de reacciones
file['total_reacciones'] = file['likes'] + file['dislikes'] + file['love'] + file['laugh']

# Ordenar la lista por total de reacciones (de mayor a menor)
File.sort(key=lambda f: f['total_reacciones'], reverse=True)

return render_template('index.html', File=File)


@app.route('/react/<string:file_name>/<string:reaction_type>', methods=['POST'])
def react_to_file(file_name, reaction_type):
if request.method == 'POST':

if 'user_id' not in session:
session['user_id'] = secrets.token_hex(8)

user_id = session['user_id']
reactions = init_reactions()
user_reactions = init_user_reactions()


if file_name not in reactions:
reactions[file_name] = {'likes': 0, 'dislikes': 0, 'love': 0, 'laugh': 0}


valid_reactions = ['likes', 'dislikes', 'love', 'laugh']
if reaction_type not in valid_reactions:
return jsonify({"error": "Invalid reaction type"}), 400


if user_id in user_reactions and file_name in user_reactions[user_id]:
old_reaction = user_reactions[user_id][file_name]
if old_reaction == reaction_type:

reactions[file_name][reaction_type] -= 1
del user_reactions[user_id][file_name]
if not user_reactions[user_id]:
del user_reactions[user_id]
else:

reactions[file_name][old_reaction] -= 1
reactions[file_name][reaction_type] += 1
user_reactions[user_id][file_name] = reaction_type
else:

reactions[file_name][reaction_type] += 1
if user_id not in user_reactions:
user_reactions[user_id] = {}
user_reactions[user_id][file_name] = reaction_type

save_reactions(reactions)
save_user_reactions(user_reactions)


response_data = reactions[file_name].copy()
if user_id in user_reactions and file_name in user_reactions[user_id]:
response_data['user_reaction'] = user_reactions[user_id][file_name]
else:
response_data['user_reaction'] = None

return jsonify(response_data)

@app.route('/descarga/<string:File>', methods=['GET'])
def Descarga(File=''):
if request.method == 'GET':
try:
Base_Ruta = os.path.dirname(__file__)
Url_File = os.path.join(Base_Ruta, 'static/File', File)

# Verificaciones de seguridad
if not os.path.exists(Url_File):
return "Archivo no encontrado", 404

if not os.path.isfile(Url_File):
return "No es un archivo válido", 400

# Enviar archivo para descarga
return send_file(Url_File, as_attachment=True, download_name=File)

except Exception as e:
# Loguear error

print(f"Error al descargar archivo: {e}")
return "Error al procesar la descarga", 500
else:
# Si no es GET, redirigir de vuelta a la página principal
return redirect('/')


@app.route('/update')
def UpDate():
return render_template('Up_Data.html')

@app.route('/qrgenerator')
def QR_Generador():
return render_template('Qr_Generator.html')

@app.route('/qr')
def qr():
Qr_Generator.Generar_QR()
return redirect('/qrgenerator')

@app.route('/upload', methods=['POST'])
def update():
if request.method == 'POST':
f = request.files['file']
f.save(Files_Carpet+ f.filename)
return redirect('/update')

def abrir_navegador():
# Obtenemos la dirección IP de la máquina
hostname = sok.gethostname()
Ip = sok.gethostbyname(hostname)

Urls = "http://" + Ip + ":5000/"
webbrowser.open(Urls)

#abrir_navegador()

@app.route('/chat')
def chat():
return render_template('Chat.html')

@socketio.on('message')
def Message(msg):
print('message' + msg)
send(msg, broadcast = True)
if request.method == 'POST':
# Obtener el archivo y el título desde el formulario
f = request.files['file']
title = request.form['title'] # El título proporcionado en el formulario
# Renombrar el archivo con el título y mantener su extensión original
file_extension = f.filename.split('.')[-1] # Obtener la extensión del archivo
new_filename = f"{title}.{file_extension}" # Renombrar el archivo
# Guardar el archivo con el nuevo nombre
f.save(Files_Carpet + new_filename)
return redirect('/')

@app.route('/comunicados')
def Comunicados():
with open('Comunicados.json', 'r') as file:
comunicados = json.load(file)
return render_template('Comunicados.html', comunicados=comunicados)

@app.errorhandler(404)
def pagina_no_encontrada(error):
return render_template('404.html')

if __name__ == '__main__':
Qr_Generator.Generar_QR()
socketio.run(app)
socketio.run(app, host='0.0.0.0', port=5000, debug=True)

1 change: 1 addition & 0 deletions reactions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Metas.jpg": {"likes": 0, "dislikes": 0, "love": 100000, "laugh": 0}}
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
qrcode==8.0
Flask==3.1.0
Werkzeug==3.1.3
Flask-SocketIO==5.5.1
Flask-SocketIO==5.5.1
gunicorn==21.2.0
1 change: 1 addition & 0 deletions runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.11.1
Binary file added static/File/Logo_Gris.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/File/Logo_Rojo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/File/Logo_blanco.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/File/Logo_negro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/Logo/Freec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed static/Logo/Logo.jpeg
Binary file not shown.
Binary file added static/Logo/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed static/QR/Qr.png
Binary file not shown.
Loading