From c6c92bf1efd1365865620c826a9fe6d40d0a01ff Mon Sep 17 00:00:00 2001 From: unfr Date: Sun, 10 Aug 2025 11:49:16 +0200 Subject: [PATCH] coreection chargement js server.js --- autopost/posteur.sh | 2 +- autopost/server.js | 30 +++++++++++++++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/autopost/posteur.sh b/autopost/posteur.sh index 56d2f92..653ee5f 100644 --- a/autopost/posteur.sh +++ b/autopost/posteur.sh @@ -60,7 +60,7 @@ while true; do echo -e "${VERT}UPLOAD SUR USENET${NORMAL}" files=( ${FILESANSEXT}.* ) checkusenet - script -q -c \ + script -q -c \ "nyuu -h ${NG_HOST} -P ${NG_PORT} -S -u ${NG_USER} -p ${NG_PASS} -n ${NG_NBR_CONN} \ -g alt.binaries.boneless -o '${DOSSIER_NZB_ATTENTE}${FILESANSEXT}.nzb' \ --nzb-title '${FILESANSEXT}' \ diff --git a/autopost/server.js b/autopost/server.js index bf4a8bd..db97fee 100644 --- a/autopost/server.js +++ b/autopost/server.js @@ -9,6 +9,7 @@ const os = require('os'); const config = require('./config'); const db = require('./db'); + db.testConnection(); // vérification au démarrage const app = express(); @@ -27,8 +28,14 @@ app.use(express.static('public')); const autopostRouter = express.Router(); -autopostRouter.use('/js', express.static(path.join(__dirname, '../node_modules/@tailwindcss/browser/dist'))); -autopostRouter.use('/jquery', express.static(path.join(__dirname, '../node_modules/jquery/dist'))); +app.use('/js', express.static( + path.join(__dirname, '../node_modules/@tailwindcss/browser/dist'), + { setHeaders: (res) => res.type('application/javascript') } // optionnel +)); +app.use('/jquery', express.static( + path.join(__dirname, '../node_modules/jquery/dist'), + { setHeaders: (res) => res.type('application/javascript') } // optionnel +)); // --------------------------- Auth non protégée ----------------------------- autopostRouter.get('/login', (req, res) => { @@ -39,7 +46,7 @@ autopostRouter.get('/login', (req, res) => { Login - +
@@ -69,6 +76,7 @@ autopostRouter.post('/login', (req, res) => { res.send('Identifiants invalides. Réessayer'); } }); + autopostRouter.get('/logout', (req, res) => { req.session.destroy(); res.redirect('/autopost/login'); @@ -106,8 +114,8 @@ autopostRouter.get('/', async (req, res) => { Suivi Autopost - - + + @@ -171,6 +179,10 @@ autopostRouter.get('/', async (req, res) => { statusText = 'DEJA DISPONIBLE'; statusClass = 'bg-pink-300 text-black font-bold'; break; + case 4: + statusText = 'EN COURS'; + statusClass = 'bg-yellow-300 text-black font-bold'; + break; default: statusText = 'INCONNU'; } @@ -269,6 +281,10 @@ autopostRouter.get('/', async (req, res) => { statusText = 'DEJA DISPONIBLE'; statusClass = 'bg-pink-300 text-black font-bold'; break; + case 4: + statusText = 'EN COURS'; + statusClass = 'bg-yellow-300 text-black font-bold'; + break; default: statusText = 'INCONNU'; } @@ -420,6 +436,10 @@ autopostRouter.get('/', async (req, res) => { statusText = 'DEJA DISPONIBLE'; statusClass = 'bg-pink-300 text-black font-bold'; break; + case 4: + statusText = 'EN COURS'; + statusClass = 'bg-yellow-300 text-black font-bold'; + break; default: statusText = 'INCONNU'; }