diff --git a/src/controladores/controlador_Apps.js b/src/controladores/controlador_Apps.js index a0ae059..fde7516 100644 --- a/src/controladores/controlador_Apps.js +++ b/src/controladores/controlador_Apps.js @@ -24,4 +24,20 @@ controlador.user = (req, res) => { }); } +//test de velocidad html +controlador.speedtest = (req, res) => { + //res.render('speedtest'); + res.render('test_velocidad') +}; + +//videos de ayuda sigma +controlador.videos = (req, res) => { + //res.render('speedtest'); + res.render('videos') +}; +controlador.upload = (req, res) => { + //res.render('speedtest'); + res.render('video_upload') +}; + module.exports = controlador; \ No newline at end of file diff --git a/src/controladores/controlador_cloud.js b/src/controladores/controlador_cloud.js index 5be5b9b..0a11b4a 100644 --- a/src/controladores/controlador_cloud.js +++ b/src/controladores/controlador_cloud.js @@ -17,6 +17,21 @@ controlador.upload = (req, res) => { }); } }; +controlador.upload_video = (req, res) => { + if (!req.files || Object.keys(req.files).lenght === 0) { + return res.status(400).send({ message: 'archivos no cargados' }); + } else { + const file = req.files.file_toUpload; + const path = req.app.locals.dir.path_dir + '/public/videos/' + file.name; + console.log(path); + file.mv(path, (err) => { + if (err) { + return res.status(500).send(err); + } + return res.send({ status: "success", path: path }); + }); + } +}; //ruta actual const procesarPath = (path) => { diff --git a/src/public/css/app_videos.css b/src/public/css/app_videos.css new file mode 100644 index 0000000..47ab63c --- /dev/null +++ b/src/public/css/app_videos.css @@ -0,0 +1,160 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background-color: #121212; + color: #e0e0e0; + } + .banner { + display: flex; + align-items: center; + justify-content: space-between; + background-color: #1f1f1f; + color: #e0e0e0; + padding: 10px 20px; + position: fixed; + width: 96%; + top: 0; + z-index: 1000; + } + .banner .logo { + font-size: 24px; + font-weight: bold; + } + .banner .logo img { + height: 40px; + } + .banner .search-bar { + flex-grow: 1; + display: flex; + align-items: center; + margin: 0 20px; + } + .banner input[type="text"] { + width: 100%; + padding: 5px; + border: none; + border-radius: 3px; + margin-right: 10px; + background-color: #333; + color: #e0e0e0; + } + .banner .search-bar button { + background: url('https://cdn.jsdelivr.net/npm/uix@1.1.0/dist/icons/search.svg') no-repeat center; + background-size: 20px; + border: none; + width: 30px; + height: 30px; + cursor: pointer; + } + .banner .menu { + position: relative; + } + .banner .menu button { + background: url('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR5nhCKmVjqZVfc19KXRTIXpeT6mweVBNeAmw&s') no-repeat center; + background-size: 30px; + border: none; + width: 40px; + height: 40px; + cursor: pointer; + color: #e0e0e0; + } + .banner .menu ul { + display: none; + position: absolute; + top: 35px; + right: 0; + background: #1f1f1f; + border: 1px solid #333; + border-radius: 5px; + list-style: none; + padding: 0; + margin: 0; + z-index: 1000; + } + .banner .menu ul li { + padding: 10px; + border-bottom: 1px solid #333; + color: #e0e0e0; + cursor: pointer; + } + .banner .menu ul li:last-child { + border-bottom: none; + } + .banner .menu ul li:hover { + background: #333; + } + .video-list { + padding: 80px 20px 20px; + } + .video-carousel { + position: relative; + } + .slick-slide { + display: flex; + justify-content: center; + } + .video-item { + width: 150px; + margin: 10px; + background: #2c2c2c; + border: 1px solid #444; + border-radius: 5px; + overflow: hidden; + box-shadow: 0 2px 5px rgba(0,0,0,0.5); + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + text-align: center; + } + .video-item img { + width: 100%; + height: auto; + } + .video-item .info { + padding: 10px; + background: #1f1f1f; + } + .player { + display: flex; + justify-content: center; + margin-top: 20px; + } + .player iframe, + .player video { + width: 80%; + max-width: 800px; + border: 2px solid #444; + border-radius: 5px; + } + .slick-prev, + .slick-next { + width: 40px; + height: 40px; + background: #333; + color: #e0e0e0; + border: none; + border-radius: 50%; + line-height: 40px; + text-align: center; + font-size: 20px; + cursor: pointer; + z-index: 1000; + } + .slick-prev { + left: 10px; + } + .slick-next { + right: 10px; + } + @media (max-width: 768px) { + .video-item { + width: 200px; + } + } + @media (max-width: 480px) { + .video-item { + width: 150px; + } + } \ No newline at end of file diff --git a/src/public/css/app_videos_upload.css b/src/public/css/app_videos_upload.css new file mode 100644 index 0000000..adb4e7e --- /dev/null +++ b/src/public/css/app_videos_upload.css @@ -0,0 +1,71 @@ +body { + font-family: Arial, sans-serif; + background-color: #121212; + color: #e0e0e0; + padding: 20px; +} + +.container { + max-width: 600px; + margin: 0 auto; + background-color: #1f1f1f; + padding: 20px; + border-radius: 10px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); +} + +h2 { + text-align: center; + margin-bottom: 20px; +} + +.form-group { + margin-bottom: 15px; +} + +.form-group label { + display: block; + margin-bottom: 5px; +} + +.form-group input, +.form-group select, +.form-group textarea { + width: 100%; + padding: 10px; + border: none; + border-radius: 5px; + background-color: #333; + color: #e0e0e0; +} + +.form-group textarea { + resize: vertical; + height: 100px; +} + +.form-group button { + width: 100%; + padding: 10px; + border: none; + border-radius: 5px; + background-color: #ff5722; + color: #fff; + font-size: 16px; + cursor: pointer; +} + +.form-group button:hover { + background-color: #e64a19; +} + +.form-group img { + margin-top: 10px; + width: 100%; + height: auto; + border-radius: 5px; +} + +#urlGroup { + display: none; +} \ No newline at end of file diff --git a/src/public/css/login.css b/src/public/css/login.css new file mode 100644 index 0000000..f78243b --- /dev/null +++ b/src/public/css/login.css @@ -0,0 +1,99 @@ +@import url('https://fonts.googleapis.com/css?family=Poppins:wght@300;400;500;600;700;800;900&display=swap'); +*{ + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Poppins', sans-serif,sigma_tipografia; +} +body{ + /*background: #084C6D;*/ + display: flex; + justify-content:center; + align-items: center; + min-height: 100vh; + background: #1e293b; +} +@font-face { + font-family: sigma_tipografia; + src: url(../tipografias/sigma_font.ttf) format('truetype'), url(../tipografias/sigma_font.otf) format('truetype'); + font-style: normal; +} + +.login-page{ + background-color: #0a2938; +} +.login-logo a, .register-logo a{ + color: #b5daff +} +.nom_app{ + font-family: sigma_tipografia; +} +.login-logo{ + margin-top: 5px; + font-size:32px; + font-family: sigma_tipografia; +} +.login-box-msg{ + font-family: 'SIGMA-FONT', sigma_font, sigma_tipografia; +} + +.box{ + position: relative; + width: 380px; + height: 420px; + background-color: #1c1c1c; + border-radius: 8px; + overflow: hidden; +} + +.box::before{ + content: ''; + position: absolute; + top: -50%; + left: -50%; + width: 370px; + height: 420px; + background: linear-gradient(0deg,transparent,#45f3ff,#45f3ff); + transform-origin: bottom right; + animation: animar 6s linear infinite; +} + +.box::after{ + content: ''; + position: absolute; + top: -50%; + left: -50%; + width: 370px; + height: 420px; + background: linear-gradient(0deg,transparent,#45ff74,#45f3ff); + transform-origin: bottom right; + animation: animar 6s linear infinite; + animation-delay: -3s; +} +@keyframes animar{ + 0%{ + transform: rotate(0deg); + } + 100%{ + transform: rotate(360deg); + } +} +.form-box { + position: absolute; + inset: 2px; + background: #28292d; + z-index: 10; +} +.login-box{ + position: absolute; + inset: 2px; + background: #28292d; + z-index: 10; + width: 99%; + margin-top: 0rem; + border-radius: 8px; +} + +.footer a{ + margin-left: 30px; + } \ No newline at end of file diff --git a/src/public/css/speedtest.css b/src/public/css/speedtest.css new file mode 100644 index 0000000..4e75494 --- /dev/null +++ b/src/public/css/speedtest.css @@ -0,0 +1,62 @@ +body { + font-family: Arial, sans-serif; + background: #f4f4f4; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; +} + +.container { + width: 100%; + max-width: 400px; + background: #fff; + padding: 20px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + border-radius: 8px; + text-align: center; +} + +h2 { + color: #333; + margin-bottom: 20px; +} + +.result { + margin-top: 20px; + font-size: 24px; + font-weight: bold; + color: #007bff; +} + +.btn-measure { + padding: 10px 20px; + background: #28a745; + color: #fff; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 16px; + margin-top: 20px; +} + +.btn-measure:hover { + background: #218838; +} + +.loader { + border: 4px solid #f3f3f3; + border-radius: 50%; + border-top: 4px solid #007bff; + width: 40px; + height: 40px; + animation: spin 1s linear infinite; + margin: 20px auto; + display: none; +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} \ No newline at end of file diff --git a/src/public/img/sigma_cloud64.png b/src/public/img/sigma_cloud64.png new file mode 100644 index 0000000..f8689e9 Binary files /dev/null and b/src/public/img/sigma_cloud64.png differ diff --git a/src/public/img/sigma_cloud_b64.png b/src/public/img/sigma_cloud_b64.png new file mode 100644 index 0000000..61fa4c6 Binary files /dev/null and b/src/public/img/sigma_cloud_b64.png differ diff --git a/src/public/img/sigma_cloud_w64.png b/src/public/img/sigma_cloud_w64.png new file mode 100644 index 0000000..61850ac Binary files /dev/null and b/src/public/img/sigma_cloud_w64.png differ diff --git a/src/public/js/app_videos_upload.js b/src/public/js/app_videos_upload.js new file mode 100644 index 0000000..49347ea --- /dev/null +++ b/src/public/js/app_videos_upload.js @@ -0,0 +1,110 @@ +document.getElementById('origen').addEventListener('change', function () { + const origen = this.value; + const urlGroup = document.getElementById('urlGroup'); + const fileGroup = document.getElementById('fileGroup'); + const urlInput = document.getElementById('url'); + const fileInput = document.getElementById('videoUpload'); + const previewImg = document.getElementById('previewImg'); + + if (origen === 'Local') { + fileGroup.style.display = 'block'; + urlGroup.style.display = 'none'; + urlInput.required = false; + fileInput.required = true; + } else { + fileGroup.style.display = 'none'; + urlGroup.style.display = 'block'; + urlInput.required = true; + fileInput.required = false; + //previewImg.style.display = 'none'; + } +}); + +document.getElementById('getThumbnailBtn').addEventListener('click', function () { + const origen = document.getElementById('origen').value; + if (origen === 'Local') { + obtenerMiniaturaLocal(); + } else if (origen === 'YouTube') { + obtenerMiniaturaYouTube(); + } + else if (origen === 'Vimeo') { + obtenerMiniaturaVimeo(); + } +}); + +function obtenerMiniaturaLocal() { + const fileInput = document.getElementById('videoUpload'); + const file = fileInput.files[0]; + const previewImg = document.getElementById('previewImg'); + + if (file) { + const videoElement = document.createElement('video'); + videoElement.src = URL.createObjectURL(file); + videoElement.muted = true; + + videoElement.addEventListener('loadeddata', function () { + videoElement.currentTime = videoElement.duration / 2; + }); + + videoElement.addEventListener('seeked', function () { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + canvas.width = videoElement.videoWidth / 4; + canvas.height = videoElement.videoHeight / 4; + ctx.drawImage(videoElement, 0, 0, canvas.width, canvas.height); + + previewImg.src = canvas.toDataURL(); + previewImg.style.display = 'block'; + }); + } +} + +function obtenerMiniaturaYouTube() { + const url = document.getElementById('url').value; + const previewImg = document.getElementById('previewUrl'); + var thumbnailUrl = 'https://img.youtube.com/vi/' + extractYouTubeVideoId(url) + '/0.jpg';; // Implement this function based on the source + previewImg.src = thumbnailUrl; + previewImg.style.display = 'block'; +} +function obtenerMiniaturaVimeo() { + const url = document.getElementById('url').value; + const previewImg = document.getElementById('previewUrl'); + var thumbnailUrl = 'https://vumbnail.com/' + extractVimeoVideoId(url) + '.jpg'; // Implement this function based on the source + + previewImg.src = thumbnailUrl; + previewImg.style.display = 'block'; +} + +function extractYouTubeVideoId(url) { + var match = url.match(/(?:https?:\/\/)?(?:www\.)?youtube\.com\/watch\?v=([^&]+)/); + return match ? match[1] : ''; +} +function extractVimeoVideoId(url) { + var match = url.match(/(?:https?:\/\/)?(?:www\.)?vimeo\.com\/(\d+)/); + return match ? match[1] : ''; +} + +document.getElementById('uploadForm').addEventListener('submit', function (event) { + event.preventDefault(); + + const origen = document.getElementById('origen').value; + let urlOrFile; + if (origen === 'Local') { + urlOrFile = document.getElementById('videoUpload').files[0]; + } else { + urlOrFile = document.getElementById('url').value; + } + + const videoData = { + nombre: document.getElementById('nombre').value, + descripcion: document.getElementById('descripcion').value, + url: urlOrFile, + miniatura: origen === 'Local' ? document.getElementById('previewImg').src : document.getElementById('previewUrl').src, + tipo: document.getElementById('tipo').value, + tamano: document.getElementById('tamano').value, + origen: origen, + }; + + console.log('Video subido:', videoData); + // Aquí puedes agregar código para procesar la subida y guardado de los datos. +}); \ No newline at end of file diff --git a/src/public/plantilla_html/rep_video.html b/src/public/plantilla_html/rep_video.html new file mode 100644 index 0000000..66a2041 --- /dev/null +++ b/src/public/plantilla_html/rep_video.html @@ -0,0 +1,284 @@ + + + + + + Lista de Videos + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + diff --git a/src/public/plantilla_html/speedtest.html b/src/public/plantilla_html/speedtest.html new file mode 100644 index 0000000..66b5212 --- /dev/null +++ b/src/public/plantilla_html/speedtest.html @@ -0,0 +1,46 @@ + + + + + + Medidor de Ancho de Banda + + + +
+

Medidor de Ancho de Banda

+ +
+
---
+
+ + + + diff --git a/src/public/plantilla_html/subir_videos.html b/src/public/plantilla_html/subir_videos.html new file mode 100644 index 0000000..35d51b7 --- /dev/null +++ b/src/public/plantilla_html/subir_videos.html @@ -0,0 +1,244 @@ + + + + + + + Subir Video + + + + +
+

Subir Video

+
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+
+ + + +
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/src/public/plantilla_html/video_upload.html b/src/public/plantilla_html/video_upload.html new file mode 100644 index 0000000..6ac16ee --- /dev/null +++ b/src/public/plantilla_html/video_upload.html @@ -0,0 +1,189 @@ + + + + + + Formulario de Subida de Videos + + + + + +
+

Formulario de Subida de Videos

+
+
+ + +
+
+ + +
+
+ + +
+ + +
+ +
+
+ +
+
+ +
+
+
+ + + + diff --git a/src/rutas/rt_apps.js b/src/rutas/rt_apps.js index 5a713ab..17fac92 100644 --- a/src/rutas/rt_apps.js +++ b/src/rutas/rt_apps.js @@ -6,4 +6,8 @@ rutas.get('/app_restaurant', controlador_init.app_restaurant);//login testing cs //rutas.get('/usuarios', controlador_init.user);// rutas.get('/dash_board', controlador_init.dashboard);// rutas.get('/users', controlador_init.user);//devuelve usuaios con el el ROL meseros + +rutas.get('/speedtest', controlador_init.speedtest);//testing velocimetro server +rutas.get('/videos', controlador_init.videos);//videos sigma server +rutas.get('/video_upload', controlador_init.upload);//videos sigma server module.exports = rutas; \ No newline at end of file diff --git a/src/rutas/rt_cloud.js b/src/rutas/rt_cloud.js index 2133c55..f6502e3 100644 --- a/src/rutas/rt_cloud.js +++ b/src/rutas/rt_cloud.js @@ -6,4 +6,5 @@ const controlador_cloud = require('../controladores/controlador_cloud'); rutas.post('/upload', controlador_cloud.upload);//ver productos en modo json/get rutas.post('/cloud_panel/', controlador_cloud.cloud_panel);//ver direcctorio actual rutas.get('/cloud/', controlador_cloud.login_cloud);//ver direcctorio actual + module.exports = rutas; diff --git a/src/views/app-tv.ejs b/src/views/app-tv.ejs index 7070234..ae0ee83 100644 --- a/src/views/app-tv.ejs +++ b/src/views/app-tv.ejs @@ -11,50 +11,36 @@

SIGMA TV-ONLINE

- T + S o - d - o - s -   l o - s   - T - E - C - H - N - O - L - O - G - I - E - S + t + u +   + e + r + e + s

- +
-
-

SVELTE

+
+

FUTBOL

another frontend JS framework

-
-

ESBUILD

-

an extremely fast JavaScript bundler

-
-
-

NEXT.JS

-

framework for Production

-
-
-

TYPESCRIPT

+
+

PELICULAS

giving you better tooling at any scale

-
-

VITE

+
+

TV ENVIVO

a frontend build tool

diff --git a/src/views/cloud.ejs b/src/views/cloud.ejs index e546033..0e3ad8b 100644 --- a/src/views/cloud.ejs +++ b/src/views/cloud.ejs @@ -68,7 +68,7 @@ } function modo_img(file) { - var tipoImg = ["jpg", "jpeg", "png"]; + var tipoImg = ["jpg", "jpeg", "png","gif", "bmp", "tiff", "svg", "webp", "ico", "psd", "ai", "eps", "raw", "cr2", "nef", "orf", "sr2", "rw2", "dng", "arw", "3fr", "dcr", "kdc", "erf", "mrw", "pef", "raf", "x3f", "srw", "rwl", "r3d", "rwz", "z6ii", "z5", "drf", "k25", "bay", "cap", "iiq", "fff", "mef", "mos", "crw", "erf", "kdc", "dcs", "gpr", "mef", "mos", "nef", "nrw", "orf", "raw", "rw2", "rwl", "sr2", "srf", "x3f"]; var std = false; tipoImg.forEach((item, i) => { if (file == item) { @@ -80,7 +80,7 @@ } function modo_video(file) { - var tipoImg = ["mp4", "mpg", "webm"]; + var tipoImg = ["mp4", "mpg", "webm","avi", "mkv", "mov", "wmv", "flv", "3gp", "m4v"]; var std = false; tipoImg.forEach((item, i) => { console.log(item); @@ -92,7 +92,7 @@ return std; } function modo_music(file) { - var tipoImg = ["mp3", "acc", "wav"]; + var tipoImg = ["mp3", "acc", "wav", "wma", "ogg", "m4a"]; var std = false; tipoImg.forEach((item, i) => { if (file == item) { diff --git a/src/views/login.ejs b/src/views/login.ejs index 5de5e5d..532cced 100644 --- a/src/views/login.ejs +++ b/src/views/login.ejs @@ -39,14 +39,22 @@
- +
+

Generar Codigo de Session

+
+ +
+
+ +
+
+
diff --git a/src/views/login_cloud.ejs b/src/views/login_cloud.ejs index b89c626..a398709 100644 --- a/src/views/login_cloud.ejs +++ b/src/views/login_cloud.ejs @@ -15,14 +15,14 @@ - +