Urgent correction of version v1.0.0-beta.14 due to crash issues when acting on the CDN.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -20,7 +20,7 @@ steps:
|
|||||||
repo: swiftlogiclabs/cdn-app-insider
|
repo: swiftlogiclabs/cdn-app-insider
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- v1.0.0-beta.13
|
- v1.0.0-beta.14
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
|
|||||||
5
.idea/.gitignore
generated
vendored
Normal file
5
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
12
.idea/CDN-APP-INSIDER.iml
generated
Normal file
12
.idea/CDN-APP-INSIDER.iml
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
7
.idea/discord.xml
generated
Normal file
7
.idea/discord.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DiscordProjectSettings">
|
||||||
|
<option name="show" value="PROJECT_FILES" />
|
||||||
|
<option name="description" value="" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/jsLibraryMappings.xml
generated
Normal file
6
.idea/jsLibraryMappings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JavaScriptLibraryMappings">
|
||||||
|
<includedPredefinedLibrary name="Node.js Core" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/CDN-APP-INSIDER.iml" filepath="$PROJECT_DIR$/.idea/CDN-APP-INSIDER.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -55,7 +55,7 @@ async function checkUserExistsAD(req, res, next) {
|
|||||||
} else {
|
} else {
|
||||||
req.user = existingUser;
|
req.user = existingUser;
|
||||||
req.session.userId = existingUser.id;
|
req.session.userId = existingUser.id;
|
||||||
res.render('AuthLogin', { isAuthenticated: true, setupData: {}, currentUrl: req.originalUrl, errorMessage: '' });
|
res.status(200).render('AuthLogin', { isAuthenticated: true, setupData: {}, currentUrl: req.originalUrl, errorMessage: '' });
|
||||||
}
|
}
|
||||||
|
|
||||||
return next();
|
return next();
|
||||||
|
|||||||
@@ -12,7 +12,17 @@ async function getUserData() {
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let userData = getUserData();
|
|
||||||
|
let userData;
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
try {
|
||||||
|
userData = await getUserData();
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`Failed to initialize userData: ${err}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
async function checkUserExistsDiscord(req, res, next) {
|
async function checkUserExistsDiscord(req, res, next) {
|
||||||
if (!req.user || (!req.user.username && !req.user.id)) {
|
if (!req.user || (!req.user.username && !req.user.id)) {
|
||||||
@@ -20,19 +30,18 @@ async function checkUserExistsDiscord(req, res, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let users = userData;
|
let userData = await getUserData();
|
||||||
|
|
||||||
let existingUser;
|
let existingUser;
|
||||||
if (req.user.username) {
|
if (req.user.username) {
|
||||||
existingUser = users.find(u => u.name === req.user.username);
|
existingUser = userData.find(u => u.name === req.user.username);
|
||||||
} else if (req.user.id) {
|
} else if (req.user.id) {
|
||||||
existingUser = users.find(u => u.id === req.user.id);
|
existingUser = userData.find(u => u.id === req.user.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existingUser) {
|
if (existingUser) {
|
||||||
req.user.id = existingUser.id;
|
req.user.id = existingUser.id;
|
||||||
res.redirect('/dpanel/dashboard');
|
return res.redirect('/dpanel/dashboard');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const newUser = {
|
const newUser = {
|
||||||
@@ -40,9 +49,10 @@ async function checkUserExistsDiscord(req, res, next) {
|
|||||||
name: req.user.username,
|
name: req.user.username,
|
||||||
role: "user"
|
role: "user"
|
||||||
};
|
};
|
||||||
users.push(newUser);
|
|
||||||
|
|
||||||
await fs.writeFile(filePath, JSON.stringify(users, null, 2), 'utf8');
|
userData.push(newUser);
|
||||||
|
|
||||||
|
await fs.writeFile(filePath, JSON.stringify(userData, null, 2), 'utf8');
|
||||||
|
|
||||||
req.user.id = newUser.id;
|
req.user.id = newUser.id;
|
||||||
|
|
||||||
@@ -52,4 +62,5 @@ async function checkUserExistsDiscord(req, res, next) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
module.exports = { checkUserExistsDiscord };
|
module.exports = { checkUserExistsDiscord };
|
||||||
@@ -4,41 +4,91 @@ const fs = require('fs');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
const setupFilePath = path.join(__dirname, '../data', 'setup.json');
|
const setupFilePath = path.join(__dirname, '../data', 'setup.json');
|
||||||
const setupData = JSON.parse(fs.readFileSync(setupFilePath, 'utf-8'));
|
|
||||||
|
let setupData;
|
||||||
|
try {
|
||||||
|
setupData = JSON.parse(fs.readFileSync(setupFilePath, 'utf-8'));
|
||||||
|
console.log('Setup data loaded:', setupData);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error reading setup.json:', err);
|
||||||
|
}
|
||||||
|
|
||||||
|
const callbackURL = `http://${setupData[0].domain}/auth/discord/callback`;
|
||||||
|
console.log(`Callback URL: ${callbackURL}`);
|
||||||
|
|
||||||
passport.use(new DiscordStrategy({
|
passport.use(new DiscordStrategy({
|
||||||
clientID: setupData[0].discord.clientID,
|
clientID: setupData[0].discord.clientID,
|
||||||
clientSecret: setupData[0].discord.clientSecret,
|
clientSecret: setupData[0].discord.clientSecret,
|
||||||
callbackURL: `http://${setupData[0].domain}/auth/discord/callback`
|
callbackURL: callbackURL
|
||||||
}, (accessToken, refreshToken, profile, done) => {
|
}, (accessToken, refreshToken, profile, done) => {
|
||||||
fs.readFile('user.json', 'utf8', (err, data) => {
|
console.log('Discord profile received:', profile);
|
||||||
|
|
||||||
|
fs.readFile(path.join(__dirname, '../data', 'user.json'), 'utf8', (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
console.error('Error reading user.json:', err);
|
||||||
return done(err);
|
return done(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
const users = JSON.parse(data);
|
let users;
|
||||||
const user = users.find(user => user.id === profile.id);
|
try {
|
||||||
|
users = JSON.parse(data);
|
||||||
if (setupData[0].discord.authorizedIDs.length > 0 && !setupData[0].discord.authorizedIDs.includes(profile.id)) {
|
} catch (parseErr) {
|
||||||
return done(null, false, { message: 'L\'utilisateur n\'est pas autorisé.' });
|
console.error('Failed to parse user.json:', parseErr);
|
||||||
|
return done(parseErr);
|
||||||
}
|
}
|
||||||
|
|
||||||
done(null, user);
|
let existingUser = users.find(user => user.id === profile.id);
|
||||||
|
|
||||||
|
if (existingUser) {
|
||||||
|
console.log('Existing user found:', existingUser);
|
||||||
|
return done(null, existingUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
const newUser = {
|
||||||
|
id: profile.id,
|
||||||
|
name: profile.username,
|
||||||
|
role: "user"
|
||||||
|
};
|
||||||
|
|
||||||
|
users.push(newUser);
|
||||||
|
|
||||||
|
fs.writeFile(path.join(__dirname, '../data', 'user.json'), JSON.stringify(users, null, 2), 'utf8', (err) => {
|
||||||
|
if (err) {
|
||||||
|
console.error('Error writing to user.json:', err);
|
||||||
|
return done(err);
|
||||||
|
}
|
||||||
|
console.log('New user created:', newUser);
|
||||||
|
done(null, newUser);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
passport.serializeUser((user, done) => {
|
passport.serializeUser((user, done) => {
|
||||||
done(null, user);
|
console.log('Serializing user:', user);
|
||||||
|
done(null, user.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
passport.deserializeUser((id, done) => {
|
passport.deserializeUser((id, done) => {
|
||||||
fs.readFile('/data', 'user.json', 'utf8', (err, data) => {
|
fs.readFile(path.join(__dirname, '../data', 'user.json'), 'utf8', (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return done(err);
|
return done(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
const users = JSON.parse(data);
|
let users;
|
||||||
|
try {
|
||||||
|
users = JSON.parse(data);
|
||||||
|
} catch (parseErr) {
|
||||||
|
console.error('Failed to parse user data:', parseErr);
|
||||||
|
return done(parseErr);
|
||||||
|
}
|
||||||
|
|
||||||
const user = users.find(user => user.id === id);
|
const user = users.find(user => user.id === id);
|
||||||
|
|
||||||
|
if (!user) {
|
||||||
|
return done(null, false, { message: 'User not found.' });
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('Deserializing user:', user);
|
||||||
done(null, user);
|
done(null, user);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
const mysql = require('mysql2/promise');
|
|
||||||
const pool = require('../config/database');
|
|
||||||
|
|
||||||
const userSchema = {
|
|
||||||
username: {
|
|
||||||
type: 'VARCHAR(255)',
|
|
||||||
allowNull: false,
|
|
||||||
unique: true
|
|
||||||
},
|
|
||||||
password: {
|
|
||||||
type: 'VARCHAR(255)',
|
|
||||||
allowNull: false
|
|
||||||
},
|
|
||||||
isAdmin: {
|
|
||||||
type: 'BOOLEAN',
|
|
||||||
allowNull: false,
|
|
||||||
defaultValue: false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
async function createUser(username, password, isAdmin) {
|
|
||||||
const connection = await pool.getConnection();
|
|
||||||
try {
|
|
||||||
const [rows] = await connection.execute(
|
|
||||||
'INSERT INTO cdn (username, password, isAdmin) VALUES (?, ?, ?)',
|
|
||||||
[username, password, isAdmin]
|
|
||||||
);
|
|
||||||
return rows.insertId;
|
|
||||||
} finally {
|
|
||||||
connection.release();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getUserByUsername(username) {
|
|
||||||
const connection = await pool.getConnection();
|
|
||||||
try {
|
|
||||||
const [rows] = await connection.execute('SELECT * FROM users WHERE username = ?', [username]);
|
|
||||||
return rows[0];
|
|
||||||
} finally {
|
|
||||||
connection.release();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
createUser,
|
|
||||||
getUserByUsername
|
|
||||||
};
|
|
||||||
18
package-lock.json
generated
18
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@cdn-app/insider-swiftlogic-labs-dinawo",
|
"name": "@cdn-app/insider-swiftlogic-labs-dinawo",
|
||||||
"version": "1.0.0-beta.12",
|
"version": "1.0.0-beta.14",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@cdn-app/insider-swiftlogic-labs-dinawo",
|
"name": "@cdn-app/insider-swiftlogic-labs-dinawo",
|
||||||
"version": "1.0.0-beta.12",
|
"version": "1.0.0-beta.14",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@auth/express": "^0.5.1",
|
"@auth/express": "^0.5.1",
|
||||||
@@ -48,6 +48,7 @@
|
|||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"pg": "^8.11.3",
|
"pg": "^8.11.3",
|
||||||
"pg-promise": "^11.5.4",
|
"pg-promise": "^11.5.4",
|
||||||
|
"progress": "^2.0.3",
|
||||||
"public-ip": "^6.0.1",
|
"public-ip": "^6.0.1",
|
||||||
"semver": "^7.5.4",
|
"semver": "^7.5.4",
|
||||||
"slugify": "^1.6.6",
|
"slugify": "^1.6.6",
|
||||||
@@ -3895,6 +3896,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
||||||
},
|
},
|
||||||
|
"node_modules/progress": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/proxy-addr": {
|
"node_modules/proxy-addr": {
|
||||||
"version": "2.0.7",
|
"version": "2.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||||
@@ -8157,6 +8166,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
||||||
},
|
},
|
||||||
|
"progress": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA=="
|
||||||
|
},
|
||||||
"proxy-addr": {
|
"proxy-addr": {
|
||||||
"version": "2.0.7",
|
"version": "2.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@cdn-app/insider-swiftlogic-labs-dinawo",
|
"name": "@cdn-app/insider-myaxrin-labs-dinawo",
|
||||||
"version": "1.0.0-beta.13",
|
"version": "1.0.0-beta.14",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node server.js"
|
"start": "node server.js"
|
||||||
},
|
},
|
||||||
"author": "Dinawo - Group SwiftLogic Labs",
|
"author": "Dinawo - Group Myaxrin Labs",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@auth/express": "^0.5.1",
|
"@auth/express": "^0.5.1",
|
||||||
@@ -48,6 +48,7 @@
|
|||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"pg": "^8.11.3",
|
"pg": "^8.11.3",
|
||||||
"pg-promise": "^11.5.4",
|
"pg-promise": "^11.5.4",
|
||||||
|
"progress": "^2.0.3",
|
||||||
"public-ip": "^6.0.1",
|
"public-ip": "^6.0.1",
|
||||||
"semver": "^7.5.4",
|
"semver": "^7.5.4",
|
||||||
"slugify": "^1.6.6",
|
"slugify": "^1.6.6",
|
||||||
|
|||||||
@@ -82,23 +82,22 @@ body.dark-mode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.custom-btn {
|
.custom-btn {
|
||||||
transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
|
display: inline-flex;
|
||||||
color: #007BFF;
|
align-items: center;
|
||||||
background-color: transparent;
|
justify-content: center;
|
||||||
padding: 8px 16px;
|
font-family: inherit;
|
||||||
text-decoration: none;
|
font-weight: 500;
|
||||||
display: inline-block;
|
font-size: 14px; /* réduit la taille de la police */
|
||||||
font-size: 14px;
|
padding: 0.6em 1.2em; /* réduit le padding */
|
||||||
margin: 4px 2px;
|
color: white;
|
||||||
border-radius: 50px;
|
background: linear-gradient(0deg, rgba(77,54,208,1) 0%, rgba(132,116,254,1) 100%);
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 0.7em 1.5em -0.5em #4d36d0be;
|
||||||
|
letter-spacing: 0.05em;
|
||||||
|
border-radius: 15em; /* réduit le rayon de la bordure */
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
box-shadow: 0 2px 5px rgba(0,0,0,0.25);
|
transition: all 0.3s ease;
|
||||||
border: 2px solid #007BFF;
|
position: relative;
|
||||||
}
|
overflow: hidden;
|
||||||
|
|
||||||
.custom-btn:hover {
|
|
||||||
transform: scale(1.15);
|
|
||||||
background-color: #007BFF;
|
|
||||||
color: #fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,28 +60,6 @@
|
|||||||
|
|
||||||
styleSwitcherButton.addEventListener('click', toggleDarkMode);
|
styleSwitcherButton.addEventListener('click', toggleDarkMode);
|
||||||
|
|
||||||
filterForm.addEventListener('submit', function (event) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
const selectedExtension = extensionFilter.value.toLowerCase();
|
|
||||||
const searchQuery = fileSearchInput.value.toLowerCase();
|
|
||||||
|
|
||||||
const fileList = document.querySelectorAll('tr[data-extension]');
|
|
||||||
|
|
||||||
fileList.forEach(file => {
|
|
||||||
const fileExtension = file.getAttribute('data-extension').toLowerCase();
|
|
||||||
const fileName = file.querySelector('td:first-child').textContent.toLowerCase();
|
|
||||||
|
|
||||||
const extensionMatch = selectedExtension === '' || selectedExtension === fileExtension;
|
|
||||||
const searchMatch = fileName.includes(searchQuery);
|
|
||||||
|
|
||||||
if (extensionMatch && searchMatch) {
|
|
||||||
file.style.display = '';
|
|
||||||
} else {
|
|
||||||
file.style.display = 'none';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
@@ -204,111 +182,6 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function performUpdate() {
|
|
||||||
fetch('/applyupdate')
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(result => {
|
|
||||||
if (result.success) {
|
|
||||||
Swal.fire({
|
|
||||||
title: 'Mise à jour réussie',
|
|
||||||
text: 'Votre application a été mise à jour avec succès.',
|
|
||||||
icon: 'success',
|
|
||||||
toast: true,
|
|
||||||
position: 'bottom-right',
|
|
||||||
showConfirmButton: false,
|
|
||||||
timer: 5000
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Swal.fire({
|
|
||||||
title: 'Mise à jour échouée',
|
|
||||||
text: 'Une erreur s\'est produite lors de la mise à jour de votre application.',
|
|
||||||
icon: 'error',
|
|
||||||
toast: true,
|
|
||||||
position: 'bottom-right',
|
|
||||||
showConfirmButton: false,
|
|
||||||
timer: 5000
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.error('Erreur lors de la mise à jour :', error);
|
|
||||||
Swal.fire({
|
|
||||||
text: 'Erreur lors de la mise à jour.',
|
|
||||||
icon: 'error',
|
|
||||||
toast: true,
|
|
||||||
position: 'bottom-right',
|
|
||||||
showConfirmButton: false,
|
|
||||||
timer: 5000
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkUpdates() {
|
|
||||||
fetch('/checkupdate')
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(result => {
|
|
||||||
if (result.updateAvailable) {
|
|
||||||
Swal.fire({
|
|
||||||
title: 'Nouvelle mise à jour disponible',
|
|
||||||
text: 'Voulez-vous mettre à jour votre application?',
|
|
||||||
icon: 'info',
|
|
||||||
showCancelButton: true,
|
|
||||||
confirmButtonText: 'Oui',
|
|
||||||
cancelButtonText: 'Non',
|
|
||||||
position: 'bottom-right',
|
|
||||||
toast: true,
|
|
||||||
}).then((result) => {
|
|
||||||
if (result.isConfirmed) {
|
|
||||||
performUpdate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Swal.fire({
|
|
||||||
title: 'Application à jour',
|
|
||||||
text: 'Votre application est à jour.',
|
|
||||||
icon: 'success',
|
|
||||||
toast: true,
|
|
||||||
position: 'bottom-right',
|
|
||||||
showConfirmButton: false,
|
|
||||||
timer: 5000
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.error('Erreur lors de la vérification des mises à jour :', error);
|
|
||||||
Swal.fire({
|
|
||||||
text: 'Erreur lors de la vérification des mises à jour.',
|
|
||||||
icon: 'error',
|
|
||||||
toast: true,
|
|
||||||
position: 'bottom-right',
|
|
||||||
showConfirmButton: false,
|
|
||||||
timer: 5000
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
document.getElementById('checkUpdateButton').addEventListener('click', async function() {
|
|
||||||
const userName = await getLoggedInUserName();
|
|
||||||
|
|
||||||
fs.readFile('user.json', (err, data) => {
|
|
||||||
if (err) throw err;
|
|
||||||
let users = JSON.parse(data);
|
|
||||||
|
|
||||||
const user = users.find(user => user.name === userName);
|
|
||||||
|
|
||||||
if (user && user.role === 'admin') {
|
|
||||||
checkUpdates();
|
|
||||||
} else {
|
|
||||||
Swal.fire({
|
|
||||||
position: 'top',
|
|
||||||
icon: 'warning',
|
|
||||||
title: 'Vous n\'avez pas les droits pour effectuer cette action.',
|
|
||||||
showConfirmButton: false,
|
|
||||||
timer: 2600,
|
|
||||||
toast: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
var modal = document.getElementById('patchNoteModal');
|
var modal = document.getElementById('patchNoteModal');
|
||||||
|
|
||||||
@@ -617,3 +490,57 @@ function closeModal() {
|
|||||||
const modal = document.getElementById('metadataModal');
|
const modal = document.getElementById('metadataModal');
|
||||||
modal.style.display = 'none';
|
modal.style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function moveFile(folderName, fileName) {
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Confirmer le déplacement du fichier',
|
||||||
|
text: `Voulez-vous déplacer le fichier ${fileName} vers ${folderName} ?`,
|
||||||
|
icon: 'warning',
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: 'Déplacer',
|
||||||
|
cancelButtonText: 'Annuler',
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
fetch('/api/dpanel/dashboard/movefile', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({ fileName: fileName, folderName: folderName }),
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error('Network response was not ok');
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
if (data.message === "File moved successfully") {
|
||||||
|
Swal.fire({
|
||||||
|
position: 'top',
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Le fichier a été déplacé avec succès.',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1800,
|
||||||
|
toast: true,
|
||||||
|
}).then(() => {
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
throw new Error(data.error || 'Une erreur est survenue');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
Swal.fire({
|
||||||
|
position: 'top',
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Erreur lors du déplacement du fichier.',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1800,
|
||||||
|
toast: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,10 +14,23 @@ const limiter = rateLimit({
|
|||||||
router.post('/', limiter, (req, res, next) => {
|
router.post('/', limiter, (req, res, next) => {
|
||||||
passport.authenticate('ActiveDirectory', (err, user) => {
|
passport.authenticate('ActiveDirectory', (err, user) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return res.json({ isAuthenticated: false, errorMessage: err.message, setupData: {}, showActiveDirectoryForm: true, currentUrl: req.originalUrl });
|
console.error("Authentication error:", err);
|
||||||
|
return res.status(401).json({
|
||||||
|
isAuthenticated: false,
|
||||||
|
errorMessage: err.message,
|
||||||
|
setupData: {},
|
||||||
|
showActiveDirectoryForm: true,
|
||||||
|
currentUrl: req.originalUrl
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (!user) {
|
if (!user) {
|
||||||
return res.json({ isAuthenticated: false, errorMessage: 'User is not authorized.', setupData: {}, showActiveDirectoryForm: true, currentUrl: req.originalUrl });
|
return res.status(401).json({
|
||||||
|
isAuthenticated: false,
|
||||||
|
errorMessage: 'User is not authorized.',
|
||||||
|
setupData: {},
|
||||||
|
showActiveDirectoryForm: true,
|
||||||
|
currentUrl: req.originalUrl
|
||||||
|
});
|
||||||
}
|
}
|
||||||
req.user = {
|
req.user = {
|
||||||
...user._json,
|
...user._json,
|
||||||
@@ -31,9 +44,10 @@ router.post('/', limiter, (req, res, next) => {
|
|||||||
|
|
||||||
req.session.user = req.user;
|
req.session.user = req.user;
|
||||||
|
|
||||||
return next();
|
return res.redirect('/dpanel/dashboard');
|
||||||
});
|
});
|
||||||
})(req, res, next);
|
})(req, res, next);
|
||||||
}, checkUserExistsAD);
|
}, checkUserExistsAD);
|
||||||
|
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
@@ -4,26 +4,34 @@ const passport = require('passport');
|
|||||||
const { checkUserExistsDiscord } = require('../../Middlewares/UserIDMiddlewareDiscord');
|
const { checkUserExistsDiscord } = require('../../Middlewares/UserIDMiddlewareDiscord');
|
||||||
const { getUserData, getSetupData } = require('../../Middlewares/watcherMiddleware');
|
const { getUserData, getSetupData } = require('../../Middlewares/watcherMiddleware');
|
||||||
|
|
||||||
let userData = getUserData();
|
|
||||||
let setupData;
|
let setupData;
|
||||||
|
let user;
|
||||||
|
|
||||||
getSetupData().then(data => {
|
Promise.all([
|
||||||
setupData = data;
|
getSetupData(),
|
||||||
|
getUserData()
|
||||||
|
]).then(([setup, userData]) => {
|
||||||
|
setupData = setup;
|
||||||
|
user = userData;
|
||||||
|
|
||||||
if (setupData[0].discord !== undefined) {
|
if (setupData[0].discord !== undefined) {
|
||||||
const DiscordStrategy = require('../../models/Passport-Discord');
|
const DiscordStrategy = require('../../models/Passport-Discord');
|
||||||
}
|
}
|
||||||
|
|
||||||
getUserData().then(user => {
|
|
||||||
if (user.identifyURL) {
|
|
||||||
router.get("/auth/discord", (req, res) => {
|
router.get("/auth/discord", (req, res) => {
|
||||||
|
if (user && user.identifyURL) {
|
||||||
res.redirect(user.identifyURL);
|
res.redirect(user.identifyURL);
|
||||||
});
|
} else {
|
||||||
|
res.redirect('/auth/login');
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
router.get("/", (req, res) => {
|
router.get("/", (req, res) => {
|
||||||
|
if (setupData && setupData.discord && setupData.discord.identifyURL) {
|
||||||
res.redirect(setupData.discord.identifyURL);
|
res.redirect(setupData.discord.identifyURL);
|
||||||
});
|
} else {
|
||||||
|
res.redirect('/auth/login');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -34,21 +42,9 @@ passport.deserializeUser((user, done) => {
|
|||||||
done(null, user);
|
done(null, user);
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get('/callback', (req, res, next) => {
|
router.get('/callback', passport.authenticate('discord', {
|
||||||
passport.authenticate('discord', (err, user, info) => {
|
failureRedirect: '/auth/login'
|
||||||
if (err) {
|
}), (req, res, next) => {
|
||||||
return next(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!user) {
|
|
||||||
return res.redirect('/auth/login');
|
|
||||||
}
|
|
||||||
|
|
||||||
req.logIn(user, (loginErr) => {
|
|
||||||
if (loginErr) {
|
|
||||||
return next(loginErr);
|
|
||||||
}
|
|
||||||
|
|
||||||
checkUserExistsDiscord(req, res, () => {
|
checkUserExistsDiscord(req, res, () => {
|
||||||
if (req.userExists) {
|
if (req.userExists) {
|
||||||
return res.redirect('/dpanel/dashboard');
|
return res.redirect('/dpanel/dashboard');
|
||||||
@@ -62,7 +58,6 @@ router.get('/callback', (req, res, next) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})(req, res, next);
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
@@ -5,6 +5,7 @@ const child_process = require('child_process');
|
|||||||
const packageJson = require('../package.json');
|
const packageJson = require('../package.json');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const crypto = require('crypto');
|
||||||
|
|
||||||
function getAllFiles(dirPath, arrayOfFiles) {
|
function getAllFiles(dirPath, arrayOfFiles) {
|
||||||
const files = fs.readdirSync(dirPath);
|
const files = fs.readdirSync(dirPath);
|
||||||
@@ -51,11 +52,14 @@ router.get('/', async (req, res) => {
|
|||||||
build_version: version,
|
build_version: version,
|
||||||
node_version: process.version,
|
node_version: process.version,
|
||||||
express_version: expressVersion,
|
express_version: expressVersion,
|
||||||
build_sha: child_process.execSync('git rev-parse HEAD').toString().trim(),
|
build_sha: '',
|
||||||
os_type: os.type(),
|
os_type: os.type(),
|
||||||
os_release: os.release(),
|
os_release: os.release(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const hash = crypto.createHash('md5');
|
||||||
|
hash.update(buildMetadata.build_version);
|
||||||
|
buildMetadata.build_sha = hash.digest('hex').substring(0, 32);
|
||||||
|
|
||||||
res.json(buildMetadata);
|
res.json(buildMetadata);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -129,10 +129,9 @@ function getAllFiles(dirPath, arrayOfFiles) {
|
|||||||
|
|
||||||
const allFiles = getAllFiles(__dirname);
|
const allFiles = getAllFiles(__dirname);
|
||||||
|
|
||||||
|
const SERVER = process.env.PORT || 5053;
|
||||||
const PORT = process.env.PORT || 5053;
|
app.listen(SERVER, () => {
|
||||||
app.listen(PORT, () => {
|
SERVER.timeout = 300000
|
||||||
|
|
||||||
allFiles.forEach(file => {
|
allFiles.forEach(file => {
|
||||||
|
|
||||||
console.log(`[ ${chalk.green('OK')} ] Loaded file: ${file}`);
|
console.log(`[ ${chalk.green('OK')} ] Loaded file: ${file}`);
|
||||||
@@ -141,7 +140,7 @@ app.listen(PORT, () => {
|
|||||||
console.clear();
|
console.clear();
|
||||||
if (logger) {
|
if (logger) {
|
||||||
logger.info(`☀️ Welcome to the Content Delivery Network Server`);
|
logger.info(`☀️ Welcome to the Content Delivery Network Server`);
|
||||||
logger.info(`🚀 Your server is available and running on port ${PORT}`);
|
logger.info(`🚀 Your server is available and running on port ${SERVER}`);
|
||||||
logger.info(`⚜️ Application developed by Dinawo, part of the Myaxrin Labs group`);
|
logger.info(`⚜️ Application developed by Dinawo, part of the Myaxrin Labs group`);
|
||||||
logger.info(`♨️ Version: ${version}`);
|
logger.info(`♨️ Version: ${version}`);
|
||||||
console.log('');
|
console.log('');
|
||||||
|
|||||||
@@ -13,39 +13,116 @@
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
.custom-btn {
|
.custom-btn {
|
||||||
transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
|
display: inline-flex;
|
||||||
color: #007BFF;
|
align-items: center;
|
||||||
background-color: transparent;
|
justify-content: center;
|
||||||
padding: 10px 20px;
|
font-family: inherit;
|
||||||
text-decoration: none;
|
font-weight: 500;
|
||||||
display: inline-block;
|
font-size: 17px;
|
||||||
font-size: 16px;
|
padding: 0.8em 1.5em;
|
||||||
margin: 4px 2px;
|
color: white;
|
||||||
border-radius: 50px;
|
background: linear-gradient(0deg, rgba(77,54,208,1) 0%, rgba(132,116,254,1) 100%);
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 0.7em 1.5em -0.5em #4d36d0be;
|
||||||
|
letter-spacing: 0.05em;
|
||||||
|
border-radius: 20em;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
box-shadow: 0 2px 5px rgba(0,0,0,0.25);
|
transition: all 0.3s ease;
|
||||||
border: 2px solid #007BFF;
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
min-width: 150px;
|
||||||
|
min-height: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-btn:hover {
|
.custom-btn:hover {
|
||||||
transform: scale(1.15);
|
box-shadow: 0 0.5em 1.5em -0.5em #4d36d0be;
|
||||||
background-color: #007BFF;
|
|
||||||
color: #fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.animate {
|
.custom-btn span {
|
||||||
opacity: 0;
|
position: relative;
|
||||||
transform: translateY(-20px);
|
z-index: 1;
|
||||||
animation: slideIn 0.4s forwards;
|
transition: opacity 0.3s ease;
|
||||||
animation-delay: 0.2s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes slideIn {
|
.custom-btn.processing {
|
||||||
|
cursor: wait;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-btn.success {
|
||||||
|
background: linear-gradient(0deg, rgba(40,167,69,1) 0%, rgba(76,203,112,1) 100%);
|
||||||
|
box-shadow: 0 0.7em 1.5em -0.5em rgba(40,167,69,0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-btn.failure {
|
||||||
|
background: linear-gradient(0deg, rgba(220,53,69,1) 0%, rgba(255,107,114,1) 100%);
|
||||||
|
box-shadow: 0 0.7em 1.5em -0.5em rgba(220,53,69,0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-btn svg {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%) scale(0);
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-btn.success svg, .custom-btn.failure svg {
|
||||||
|
transform: translate(-50%, -50%) scale(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkmark__circle, .crossmark__circle {
|
||||||
|
stroke-dasharray: 166;
|
||||||
|
stroke-dashoffset: 166;
|
||||||
|
stroke-width: 2;
|
||||||
|
stroke-miterlimit: 10;
|
||||||
|
stroke: #fff;
|
||||||
|
fill: none;
|
||||||
|
animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkmark__check, .crossmark__check {
|
||||||
|
transform-origin: 50% 50%;
|
||||||
|
stroke-dasharray: 48;
|
||||||
|
stroke-dashoffset: 48;
|
||||||
|
stroke: #fff;
|
||||||
|
stroke-width: 3;
|
||||||
|
fill: none;
|
||||||
|
animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes stroke {
|
||||||
100% {
|
100% {
|
||||||
opacity: 1;
|
stroke-dashoffset: 0;
|
||||||
transform: translateY(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes fadeOutContent {
|
||||||
|
to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes shakeButton {
|
||||||
|
0%, 100% {
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
10%, 30%, 50%, 70%, 90% {
|
||||||
|
transform: translateX(-5px);
|
||||||
|
}
|
||||||
|
20%, 40%, 60%, 80% {
|
||||||
|
transform: translateX(5px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-btn.processing span, .custom-btn.success span, .custom-btn.failure span {
|
||||||
|
animation: fadeOutContent 0.3s forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-btn.failure {
|
||||||
|
animation: shakeButton 0.5s cubic-bezier(.36,.07,.19,.97) both;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<body class="light-mode animate">
|
<body class="light-mode animate">
|
||||||
@@ -53,7 +130,7 @@
|
|||||||
<h1 class="title text-center animate">Connexion</h1>
|
<h1 class="title text-center animate">Connexion</h1>
|
||||||
<% if (currentUrl === '/auth/activedirectory' || (setupData[0] && setupData[0].hasOwnProperty('ldap'))) { %>
|
<% if (currentUrl === '/auth/activedirectory' || (setupData[0] && setupData[0].hasOwnProperty('ldap'))) { %>
|
||||||
<h3 class="text-center animate">Connexion avec Active Directory</h3>
|
<h3 class="text-center animate">Connexion avec Active Directory</h3>
|
||||||
<form action="/auth/activedirectory" method="post" class="mb-4 animate">
|
<form id="loginForm" class="mb-4 animate">
|
||||||
<% if (typeof errorMessage !== 'undefined' && errorMessage) { %>
|
<% if (typeof errorMessage !== 'undefined' && errorMessage) { %>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
@@ -67,23 +144,26 @@
|
|||||||
<input type="password" id="password" name="password" class="form-control animate" required>
|
<input type="password" id="password" name="password" class="form-control animate" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="submit" class="btn btn-primary d-flex align-items-center justify-content-center mx-auto d-block custom-btn">
|
<button type="submit" id="loginButton" class="btn btn-primary d-flex align-items-center justify-content-center mx-auto d-block custom-btn">
|
||||||
<span class="ml-2 animate">Se connecter</span>
|
<span class="ml-2 animate">Se connecter</span>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (typeof setupData.discord !== 'undefined') { %>
|
<% if (Array.isArray(setupData)) { %>
|
||||||
<% if (typeof setupData.ldap !== 'undefined') { %>
|
<% setupData.forEach(config => { %>
|
||||||
|
<% if (config.hasOwnProperty('discord') && config.discord.enabled === 'on') { %>
|
||||||
|
<% if (config.hasOwnProperty('ldap') && config.ldap.enabled === 'on') { %>
|
||||||
<h3 class="text-center animate">Ou</h3>
|
<h3 class="text-center animate">Ou</h3>
|
||||||
<% } %>
|
<% } %>
|
||||||
<button onclick="location.href='/auth/discord'" class="btn btn-primary d-flex align-items-center justify-content-center mx-auto d-block custom-btn">
|
<button onclick="redirectToDiscord('<%= config.discord.identifyURL %>')" class="btn btn-primary d-flex align-items-center justify-content-center mx-auto d-block custom-btn" id="discordButton">
|
||||||
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="#ffffff" width="24" height="24">
|
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="#ffffff" width="24" height="24">
|
||||||
<title>Discord</title>
|
<title>Discord</title>
|
||||||
<path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/>
|
<path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152..."></path>
|
||||||
</svg>
|
</svg> Se connecter avec Discord
|
||||||
<span class="ml-2 animate">Se connecter avec Discord</span>
|
|
||||||
</button>
|
</button>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
<% }); %>
|
||||||
|
<% } %>
|
||||||
<br>
|
<br>
|
||||||
<div class="d-flex justify-content-center animate">
|
<div class="d-flex justify-content-center animate">
|
||||||
<button id="themeSwitcher" class="btn btn-warning mt-3 animate">Changer de Thème</button>
|
<button id="themeSwitcher" class="btn btn-warning mt-3 animate">Changer de Thème</button>
|
||||||
@@ -114,34 +194,89 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var isAuthenticated = "<%= isAuthenticated %>" === "true";
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
var errorMessage = '<%= errorMessage %>';
|
const loginForm = document.getElementById('loginForm');
|
||||||
|
const loginButton = document.getElementById('loginButton');
|
||||||
|
|
||||||
if (isAuthenticated) {
|
loginForm.addEventListener('submit', function(e) {
|
||||||
Swal.fire({
|
e.preventDefault();
|
||||||
position: 'top',
|
|
||||||
icon: 'success',
|
const username = document.getElementById('username').value;
|
||||||
title: 'Authentification réussie!',
|
const password = document.getElementById('password').value;
|
||||||
text: 'Vous allez être redirigé vers le tableau de bord.',
|
|
||||||
showConfirmButton: false,
|
loginButton.disabled = true;
|
||||||
timer: 1800,
|
loginButton.innerHTML = '<span>Connexion en cours...</span>';
|
||||||
timerProgressBar: true,
|
loginButton.classList.add('processing');
|
||||||
toast: true,
|
|
||||||
willClose: () => {
|
fetch('/auth/activedirectory', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({ username, password }),
|
||||||
|
redirect: 'follow',
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log('Statut de la réponse:', response.status);
|
||||||
|
console.log('URL finale:', response.url);
|
||||||
|
if (response.url.includes('/dpanel/dashboard')) {
|
||||||
|
handleAuthResult(loginButton, true);
|
||||||
|
} else {
|
||||||
|
return response.text().then(text => {
|
||||||
|
console.log('Texte reçu:', text);
|
||||||
|
handleAuthResult(loginButton, false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Erreur:', error);
|
||||||
|
handleAuthResult(loginButton, false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleAuthResult(loginButton, isSuccess) {
|
||||||
|
loginButton.classList.remove('processing');
|
||||||
|
loginButton.classList.add(isSuccess ? 'success' : 'failure');
|
||||||
|
|
||||||
|
const iconSVG = isSuccess ? `
|
||||||
|
<svg class="checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="20" height="20">
|
||||||
|
<circle class="checkmark__circle" cx="26" cy="26" r="25" fill="none"/>
|
||||||
|
<path class="checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
|
||||||
|
</svg>
|
||||||
|
` : `
|
||||||
|
<svg class="crossmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" width="20" height="20">
|
||||||
|
<circle class="crossmark__circle" cx="26" cy="26" r="25" fill="none"/>
|
||||||
|
<path class="crossmark__check" fill="none" d="M16 16 36 36 M36 16 16 36"/>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
|
|
||||||
|
loginButton.innerHTML = iconSVG;
|
||||||
|
|
||||||
|
if (isSuccess) {
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log("Redirection vers /dpanel/dashboard");
|
||||||
window.location.replace('/dpanel/dashboard');
|
window.location.replace('/dpanel/dashboard');
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
loginButton.classList.remove('failure');
|
||||||
|
loginButton.innerHTML = '<span>Se connecter</span>';
|
||||||
|
loginButton.disabled = false;
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (errorMessage) {
|
|
||||||
Swal.fire({
|
function redirectToDiscord(url) {
|
||||||
position: 'top',
|
const discordButton = document.getElementById('discordButton');
|
||||||
icon: 'error',
|
|
||||||
title: 'Erreur lors de l\'authentification!',
|
discordButton.classList.add('btn-fill');
|
||||||
text: 'Merci de reessayer.',
|
discordButton.innerHTML = '<span>Redirection en cours...</span>';
|
||||||
showConfirmButton: false,
|
discordButton.disabled = true;
|
||||||
timer: 2200,
|
|
||||||
timerProgressBar: true,
|
setTimeout(() => {
|
||||||
toast: true,
|
window.location.href = url;
|
||||||
});
|
}, 1000);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,14 +1,38 @@
|
|||||||
<html>
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<link rel="icon" href="/public/assets/homelab_logo.png"/>
|
<meta charset="UTF-8">
|
||||||
<title>401 Authorization Required</title>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>403 ERROR</title>
|
||||||
|
<script>
|
||||||
|
function generateRequestId() {
|
||||||
|
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||||
|
let result = '';
|
||||||
|
for (let i = 0; i < 32; i++) {
|
||||||
|
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateTimestamp() {
|
||||||
|
return new Date().toISOString().replace(/[-:]/g, '').replace(/\..+/, 'Z');
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const requestId = generateRequestId();
|
||||||
|
const timestamp = generateTimestamp();
|
||||||
|
|
||||||
|
document.getElementById('request-id').innerText = requestId;
|
||||||
|
document.getElementById('timestamp').innerText = timestamp;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<center><h1>401 Authorization Required</h1></center>
|
<h1>403 ERROR</h1>
|
||||||
<center id="request-id"></center>
|
<p>The request could not be satisfied.</p>
|
||||||
<hr>
|
<p>Request blocked. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.</p>
|
||||||
<center>
|
<p>Generated by Myaxrin Nexus (Security Department)</p>
|
||||||
<a href="https://discord.gg/k6r96Tmtgx" target="_blank">SwiftLogic Labs</a>
|
<p>Request ID: <span id="request-id"></span></p>
|
||||||
</center>
|
<p>Timestamp: <span id="timestamp"></span></p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<i class="fas fa-user-shield"></i> Administration du site
|
<i class="fas fa-user-shield"></i> Administration du site
|
||||||
</a>
|
</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<a class="dropdown-item text-center text-white no-hover" href="/auth/logout" id="logoutLink">
|
<br><br><a class="dropdown-item text-center text-white no-hover custom-btn" href="/auth/logout" id="logoutLink">
|
||||||
<i class="fas fa-sign-out-alt text-white"></i> Déconnexion
|
<i class="fas fa-sign-out-alt text-white"></i> Déconnexion
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
<i class="fas fa-folder-open"></i> Accéder
|
<i class="fas fa-folder-open"></i> Accéder
|
||||||
</a>
|
</a>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<button class="btn btn-primary btn-round animated-button animated-button" onclick="renameFile('<%= folderName %>', '<%= file.name %>')">
|
<button class="btn btn-primary btn-round animated-button" onclick="renameFile('<%= folderName %>', '<%= file.name %>')">
|
||||||
<i class="fas fa-edit"></i> Renommer
|
<i class="fas fa-edit"></i> Renommer
|
||||||
</button>
|
</button>
|
||||||
<form class="file-actions mb-2" id="deleteForm" action="/api/dpanel/dashboard/delete" method="post">
|
<form class="file-actions mb-2" id="deleteForm" action="/api/dpanel/dashboard/delete" method="post">
|
||||||
@@ -143,7 +143,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<form class="file-actions d-flex align-items-center mb-2" action="/api/dpanel/dashboard/movefile" method="post">
|
<form id="moveFileForm" class="file-actions d-flex align-items-center mb-2" onsubmit="event.preventDefault(); moveFile(this.folderName.value, this.fileName.value);">
|
||||||
<input type="hidden" name="fileName" value="<%= file.name %>">
|
<input type="hidden" name="fileName" value="<%= file.name %>">
|
||||||
<select class="form-control rounded mr-2 custom-dropdown" name="folderName">
|
<select class="form-control rounded mr-2 custom-dropdown" name="folderName">
|
||||||
<option value="" disabled selected>Déplacer vers...</option>
|
<option value="" disabled selected>Déplacer vers...</option>
|
||||||
@@ -151,9 +151,8 @@
|
|||||||
<option value="<%= folder %>"><%= folder %></option>
|
<option value="<%= folder %>"><%= folder %></option>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
</select>
|
</select>
|
||||||
<button type="submit" class="btn btn-success btn-round animated-button">Déplacer</button>
|
<button type="submit" id="movefilebutton" class="btn btn-success btn-round animated-button">Déplacer</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<% } %>
|
<% } %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -167,7 +166,7 @@
|
|||||||
<div class="modal-dialog modal-lg rounded-lg" role="document">
|
<div class="modal-dialog modal-lg rounded-lg" role="document">
|
||||||
<div class="modal-content dark-mode">
|
<div class="modal-content dark-mode">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="patchNoteModalLabel">Patch Note<span class="badge badge-info ml-1">v1.0.0-beta.13</span></h5>
|
<h5 class="modal-title" id="patchNoteModalLabel">Patch Note<span class="badge badge-info ml-1">v1.0.0-beta.14</span></h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -176,15 +175,19 @@
|
|||||||
<div class="patch-note-item pl-3">
|
<div class="patch-note-item pl-3">
|
||||||
<p><i class="fas fa-tools"></i> Améliorations :</p>
|
<p><i class="fas fa-tools"></i> Améliorations :</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Améliorations mineures et corrections mineures.<span class="badge badge-success ml-1">AMÉLIORATION MINEURE</span></li>
|
<li>Améliorations mineures et corrections mineures sur tous les niveaux de l'application.<span class="badge badge-success ml-1">AMÉLIORATION MINEURE</span></li>
|
||||||
<li>Déplacement de fichier d'un dossier à la racine<span class="badge badge-success ml-1">AMÉLIORATION MAJEUR</span></li>
|
<li>Déplacement de fichier d'un dossier à la racine.<span class="badge badge-success ml-1">AMÉLIORATION MAJEURE</span></li>
|
||||||
|
<li>Suppression chargement login avec la connexion active directory.<span class="badge badge-success ml-1">AMÉLIORATION MAJEURE</span></li>
|
||||||
|
<li>Modification de la suppression des fichiers à la racine.<span class="badge badge-success ml-1">AMÉLIORATION MINEURE</span></li>
|
||||||
|
<li>Modification déplacement fichier sans destination.<span class="badge badge-success ml-1">AMÉLIORATION MINEURE</span></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="patch-note-item pl-3">
|
<div class="patch-note-item pl-3">
|
||||||
<p><i class="fas fa-wrench"></i> Ajout :</p>
|
<p><i class="fas fa-wrench"></i> Modifications :</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Ajout des endpoints d'api manquant externe à l'application<span class="badge badge-success ml-1">AJOUT EXPERIENCE MAJEUR</span></li>
|
<li>Correction majeure d'un bug de sécurité.<span class="badge badge-success ml-1">MODIFICATION MAJEURE</span></li>
|
||||||
|
<li>Modification du message "move file" réponse JSON.<span class="badge badge-success ml-1">MODIFICATION MINEURE</span></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -201,6 +204,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="metadataModal" class="modal" tabindex="-1" role="dialog">
|
<div id="metadataModal" class="modal" tabindex="-1" role="dialog">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
@@ -230,12 +234,12 @@
|
|||||||
<ul class="nav justify-content-center border-bottom pb-3 mb-3">
|
<ul class="nav justify-content-center border-bottom pb-3 mb-3">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link px-2 text-muted" href="#" data-toggle="modal" data-target="#patchNoteModal">
|
<a class="nav-link px-2 text-muted" href="#" data-toggle="modal" data-target="#patchNoteModal">
|
||||||
Version: 1.0.0-beta.13
|
Version: 1.0.0-beta.14
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="d-flex justify-content-center align-items-center">
|
<div class="d-flex justify-content-center align-items-center">
|
||||||
<p class="text-center text-muted mb-0">© 2024 SwiftLogic Labs</p>
|
<p class="text-center text-muted mb-0">© 2024 Myaxrin Labs</p>
|
||||||
<div class="ml-3">
|
<div class="ml-3">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -140,9 +140,10 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<form class="file-actions d-flex align-items-center mb-2" action="/api/dpanel/dashboard/movefile/<%= folderName %>" method="post">
|
<form id="moveFileForm" class="file-actions d-flex align-items-center mb-2">
|
||||||
<input type="hidden" name="fileName" value="<%= file.name %>">
|
<input type="hidden" name="fileName" value="<%= file.name %>">
|
||||||
<input type="hidden" name="userName" value="<%= userName %>">
|
<input type="hidden" name="userName" value="<%= userName %>">
|
||||||
|
<input type="hidden" name="oldFolderName" value="<%= folderName %>">
|
||||||
<select class="form-control rounded mr-2 custom-dropdown" name="newFolderName">
|
<select class="form-control rounded mr-2 custom-dropdown" name="newFolderName">
|
||||||
<option value="" disabled selected>Déplacer vers...</option>
|
<option value="" disabled selected>Déplacer vers...</option>
|
||||||
<option value="root">Dossier Racine</option>
|
<option value="root">Dossier Racine</option>
|
||||||
@@ -173,9 +174,9 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<footer class="py-3 my-4">
|
<footer class="py-3 my-4">
|
||||||
<ul class="nav justify-content-center border-bottom pb-3 mb-3">
|
<ul class="nav justify-content-center border-bottom pb-3 mb-3">
|
||||||
<li class="nav-item"><a class="nav-link px-2 text-muted">Version: 1.0.0-beta.13</a></li>
|
<li class="nav-item"><a class="nav-link px-2 text-muted">Version: 1.0.0-beta.14</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="text-center text-muted">© 2024 SwiftLogic Labs</p>
|
<p class="text-center text-muted">© 2024 Myaxrin Labs</p>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -14,30 +14,26 @@
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
.custom-btn {
|
.custom-btn {
|
||||||
transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
|
display: inline-flex;
|
||||||
color: #007BFF;
|
|
||||||
background-color: transparent;
|
|
||||||
padding: 10px 20px;
|
|
||||||
text-decoration: none;
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 4px 2px;
|
|
||||||
border-radius: 50px;
|
|
||||||
cursor: pointer;
|
|
||||||
box-shadow: 0 2px 5px rgba(0,0,0,0.25);
|
|
||||||
border: 2px solid #007BFF;
|
|
||||||
width: 50%;
|
|
||||||
margin: 0 auto;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
justify-content: center;
|
||||||
|
font-family: inherit;
|
||||||
.custom-btn:hover {
|
font-weight: 400;
|
||||||
transform: scale(1.15);
|
font-size: 20px;
|
||||||
background-color: #007BFF;
|
padding: 0.8em 1.6em; /* Réduit le padding */
|
||||||
color: #fff;
|
color: white;
|
||||||
|
background: linear-gradient(0deg, rgba(77,54,208,1) 0%, rgba(132,116,254,1) 100%);
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 0.7em 1.5em -0.5em #4d36d0be;
|
||||||
|
letter-spacing: 0.05em;
|
||||||
|
border-radius: 20em;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
min-width: 50px; /* Réduit la largeur minimale */
|
||||||
|
min-height: 30px; /* Réduit la hauteur minimale */
|
||||||
|
margin: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.animate {
|
.animate {
|
||||||
|
|||||||
@@ -29,24 +29,23 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.custom-btn {
|
.custom-btn {
|
||||||
transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
|
display: inline-flex;
|
||||||
color: #007BFF;
|
align-items: center;
|
||||||
background-color: transparent;
|
justify-content: center;
|
||||||
padding: 5px 10px;
|
font-family: inherit;
|
||||||
text-decoration: none;
|
font-weight: 500;
|
||||||
display: inline-block;
|
font-size: 14px; /* réduit la taille de la police */
|
||||||
font-size: 14px;
|
padding: 0.6em 1.2em; /* réduit le padding */
|
||||||
margin: 4px 2px;
|
color: white;
|
||||||
border-radius: 50px;
|
background: linear-gradient(0deg, rgba(77,54,208,1) 0%, rgba(132,116,254,1) 100%);
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 0.7em 1.5em -0.5em #4d36d0be;
|
||||||
|
letter-spacing: 0.05em;
|
||||||
|
border-radius: 15em; /* réduit le rayon de la bordure */
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
box-shadow: 0 2px 5px rgba(0,0,0,0.25);
|
transition: all 0.3s ease;
|
||||||
border: 2px solid #007BFF;
|
position: relative;
|
||||||
}
|
overflow: hidden;
|
||||||
|
|
||||||
.custom-btn:hover {
|
|
||||||
transform: scale(1.15);
|
|
||||||
background-color: #007BFF;
|
|
||||||
color: #fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user