|
|
|
import { Response } from "express"
|
|
|
|
import { parseAuthFile, parseDataFile } from "./utils/assJSONStructure"
|
|
|
|
import { RenderOptions } from "./typings/Pager"
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
import { ASS_DOMAIN, ASS_SECURE } from "./constants"
|
|
|
|
import { convertTimestamp, convertToPaginatedArray, formatSize, } from "./utils/utils"
|
|
|
|
import { getSettingsDatabase, getUserDatabase, getUserDatabaseObj } from "./utils/database"
|
|
|
|
import { ASSUser, ASSItem } from "./typings/ASS"
|
|
|
|
import { IExtendedRequest } from "./typings/express-ext"
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
import { ISettingsDatabase, IUsersDatabase, IUserSettings } from "./typings/database"
|
|
|
|
|
|
|
|
export class Pager {
|
|
|
|
/**
|
|
|
|
* Process and render the specified template with provided options
|
|
|
|
*/
|
|
|
|
static async render(
|
|
|
|
res: Response,
|
|
|
|
req: IExtendedRequest,
|
|
|
|
template: string,
|
|
|
|
options?: RenderOptions
|
|
|
|
) {
|
|
|
|
if (!options) options = { params: {} }
|
|
|
|
if (!options.params) options.params = []
|
|
|
|
|
|
|
|
const data: Array<ASSItem> = parseDataFile()
|
|
|
|
const users: Array<ASSUser> = parseAuthFile()
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
const dickUsers: IUsersDatabase = getUserDatabase()
|
|
|
|
const database: ISettingsDatabase = getSettingsDatabase()
|
|
|
|
|
|
|
|
// If user is already authenticated load the authenticated data
|
|
|
|
if (req.isAuthenticated()) {
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
return this.renderAuthenticatedData(res, req, template, options, data, users, database, dickUsers)
|
|
|
|
}
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
|
|
|
|
// If user is not authenticated only load guest data
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
return this.renderUnauthenticatedData(res, req, template, options, data, users, database)
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders templates for unauthenticated templates
|
|
|
|
*/
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
static async renderUnauthenticatedData(
|
|
|
|
res: Response,
|
|
|
|
req: IExtendedRequest,
|
|
|
|
template: string,
|
|
|
|
options: RenderOptions,
|
|
|
|
data: Array<ASSItem>,
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
users: Array<ASSUser>,
|
|
|
|
settingsDatabase: ISettingsDatabase
|
|
|
|
) {
|
|
|
|
const totalUsers = users.length
|
|
|
|
const totalData = data.length
|
|
|
|
const totalSize = formatSize(data.map(item => item.size).reduce((prev, curr) => prev + curr, 0))
|
|
|
|
|
|
|
|
const baseData = {
|
|
|
|
params: options.params,
|
|
|
|
path: req.path,
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
settingsDatabase,
|
|
|
|
totalUsers,
|
|
|
|
totalData,
|
|
|
|
totalSize
|
|
|
|
}
|
|
|
|
|
|
|
|
// We render template using the absolute path of the template and the merged default data with the additional data provided.
|
|
|
|
return res.render(template, Object.assign(baseData, options))
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders templates for authenticated templates,
|
|
|
|
*/
|
|
|
|
// eslint-disable-next-line complexity
|
|
|
|
static async renderAuthenticatedData(
|
|
|
|
res: Response,
|
|
|
|
req: IExtendedRequest,
|
|
|
|
template: string,
|
|
|
|
options: RenderOptions,
|
|
|
|
data: Array<ASSItem>,
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
users: Array<ASSUser>,
|
|
|
|
settingsDatabase: ISettingsDatabase,
|
|
|
|
dickUsers: IUsersDatabase
|
|
|
|
) {
|
|
|
|
// * -------------------- BUILD DATA OBJECT FOR FRONTEND EJS VARIABLES ------------
|
|
|
|
const totalUsers = users.length
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
const allUsers = []
|
|
|
|
for (const user of users) {
|
|
|
|
allUsers.push(`${user.username}`)
|
|
|
|
}
|
|
|
|
const user: IUserSettings = getUserDatabaseObj(req.user.username)
|
|
|
|
const totalData = data.length
|
|
|
|
const totalSize = formatSize(data.map(item => item.size).reduce((prev, curr) => prev + curr, 0))
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
const hasRole = user.role == "admin" ? true : false
|
|
|
|
// Get all the specific users file information, using secret key to match
|
|
|
|
const usersData = data.filter(item => item.owner == req.user.password).map((item) => ({
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
...item,
|
|
|
|
timestamp: convertTimestamp(item.timestamp)
|
|
|
|
})).sort((a, b) => {
|
|
|
|
let da = new Date(a.timestamp),
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
db = new Date(b.timestamp)
|
|
|
|
return db.getTime() - da.getTime()
|
|
|
|
})
|
|
|
|
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
const appDataObj = {
|
|
|
|
allImages: data.filter(item => item.type.includes('image')),
|
|
|
|
allVideos: data.filter(item => item.type.includes('video')),
|
|
|
|
allAudio: data.filter(item => item.type.includes('audio')),
|
|
|
|
allOthers: data.filter(item => item.type.includes('other')),
|
|
|
|
totalSize: formatSize(data.map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
|
|
|
|
totalImageSize: formatSize(data.filter(item => item.type.includes('image')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
|
|
|
|
totalVideosSize: formatSize(data.filter(item => item.type.includes('video')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
|
|
|
|
totalAudioSize: formatSize(data.filter(item => item.type.includes('audio')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
|
|
|
|
totalOthersSize: formatSize(data.filter(item => item.type.includes('other')).map(item => item.size).reduce((prev, curr) => prev + curr, 0))
|
|
|
|
}
|
|
|
|
|
|
|
|
const usersDataObj = {
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
data: convertToPaginatedArray(usersData, 50),
|
|
|
|
totalFiles: usersData.length,
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
allImages: usersData.filter(item => item.type.includes('image')),
|
|
|
|
allVideos: usersData.filter(item => item.type.includes('video')),
|
|
|
|
allAudio: usersData.filter(item => item.type.includes('audio')),
|
|
|
|
allOthers: usersData.filter(item => item.type.includes('other')),
|
|
|
|
totalSize: formatSize(usersData.map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
|
|
|
|
totalImageSize: formatSize(usersData.filter(item => item.type.includes('image')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
|
|
|
|
totalVideosSize: formatSize(usersData.filter(item => item.type.includes('video')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
|
|
|
|
totalAudioSize: formatSize(usersData.filter(item => item.type.includes('audio')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
|
|
|
|
totalOthersSize: formatSize(usersData.filter(item => item.type.includes('other')).map(item => item.size).reduce((prev, curr) => prev + curr, 0))
|
|
|
|
}
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
|
|
|
|
let targetDataObj = {}
|
|
|
|
// If the user is staff and is trying to view another users information, we will grab it here to render that as well..
|
|
|
|
/*
|
|
|
|
if (options.params.userID) {
|
|
|
|
const targetData = data.filter((item: ASSItem ) => (item: { owner: string }) => item.owner == options.params.userID)
|
|
|
|
targetDataObj = {
|
|
|
|
data: convertToPaginatedArray(targetData,50),
|
|
|
|
allImages: targetData.filter(item=> item.type.includes('image')),
|
|
|
|
allVideos: targetData.filter(item=> item.type.includes('video')),
|
|
|
|
allAudio: targetData.filter(item=> item.type.includes('audio')),
|
|
|
|
allOthers: targetData.filter(item=> item.type.includes('other')),
|
|
|
|
totalSize:formatSize(targetData.map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
|
|
|
|
totalImageSize: formatSize(targetData.filter(item=> item.type.includes('image')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
|
|
|
|
totalVideosSize: formatSize(targetData.filter(item=> item.type.includes('video')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
|
|
|
|
totalAudioSize: formatSize(targetData.filter(item=> item.type.includes('file')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
|
|
|
|
totalOthersSize: formatSize(targetData.filter(item=> item.type.includes('other')).map(item => item.size).reduce((prev, curr) => prev + curr, 0))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
|
|
|
|
const baseData = {
|
V1.1.0 (#24)
## Update Info
🍆 **DICK** v1.1.0 🍆
Our number is getting bigger! Though, I hear size is not what matters
but how you use it. So, I am happy to introduce you to a bunch of new
stuff within the front end!
🔀 **UPDATING**
Updating your instance should be easy, unless you already edited the
code base, at that point your on your own.
If you have a direct clone of the master of the current 1.0.2(old
master) branch, then all you need to do is
1. Browse to your DICK folder
2. Run `git pull` to pull new changes
3. Run `npm i` to install new dependancies
4. Delete the `dist` folder
5. Start DICK using `npm start`
6. Enjoy
> **Note**
> If you load your instance and styling seems wrong, please clear your
browsers cache, and reload the page.
> **Note**
> The first user to log into your DICK WebUI will be marked as the
instance admin. You can change which users are admin by editing the user
database file located at `/src/database/users.json`. This file will only
appear once you've started your instance for the first time.
✏️ **CHANGELOG**
```diff
ADDITIONS
+ Admin Dashboard
> This page will be where system administrators can view their syatem settings and stats!
+ Database
> Added DICK database, inside JSON files with management utils.
+ Added new app settings page to Admin Dashboard
> This will allow administrators to customize their instance on the fly without having to edit the codebase. White labeling!
+ Added user list to Admin Dashboard
> This allows administrators to view which users are registered in their ASS currently, and their roles set. You can also create new users from this page. (There are a lot of hidden divs in this page so imstance admins can add extra code to dick to enable stuff like deletion of users)
+ Registrations
> Administrators can toggle registrations into their ASS from their DICK UI via the /register page!
+ Captcha
> By default, when a user gets login information wrong they will be forwarded to a Rick Roll. Now you can add a hCaptcha site key to DICK to enable hCaptcha for your login and register public pages!
+ Added a "default profile picture"
> Every users default profile picture. This is planned to be able to be set per user in the future, so users can pick their own seperate from the default.
REMOVALS
- Removeed STAFF_IDs from codebase.
> This means you can remove this CONSTANT from your instance CONSTANTS file, please see the repo's constants example file to see if yours matches it.
```
```fix
CHANGES
= Large codebase cleanup
= Seperated js for components into their own files based on job
= Redid some naming for tailwind colour theme classes to provide proper theming from the tailwind config file
= Cleaned up a lot of the utils
= Added embed gen page as a hidden extra for devs to add themselves in their own time if they wish (please PR if you achieve this 🤘)
= Fixed the flash message warning colours to actually be red or green depending on error/success
```
## Issues Resolved / Fixes In This Release
Resolves #17 , Resolves #14 , Resolves #10 , Resolves #7
2 years ago
|
|
|
assDomain: ASS_DOMAIN,
|
|
|
|
assSecure: ASS_SECURE,
|
|
|
|
user: req.user,
|
|
|
|
settingsDatabase,
|
|
|
|
totalSize,
|
|
|
|
totalUsers,
|
|
|
|
allUsers,
|
|
|
|
dickUsers,
|
|
|
|
totalData,
|
|
|
|
usersDataObj,
|
|
|
|
appDataObj,
|
|
|
|
//targetDataObj: options.params.userID ? targetDataObj : null,
|
|
|
|
params: options.params,
|
|
|
|
path: req.path,
|
|
|
|
hasRole
|
|
|
|
}
|
|
|
|
|
|
|
|
return res.render(template, Object.assign(baseData, options))
|
|
|
|
}
|
|
|
|
}
|