some updates, will update to my own fork of dashboard soon

This commit is contained in:
Jonny_Bro (Nikita) 2023-06-22 17:33:33 +05:00
parent 274672a405
commit b0078f3a26
5 changed files with 359 additions and 319 deletions

View file

@ -70,8 +70,8 @@ class Play extends BaseCommand {
leaveOnEnd: false,
leaveOnStop: true,
skipOnNoStream: true,
maxSize: 500,
maxHistorySize: 100,
maxSize: 200,
maxHistorySize: 50,
});
}

View file

@ -1,6 +1,5 @@
const SoftUI = require("dbd-soft-ui"),
DBD = require("discord-dashboard"),
os = require("os");
DBD = require("discord-dashboard");
/**
*
@ -44,18 +43,17 @@ module.exports.load = async client => {
id: client.config.user,
secret: client.config.dashboard.secret,
},
cookiesSecret: client.config.dashboard.secret,
domain: client.config.dashboard.domain,
redirectUri: `${client.config.dashboard.domain}/discord/callback`,
redirectUri: `${client.config.dashboard.domain}${client.config.dashboard.port !== 80 ? `:${client.config.dashboard.port}` : ""}/discord/callback`,
bot: client,
ownerIDs: [ client.config.owner ],
requiredPermissions: [ DBD.DISCORD_FLAGS.Permissions.VIEW_CHANNEL ],
acceptPrivacyPolicy: true,
minimizedConsoleLogs: true,
invite: {
clientId: client.config.user,
scopes: ["bot", "applications.commands"],
permissions: "8",
redirectUri: client.config.dashboard.domain,
redirectUri: client.config.dashboard.domain + client.config.dashboard.port !== 80 ? `:${client.config.dashboard.port}` : "",
},
supportServer: {
slash: "/support",
@ -102,43 +100,32 @@ module.exports.load = async client => {
customThemeOptions: {
// eslint-disable-next-line no-unused-vars
index: async ({ req, res, config }) => {
const username = req.session?.user?.username || "Guest";
const user = req.session?.user;
const username = user?.username || "Guest";
const cards = [
{
title: "Current User",
icon: "single-02",
getValue: username,
progressBar: {
enabled: false,
getProgress: client.guilds.cache.size,
},
},
{
title: "CPU",
icon: "tv-2",
getValue: os.cpus()[0].model,
progressBar: {
enabled: false,
getProgress: 50,
},
},
{
title: "System Platform",
title: "Node Version",
icon: "settings-gear-65",
getValue: os.platform(),
progressBar: {
enabled: false,
getProgress: 50,
},
getValue: process.versions.node,
},
{
title: "Server Count",
title: "Users Count",
icon: "favourite-28",
getValue: client.users.cache.size,
},
{
title: "Servers Count",
icon: "notification-70",
getValue: `${client.guilds.cache.size} out of 2000`,
progressBar: {
enabled: true,
getProgress: (client.guilds.cache.size / 2000) * 100,
getProgress: Math.round((client.guilds.cache.size / 2000) * 100),
},
},
];
@ -196,50 +183,82 @@ module.exports.load = async client => {
},
commands: categories,
locales: {
enUS: require("../languages/en-US/dashboard.json"),
ruRU: require("../languages/ru-RU/dashboard.json"),
ukUA: require("../languages/uk-UA/dashboard.json"),
enUS: require("../languages/en-US/dashboard.json").DASHBOARD,
ruRU: require("../languages/ru-RU/dashboard.json").DASHBOARD,
ukUA: require("../languages/uk-UA/dashboard.json").DASHBOARD,
},
}),
customPages: [
DBD.customPagesTypes.redirectToUrl("/github", () => {
return "https://github.com/JonnyBro/JaBa";
}),
],
settings: [{
categoryId: "setup",
categoryName: "Setup",
categoryDescription: "Setup your bot with default settings!",
categoryOptionsList: [{
optionId: "lang",
optionName: "Language",
optionDescription: "Change bot's language easily",
optionType: DBD.formTypes.select({
"English": "en-US",
"Russian": "ru-RU",
"Ukrainian": "uk-UA",
}),
getActualSet: async ({ guild }) => {
const guildData = await client.findOrCreateGuild({
id: guild.id,
});
categoryId: "main",
categoryName: "Main settings",
categoryDescription: "Setup your bot here!",
categoryOptionsList: [
{
optionId: "lang",
optionName: "Language",
optionDescription: client.translate("administration/setlang:DESCRIPTION"),
optionType: DBD.formTypes.select({
"English": "en-US",
"Russian": "ru-RU",
"Ukrainian": "uk-UA",
}),
getActualSet: async ({ guild }) => {
const guildData = await client.findOrCreateGuild({
id: guild.id,
});
return guildData.language || client.defaultLanguage;
return guildData.language || client.defaultLanguage;
},
setNew: async ({ guild, newData }) => {
const guildData = await client.findOrCreateGuild({
id: guild.id,
});
guildData.language = newData;
await guildData.save();
return;
},
},
setNew: async ({ guild, newData }) => {
const guildData = await client.findOrCreateGuild({
id: guild.id,
});
{
optionId: "xd",
optionName: "OMG",
optionDescription: "Change bot's language on the server",
optionType: DBD.formTypes.select({
"English": "en-US",
"Russian": "ru-RU",
"Ukrainian": "uk-UA",
}),
getActualSet: async ({ guild }) => {
const guildData = await client.findOrCreateGuild({
id: guild.id,
});
guildData.language = newData;
await guildData.save();
return guildData.language || client.defaultLanguage;
},
setNew: async ({ guild, newData }) => {
const guildData = await client.findOrCreateGuild({
id: guild.id,
});
return;
guildData.language = newData;
await guildData.save();
return;
},
},
}],
],
}],
});
DBD.customPagesTypes.redirectToUrl("github", "https://github.com/JonnyBro/JaBa");
await Dashboard.init().then(() => {
client.logger.log(`Dashboard launched on port ${client.config.dashboard.port}`, "ready");
}).catch(err => {
client.logger.log(`Dashboard failed to initialize: ${err}`, "error");
client.logger.log(`Dashboard failed to initialize:\n${err}`, "error");
});
};

View file

@ -1,91 +1,98 @@
{
"name": "English",
"index": {
"feeds": [ "Current User", "CPU", "System Platform", "Server Count" ],
"card": {
"category": "JaBa Bot",
"title": "Simple bot made by <a href=\"https://github.com/JonnyBro\">Jonny_Bro</a>",
"description": "Upper Text",
"image": "",
"footer": "Bottom Text"
},
"feedsTitle": "Feeds",
"graphTitle": "Graphs"
},
"manage": {
"settings": {
"memberCount": "Members",
"info": {
"info": "Info",
"server": "Server Information"
}
}
},
"privacyPolicy": {
"title": "Privacy Policy",
"description": "Privacy Policy and Terms of Service",
"pp": "Complete Privacy Policy"
},
"partials": {
"sidebar": {
"dash": "Dashboard",
"manage": "Manage Guilds",
"commands": "Commands",
"pp": "Privacy Policy",
"admin": "Admin",
"account": "Account Pages",
"login": "Sign In",
"logout": "Sign Out"
},
"navbar": {
"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"
}
},
"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"
}
},
"preloader": {
"text": "Page is loading..."
},
"premium": {
"title": "Want more from JaBa?",
"description": "Check out premium features below!",
"buttonText": "Become Premium"
},
"settings": {
"title": "Site Configuration",
"description": "Configurable Viewing Options",
"theme": {
"title": "Site Theme",
"description": "Make the site more appealing for your eyes!"
"DASHBOARD": {
"name": "English",
"index": {
"feeds": [ "Current User", "Node version", "Users Count", "Servers Count" ],
"card": {
"category": "JaBa Bot",
"title": "Simple bot made by <a href=\"https://github.com/JonnyBro\">Jonny_Bro</a>",
"description": "Upper Text",
"image": "",
"footer": "Bottom Text"
},
"language": {
"title": "Site Language",
"description": "Select your preffered language!"
"feedsTitle": "Feeds",
"graphTitle": "Graphs"
},
"manage": {
"settings": {
"memberCount": "Members",
"info": {
"info": "Info",
"server": "Server Information"
}
}
},
"privacyPolicy": {
"title": "Privacy Policy",
"description": "Privacy Policy and Terms of Service",
"pp": "Complete Privacy Policy"
},
"partials": {
"sidebar": {
"dash": "Dashboard",
"manage": "Manage Guilds",
"commands": "Commands",
"pp": "Privacy Policy",
"admin": "Admin",
"account": "Account Pages",
"login": "Sign In",
"logout": "Sign Out"
},
"navbar": {
"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"
}
},
"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"
}
},
"sweetalert": {
"success": {
"login": "Successfully logged in."
}
},
"preloader": {
"text": "Page is loading..."
},
"premium": {
"title": "Want more from JaBa?",
"description": "Check out premium features below!",
"buttonText": "Become Premium"
},
"settings": {
"title": "Site Configuration",
"description": "Configurable Viewing Options",
"theme": {
"title": "Site Theme",
"description": "Make the site more appealing for your eyes!"
},
"language": {
"title": "Site Language",
"description": "Select your preffered language!"
}
}
}
}

View file

@ -1,91 +1,98 @@
{
"name": "Русский",
"index": {
"feeds": [ "Current User", "CPU", "System Platform", "Server Count" ],
"card": {
"category": "JaBa Bot",
"title": "Simple bot made by <a href=\"https://github.com/JonnyBro\">Jonny_Bro</a>",
"description": "Upper Text",
"image": "",
"footer": "Bottom Text"
},
"feedsTitle": "Feeds",
"graphTitle": "Graphs"
},
"manage": {
"settings": {
"memberCount": "Members",
"info": {
"info": "Info",
"server": "Server Information"
}
}
},
"privacyPolicy": {
"title": "Privacy Policy",
"description": "Privacy Policy and Terms of Service",
"pp": "Complete Privacy Policy"
},
"partials": {
"sidebar": {
"dash": "Dashboard",
"manage": "Manage Guilds",
"commands": "Commands",
"pp": "Privacy Policy",
"admin": "Admin",
"account": "Account Pages",
"login": "Sign In",
"logout": "Sign Out"
},
"navbar": {
"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"
}
},
"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"
}
},
"preloader": {
"text": "Page is loading..."
},
"premium": {
"title": "Want more from JaBa?",
"description": "Check out premium features below!",
"buttonText": "Become Premium"
},
"settings": {
"title": "Site Configuration",
"description": "Configurable Viewing Options",
"theme": {
"title": "Site Theme",
"description": "Make the site more appealing for your eyes!"
"DASHBOARD": {
"name": "Русский",
"index": {
"feeds": [ "Текущий пользователь", "Версия Node", "Кол-во пользователей", "Кол-во серверов" ],
"card": {
"category": "JaBa Bot",
"title": "Простой бот, созданный <a href=\"https://github.com/JonnyBro\">Jonny_Bro</a>",
"description": "Верхний текст",
"image": "",
"footer": "Нижний текст"
},
"language": {
"title": "Site Language",
"description": "Select your preffered language!"
"feedsTitle": "Новости",
"graphTitle": "Графики"
},
"manage": {
"settings": {
"memberCount": "Участники",
"info": {
"info": "Информация",
"server": "Информация о сервере"
}
}
},
"privacyPolicy": {
"title": "Политика конф.",
"description": "Политика конфиденциальности и Условия использования",
"pp": "Полная политика конфиденциальности"
},
"partials": {
"sidebar": {
"dash": "Панель управления",
"manage": "Сервера",
"commands": "Команды",
"pp": "Политика конф.",
"admin": "Админ панель",
"account": "Аккаунт",
"login": "Войти",
"logout": "Выйти"
},
"navbar": {
"home": "Главная",
"pages": {
"manage": "Настройки серверов",
"settings": "Настройки",
"commands": "Команды",
"pp": "Политика конфиденциальности",
"admin": "Админ панель",
"error": "Ошибка",
"credits": "Разработчики панели",
"debug": "Отладка",
"leaderboard": "Таблица лидеров",
"profile": "Профиль",
"maintenance": "Техобслуживание"
}
},
"title": {
"pages": {
"manage": "Настройки серверов",
"settings": "Настройки",
"commands": "Команды",
"pp": "Политика конфиденциальности",
"admin": "Админ панель",
"error": "Ошибка",
"credits": "Разработчики панели",
"debug": "Отладка",
"leaderboard": "Таблица лидеров",
"profile": "Профиль",
"maintenance": "Техобслуживание"
}
},
"sweetalert": {
"success": {
"login": "Вход выполнен."
}
},
"preloader": {
"text": "Загрузка..."
},
"premium": {
"title": "Хотите большего JaBa?",
"description": "Проверьте Премиум функции!",
"buttonText": "Стать Премиум"
},
"settings": {
"title": "Настройки сайта",
"description": "Настройте параметры панели управления",
"theme": {
"title": "Тема",
"description": "У нас есть тёмная и светлая!"
},
"language": {
"title": "Язык",
"description": "Выберите предпочитаемый язык!"
}
}
}
}

View file

@ -1,91 +1,98 @@
{
"name": "Українська",
"index": {
"feeds": [ "Current User", "CPU", "System Platform", "Server Count" ],
"card": {
"category": "JaBa Bot",
"title": "Simple bot made by <a href=\"https://github.com/JonnyBro\">Jonny_Bro</a>",
"description": "Upper Text",
"image": "",
"footer": "Bottom Text"
},
"feedsTitle": "Feeds",
"graphTitle": "Graphs"
},
"manage": {
"settings": {
"memberCount": "Members",
"info": {
"info": "Info",
"server": "Server Information"
}
}
},
"privacyPolicy": {
"title": "Privacy Policy",
"description": "Privacy Policy and Terms of Service",
"pp": "Complete Privacy Policy"
},
"partials": {
"sidebar": {
"dash": "Dashboard",
"manage": "Manage Guilds",
"commands": "Commands",
"pp": "Privacy Policy",
"admin": "Admin",
"account": "Account Pages",
"login": "Sign In",
"logout": "Sign Out"
},
"navbar": {
"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"
}
},
"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"
}
},
"preloader": {
"text": "Page is loading..."
},
"premium": {
"title": "Want more from JaBa?",
"description": "Check out premium features below!",
"buttonText": "Become Premium"
},
"settings": {
"title": "Site Configuration",
"description": "Configurable Viewing Options",
"theme": {
"title": "Site Theme",
"description": "Make the site more appealing for your eyes!"
"DASHBOARD": {
"name": "Українська",
"index": {
"feeds": [ "Поточний Користувач", "Версія Node", "Кількість користувачів", "Кількість серверів" ],
"card": {
"category": "JaBa Бот",
"title": "Простий бот, створений <a href=\"https://github.com/JonnyBro\">Jonny_Bro</a>",
"description": "Верхній Текст",
"image": "",
"footer": "Нижній Текст"
},
"language": {
"title": "Site Language",
"description": "Select your preffered language!"
"feedsTitle": "Канали",
"graphTitle": "Графіки"
},
"manage": {
"settings": {
"memberCount": "Учасники",
"info": {
"info": "Інформація",
"server": "Інформація про Сервер"
}
}
},
"privacyPolicy": {
"title": "Політика Конфіденційності",
"description": "Політика Конфіденційності та Умови Сервісу",
"pp": "Повна Політика Конфіденційності"
},
"partials": {
"sidebar": {
"dash": "Панель Керування",
"manage": "Налаштування серверів",
"commands": "Команди",
"pp": "Політика Конфіденційності",
"admin": "Адмін",
"account": "Сторінки Аккаунта",
"login": "Увійти",
"logout": "Вийти"
},
"navbar": {
"home": "Головна",
"pages": {
"manage": "Налаштування серверів",
"settings": "Керувати",
"commands": "Команди",
"pp": "Політика Конфіденційності",
"admin": "Панель Адміністратора",
"error": "Помилка",
"credits": "Автори",
"debug": "Налагодження",
"leaderboard": "Таблиця Лідерів",
"profile": "Профіль",
"maintenance": "Технічне Обслуговування"
}
},
"title": {
"pages": {
"manage": "Керувати Гілдіями",
"settings": "Керувати",
"commands": "Команди",
"pp": "Політика Конфіденційності",
"admin": "Панель Адміністратора",
"error": "Помилка",
"credits": "Автори",
"debug": "Налагодження",
"leaderboard": "Таблиця Лідерів",
"profile": "Профіль",
"maintenance": "Технічне Обслуговування"
}
},
"sweetalert": {
"success": {
"login": "Вхід виконано."
}
},
"preloader": {
"text": "Завантаження..."
},
"premium": {
"title": "Бажаєте більше від JaBa?",
"description": "Ознайомтесь з преміум-функціями нижче!",
"buttonText": "Стати Преміум"
},
"settings": {
"title": "Налаштування Сайту",
"description": "Налаштовувані параметри перегляду",
"theme": {
"title": "Тема",
"description": "Зробіть сайт більш привабливим для своїх очей!"
},
"language": {
"title": "Мова",
"description": "Виберіть бажану мову!"
}
}
}
}