Skip to content

Commit

Permalink
Prettier format
Browse files Browse the repository at this point in the history
  • Loading branch information
iMidnights committed Nov 15, 2022
1 parent 9bfa8cc commit 38b679e
Show file tree
Hide file tree
Showing 26 changed files with 1,218 additions and 1,298 deletions.
552 changes: 276 additions & 276 deletions icons.js

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
const colors = require("colors")
const npmUpdater = require("./utils/updater/npm")
const fileUpdater = require("./utils/updater/files")
const consolePrefix = `${"[".blue}${"dbd-soft-ui".yellow}${"]".blue} `
const Keyv = require("keyv")
const path = require("path")
const colors = require('colors')
const npmUpdater = require('./utils/updater/npm')
const fileUpdater = require('./utils/updater/files')
const consolePrefix = `${'['.blue}${'dbd-soft-ui'.yellow}${']'.blue} `
const Keyv = require('keyv')
const path = require('path')

module.exports = (themeConfig = {}) => {
return {
themeCodename: "softui",
viewsPath: path.join(__dirname, "/views"),
staticPath: path.join(__dirname, "/views/src"),
themeCodename: 'softui',
viewsPath: path.join(__dirname, '/views'),
staticPath: path.join(__dirname, '/views/src'),
themeConfig: {
...themeConfig,
defaultLocales: require("./locales.js"),
defaultLocales: require('./locales.js')
},
messages: {
error: {
addonLicense: `${consolePrefix}${
"Failed to initialise {{ADDON}}.\nThe license this addon was installed with does not match your current discord-dashboard license."
'Failed to initialise {{ADDON}}.\nThe license this addon was installed with does not match your current discord-dashboard license.'
.cyan
}`,
}`
},
success: {
addonLoaded: `${consolePrefix}${
"Successfully loaded {{ADDON}}.".cyan
}`,
},
'Successfully loaded {{ADDON}}.'.cyan
}`
}
},
embedBuilderComponent: require("fs").readFileSync(
path.join(__dirname, "/embedBuilderComponent.txt"),
"utf8"
embedBuilderComponent: require('fs').readFileSync(
path.join(__dirname, '/embedBuilderComponent.txt'),
'utf8'
),
init: async (app, config) => {
let outdated = false
Expand All @@ -41,28 +41,28 @@ module.exports = (themeConfig = {}) => {

const db = new Keyv(
themeConfig.dbdriver ||
"sqlite://" + path.join(__dirname, "/database.sqlite")
'sqlite://' + path.join(__dirname, '/database.sqlite')
)

db.on("error", (err) => {
console.log("Connection Error", err)
db.on('error', (err) => {
console.log('Connection Error', err)
process.exit()
})

themeConfig = {
...themeConfig,
defaultLocales: require("./locales.js"),
defaultLocales: require('./locales.js')
}

require("./utils/functions/errorHandler")(config, themeConfig, db)
require("./utils/functions/settingsPage")(config, themeConfig, db)
require('./utils/functions/errorHandler')(config, themeConfig, db)
require('./utils/functions/settingsPage')(config, themeConfig, db)
// await require('./utils/addonManager').execute(themeConfig, config, app, module.exports.messages);
require("./utils/initPages").init(config, themeConfig, app, db)
},
require('./utils/initPages').init(config, themeConfig, app, db)
}
}
}

module.exports.partials = __dirname + "/views/partials"
module.exports.formTypes = require("./utils/formtypes")
module.exports.Feed = require("./utils/feedHandler")
module.exports.cmdHandler = require("./utils/cmdHandler")
module.exports.partials = __dirname + '/views/partials'
module.exports.formTypes = require('./utils/formtypes')
module.exports.Feed = require('./utils/feedHandler')
module.exports.cmdHandler = require('./utils/cmdHandler')
126 changes: 63 additions & 63 deletions locales.js
Original file line number Diff line number Diff line change
@@ -1,95 +1,95 @@
module.exports = {
enUS: {
name: "English",
name: 'English',
index: {
feeds: ["Current Users", "CPU", "System Platform", "Server Count"],
feeds: ['Current Users', 'CPU', 'System Platform', 'Server Count'],
card: {
category: "Soft UI",
title: "Assistants - The center of everything",
category: 'Soft UI',
title: 'Assistants - The center of everything',
description:
"Assistants Discord Bot management panel. Assistants Bot was created to give others the ability to do what they want. Just.<br>That's an example text.<br><br><b><i>Feel free to use HTML</i></b>",
footer: "Learn More",
image: "/img/soft-ui.webp",
linkText: "Learn more",
footer: 'Learn More',
image: '/img/soft-ui.webp',
linkText: 'Learn more'
},
feedsTitle: "Feeds",
graphTitle: "Graphs",
feedsTitle: 'Feeds',
graphTitle: 'Graphs'
},
manage: {
settings: {
memberCount: "Members",
memberCount: 'Members',
info: {
info: "Info",
server: "Server Information",
},
},
info: 'Info',
server: 'Server Information'
}
}
},
privacyPolicy: {
title: "Privacy Policy",
description: "Privacy Policy and Terms of Service",
title: 'Privacy Policy',
description: 'Privacy Policy and Terms of Service'
},
partials: {
sidebar: {
dash: "Dashboard",
manage: "Manage Guilds",
commands: "Commands",
pp: "Privacy Policy",
admin: "Admin",
account: "Account Pages",
login: "Sign In",
logout: "Sign Out",
dash: 'Dashboard',
manage: 'Manage Guilds',
commands: 'Commands',
pp: 'Privacy Policy',
admin: 'Admin',
account: 'Account Pages',
login: 'Sign In',
logout: 'Sign Out'
},
navbar: {
home: "Home",
home: 'Home',
pages: {
manage: "Manage Guilds",
settings: "Manage Guilds",
commands: "Commands",
pp: "Privacy Policy",
admin: "Admin Panel",
error: "Error",
credits: "Credits",
debug: "Debug",
leaderboard: "Leaderboard",
profile: "Profile",
maintenance: "Under Maintenance",
},
manage: 'Manage Guilds',
settings: 'Manage Guilds',
commands: 'Commands',
pp: 'Privacy Policy',
admin: 'Admin Panel',
error: 'Error',
credits: 'Credits',
debug: 'Debug',
leaderboard: 'Leaderboard',
profile: 'Profile',
maintenance: 'Under Maintenance'
}
},
title: {
pages: {
manage: "Manage Guilds",
settings: "Manage Guilds",
commands: "Commands",
pp: "Privacy Policy",
admin: "Admin Panel",
error: "Error",
credits: "Credits",
debug: "Debug",
leaderboard: "Leaderboard",
profile: "Profile",
maintenance: "Under Maintenance",
},
manage: 'Manage Guilds',
settings: 'Manage Guilds',
commands: 'Commands',
pp: 'Privacy Policy',
admin: 'Admin Panel',
error: 'Error',
credits: 'Credits',
debug: 'Debug',
leaderboard: 'Leaderboard',
profile: 'Profile',
maintenance: 'Under Maintenance'
}
},
preloader: {
text: "Page is loading...",
text: 'Page is loading...'
},
premium: {
title: "Want more from Assistants?",
description: "Check out premium features below!",
buttonText: "Become Premium",
title: 'Want more from Assistants?',
description: 'Check out premium features below!',
buttonText: 'Become Premium'
},
settings: {
title: "Site Configuration",
description: "Configurable Viewing Options",
title: 'Site Configuration',
description: 'Configurable Viewing Options',
theme: {
title: "Site Theme",
description: "Make the site more appealing for your eyes!",
title: 'Site Theme',
description: 'Make the site more appealing for your eyes!'
},
language: {
title: "Site Language",
description: "Select your preferred language!",
},
},
},
},
title: 'Site Language',
description: 'Select your preferred language!'
}
}
}
}
}
28 changes: 14 additions & 14 deletions pages/admin/control.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
const Nodeactyl = require("nodeactyl")
const Nodeactyl = require('nodeactyl')

const npmUpdater = require("../../utils/updater/npm")
const fileUpdater = require("../../utils/updater/files")
const npmUpdater = require('../../utils/updater/npm')
const fileUpdater = require('../../utils/updater/files')

module.exports = {
page: "/control",
page: '/control',
execute: async (req, res, app, config, themeConfig, info) => {
const pterodactyl = new Nodeactyl.NodeactylClient(
themeConfig.admin.pterodactyl.panelLink,
themeConfig.admin.pterodactyl.apiKey
)
const { uuid, action } = req.query
if (!uuid && action && req.query.type) {
if (req.query.type === "npm") await npmUpdater.update()
if (req.query.type === "live") await fileUpdater.update()
return res.redirect("/admin?result=true")
if (req.query.type === 'npm') await npmUpdater.update()
if (req.query.type === 'live') await fileUpdater.update()
return res.redirect('/admin?result=true')
}
if (!uuid || !action) return res.sendStatus(412)

try {
if (action === "start") await pterodactyl.startServer(uuid)
if (action === "restart") await pterodactyl.restartServer(uuid)
if (action === "stop") await pterodactyl.stopServer(uuid)
if (action === "kill") await pterodactyl.killServer(uuid)
if (action === 'start') await pterodactyl.startServer(uuid)
if (action === 'restart') await pterodactyl.restartServer(uuid)
if (action === 'stop') await pterodactyl.stopServer(uuid)
if (action === 'kill') await pterodactyl.killServer(uuid)
} catch (error) {
console.error(error)
return res.redirect("/admin?result=false")
return res.redirect('/admin?result=false')
}
return res.redirect("/admin?result=true")
},
return res.redirect('/admin?result=true')
}
}
Loading

0 comments on commit 38b679e

Please sign in to comment.