Giter Club home page Giter Club logo

snaily-cadv3's Introduction

SnailyCADv3

⚠ Please Read ⚠

SnailyCADv3 is going in maintenace mode on 2021-11-01. From then there will be no new features nor bug fixes. SnailyCADv3 will be archived on 2021-12-30.

What's next?

SnailyCADv4!

IMO, SnailyCADv3 was both absolutly amazing and a disaster. There were many problems with installations and hosting setups. I'm creating v4 to ease some of this by creating better API's and writting better documentation.

You can find SnailyCADv4 here.

SnailyCADv4 documentation can be found here

Supporting SnailyCAD

All stars/forks are appreciated! ⚡

Feel free to open a pull request with a new feature and issues for fixes!

Made with ❤️ and TypeScript!

License

MIT © Dev-CasperTheGhost

snaily-cadv3's People

Contributors

bound2 avatar casperiv0 avatar dependabot[bot] avatar filippo-fonseca avatar gsbarbo avatar henriots avatar motorloid01 avatar nick-perry14 avatar notaracc avatar ryanlewis2018 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

snaily-cadv3's Issues

Docker installation failed

What version of Node.js are you using?

14.17.2

What version of npm are you using?

6.14.13

What operating system are you using?

Debian 10

Describe the Bug

When starting the cad with docker, the following error happens:
2021-07-23 19_41_22 - PuTTY

the only change I made was changing the phpmyadmin port to 9090 instead of 8080

Expected Behavior

The CAD should start

To Reproduce

follow instructions in the wiki an change phpmyadim port to 9090

[Bug]

Describe the bug
When using the discord webhook, I noticed that the callsign, and the officers name and callsign are conjoined together.

To Reproduce
Steps to reproduce the behavior:

  1. Set a valid webhook URL within the admin panel.
  2. Go to the LEO Dashboard, and go on duty.
  3. Look at the readout from the discord webhook

Expected behavior
A space or a space and a vertical line separating the officers name and callsign.

Screenshots
If applicable, add screenshots to help explain your problem.
https://prnt.sc/10ic0b9
^ screenshot

Desktop (please complete the following information):

Discord with CAD Version 1.4.0

Additional context
N/A

[FEATURE REQUEST]: Do not allow special characters in usernames

Describe the feature you'd like to get added
People are registring with usernames that have, for example, spaces in them, which might not be very ideal. I haven't dug into very detail what and how username validation should be handled, so you might have to do some research.

Additional context
However, those users which have already registered, should be able to keep their usernames.

[Bug] Cannot find config

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Desktop (please complete the following information):

  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Add Checks

Add checks to see if 'config.ts' exists and if connection to database is available.

Can't allow Iframe usage

For some reason when changing allowIframes: false to true it's not only not allowing Iframes but also denying browser access as well. Thanks for your help Casper! :)

Clicking on dropdown menu, which doesn't have items, makes whole screen black

Describe the bug
When clicking on dropdown menu, which has no items, results in black screen. Only way to get back is to reload webpage

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'weapons/register' (however, this occures with all dropdown lists)
  2. Click on 'Enter Weapon dropdown' when not having anything defined
  3. Screen is black and have to refresh the page

Expected behavior
Should show empty list instead

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Browser Chrome
  • Version 89

Error message does not contain field names

What version of Node.js are you using?

v12.22.6

What version of npm are you using?

6.14.15

What operating system are you using?

CentOS Linux release 7.9.2009

Describe the Bug

When trying to save a citizen without entering the required fields, we get an error.

The error message specifies the id of the input fields instead of the field name.

Expected Behavior

Displaying the field names instead of the input field id in the error message

To Reproduce

Page: /citizen/create

On the create page, press the create button and get an error:
GZP0iT3 1

Shared Citizen

It would be nice if everyone with PD, EMS, DOJ, and Admin could see all citizens created. Then it would be more like an actual MDT device. Reports, Medical records, Profiles, lic, cars, wepaons, all synced so that Dispath can actually look up people and plates. As it sets now, everyone needs to create the same citizen and update that profile when anything happens

Login header

Describe the feature you'd like to get added
A clear and concise description of any alternative solutions or features you've considered.

Remove the navigation bar for users that arent logged in.

Additional context
Add any other context or screenshots about the feature request here.

User Registration

Describe the feature you'd like to get added
A clear and concise description of any alternative solutions or features you've considered.
Allow admins to create accounts versus members to stop spam accounts from being created or allow us to create a code for users to use to register accounts or allow communities to choose weather users can create their own accounts or if admins should create the accounts for the users.

Additional context
Add any other context or screenshots about the feature request here.

Feature Request - Expungement Username/Civilian Shown

So whenever you go to look at the expungement requests under the Civilian Management panel, you can see what the person is requesting to be expunged, but you can't see the Civilian/User who is requesting it, which makes it difficult for the Staff in the CAD to tell who they are removing it from.

See the Imgur link below for what it currently shows.
https://imgur.com/a/WmoFaoD

[Bug]

Describe the bug
it shows the bug in the screenshot

To Reproduce
Steps to reproduce the behavior:

  1. Download newest verison
  2. npm start

Expected behavior
I expected this to start the cad

Screenshots
image

Desktop (please complete the following information):

  • Version Newest w/ Temp passwords

Additional context
Add any other context about the problem here.

[Bug]

hello I have these errors during the installation I corrected it by deleting and reinstating as requiring me di that I am co but impossible to connect me to the DB

ng: Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?)' at line 1

Capture2
Capture3
Capture4
snaily-cadv2 or not prob
thinks

Forgot Password Feature

Describe the feature you'd like to get added
"Forgot password" this would be a nice feature as some of my members forgot there password so had to remove there accounts.... or a option for cad admins to reset a users password to a temp password.

Additional context
Add any other context or screenshots about the feature request here.

npm build error

Describe the bug
When I run NPM Start it does not start and gives me a error log.

To Reproduce
run npm start

Expected behavior
Start the app

Screenshots
image

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 info lifecycle [email protected]
start: [email protected]
7 verbose lifecycle [email protected]start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\snaily-cadv3\node_modules.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\nodejs;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;;C:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Administrator\AppData\Roaming\npm
9 verbose lifecycle [email protected]start: CWD: C:\snaily-cadv3
10 silly lifecycle [email protected]
start: Args: [
10 silly lifecycle '/d /s /c',
10 silly lifecycle 'npm run translation:generate && npm run build && cross-env NODE_ENV=production node dist/server.js'
10 silly lifecycle ]
11 silly lifecycle [email protected]start: Returned: code: 134 signal: null
12 info lifecycle [email protected]
start: Failed to exec start script
13 verbose stack Error: [email protected] start: npm run translation:generate && npm run build && cross-env NODE_ENV=production node dist/server.js
13 verbose stack Exit status 134
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\snaily-cadv3
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v14.16.1
19 verbose npm v6.14.12
20 error code ELIFECYCLE
21 error errno 134
22 error [email protected] start: npm run translation:generate && npm run build && cross-env NODE_ENV=production node dist/server.js
22 error Exit status 134
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 134, true ]

Desktop (please complete the following information):
n/a

Additional context
n/a

TEXT column can't have a default value

What version of Node.js are you using?

v12.22.6

What version of npm are you using?

6.14.15

What operating system are you using?

CentOS Linux release 7.9.2009

Describe the Bug

When I run a "pure" CAD in the console, I get errors:
0|CAD | Error: ER_BLOB_CANT_HAVE_DEFAULT: BLOB, TEXT, GEOMETRY or JSON column 'data' can't have a default value
0|CAD | at Query.Sequence._packetToError (/var/www/snaily-cadv3/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
0|CAD | at Query.ErrorPacket (/var/www/snaily-cadv3/node_modules/mysql/lib/protocol/sequences/Query.js:79:18)
0|CAD | at Protocol._parsePacket (/var/www/snaily-cadv3/node_modules/mysql/lib/protocol/Protocol.js:291:23)
0|CAD | at Parser._parsePacket (/var/www/snaily-cadv3/node_modules/mysql/lib/protocol/Parser.js:433:10)
0|CAD | at Parser.write (/var/www/snaily-cadv3/node_modules/mysql/lib/protocol/Parser.js:43:10)
0|CAD | at Protocol.write (/var/www/snaily-cadv3/node_modules/mysql/lib/protocol/Protocol.js:38:16)
0|CAD | at Socket. (/var/www/snaily-cadv3/node_modules/mysql/lib/Connection.js:88:28)
0|CAD | at Socket. (/var/www/snaily-cadv3/node_modules/mysql/lib/Connection.js:526:10)
0|CAD | at Socket.emit (events.js:314:20)
0|CAD | at addChunk (_stream_readable.js:297:12)
0|CAD | at readableAddChunk (_stream_readable.js:272:9)
0|CAD | at Socket.Readable.push (_stream_readable.js:213:10)
0|CAD | at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
0|CAD | --------------------
0|CAD | at Protocol._enqueue (/var/www/snaily-cadv3/node_modules/mysql/lib/protocol/Protocol.js:144:48)
0|CAD | at Connection.query (/var/www/snaily-cadv3/node_modules/mysql/lib/Connection.js:198:25)
0|CAD | at /var/www/snaily-cadv3/node_modules/@casper124578/mysql.ts/dist/QueryBuilder.js:236:29
0|CAD | at new Promise ()
0|CAD | at QueryBuilder.exec (/var/www/snaily-cadv3/node_modules/@casper124578/mysql.ts/dist/QueryBuilder.js:234:16)
0|CAD | at processQuery (/var/www/snaily-cadv3/dist/src/lib/database.js:30:59)
0|CAD | at async updateLine (/var/www/snaily-cadv3/dist/src/lib/database.js:45:9) {
0|CAD | code: 'ER_BLOB_CANT_HAVE_DEFAULT',
0|CAD | errno: 1101,
0|CAD | sqlMessage: "BLOB, TEXT, GEOMETRY or JSON column 'data' can't have a default value",
0|CAD | sqlState: '42000',
0|CAD | index: 0,
0|CAD | sql: '\n' +
0|CAD | ' CREATE TABLE mugshots (\n' +
0|CAD | ' id varchar(255) NOT NULL,\n' +
0|CAD | ' citizen_id varchar(255) NOT NULL,\n' +
0|CAD | " data text NOT NULL DEFAULT '[]',\n" +
0|CAD | ' officer_name varchar(255) NOT NULL,\n' +
0|CAD | ' full_date text NOT NULL,\n' +
0|CAD | ' officer_id varchar(255) NOT NULL,\n' +
0|CAD | ' PRIMARY KEY (id)\n' +
0|CAD | ' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n' +
0|CAD | ' '
0|CAD | }

The default values for TEXT and BLOB are described in the official MySQL documentation: https://dev.mysql.com/doc/refman/8.0/en/blob.html

The problem with tables:

  • seo_tags
  • mugshots

Expected Behavior

Don't get errors :)

To Reproduce

Just run a "clean" CAD

[Bug] Unable to create officer

Describe the bug
Unable to add new officers in a fresh install of snaily-cad.

Error in logs:

[unhandledRejection][13:32:23]: Error: ER_NO_DEFAULT_FOR_FIELD: Field 'started_at' doesn't have a default value

To Reproduce
Steps to reproduce the behavior:

  1. Go to Admin panel
  2. Click on Departments
  3. Add a new department
  4. Go to Police dept panel
  5. Click on My officers
  6. Click on Create An Officer button
  7. Fill in callsign, name and choose department from dropdown menu
  8. Click Create Officer button

Expected behavior
An officer would be created. No errors in the logs.

Screenshots
image

Desktop (please complete the following information):

  • Browser [e.g. chrome, safari] - Firefox Windows
  • Version [e.g. 22] - 86.0.1

Additional context
Add any other context about the problem here.

[Bug] When running npm start

Describe the bug
When installing and following the final step, 'npm start' in the snaily-cadv3 folder, it shows the following message:

ubuntu@ip-172-31-44-243:~/snaily-cadv3$ npm start

[email protected] start /home/ubuntu/snaily-cadv3
concurrently "npm run start:server" "npm run start:client"

sh: 1: concurrently: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] start: concurrently "npm run start:server" "npm run start:client"
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2020-11-02T17_46_31_519Z-debug.log

Screenshots
If applicable, add screenshots to help explain your problem.

[FEATURE REQUEST]: Sorting list values

Add sorting of list values: vehicle names, weapon names, types, etc.

Many lists are sorted by the id field from the database table.

I would like to be able to choose the sorting type for the list: alphabetically (a - z or z -a) or your own sort order (specifying sortindex, for example, for penalcode)

Wrong sorting:
ct0SBv6 1

Correct sorting:
63Qwt96 1

Turning on secureCookies or setting customHostUrl results in auto redirect back to login after login

What version of Node.js are you using?

16.6.1

What version of npm are you using?

7.20.3

What operating system are you using?

Ubuntu

Describe the Bug

If I edit src/config.ts and set secureCookies: false to secureCookies: true it causes the cad to auto redirect back to the login even if you enter the right credentials and the same goes for if you try and set customHostUrl: "domain.com"

I have tried multiple times to get it to work and still have had no such luck
I am however using a subdomain

Expected Behavior

to be able to login to the cad.

To Reproduce

go into config.ts and set secureCookies: false to secureCookies: true and then add
customHostUrl: "subdomain.domain.com" at the end of databasePort: 3306;

Installation issue

Describe the bugError Given after following all steps

C:\Users\matt9\snaily-cadv3\client>npm start

[email protected] start
react-scripts start

C:\Users\matt9\snaily-cadv3\client\node_modules\react-scripts\scripts\utils\verifyTypeScriptSetup.js:239
appTsConfig.compilerOptions[option] = value;
^

TypeError: Cannot assign to read only property 'jsx' of object '#'
at verifyTypeScriptSetup (C:\Users\matt9\snaily-cadv3\client\node_modules\react-scripts\scripts\utils\verifyTypeScriptSetup.js:239:43)
at Object. (C:\Users\matt9\snaily-cadv3\client\node_modules\react-scripts\scripts\start.js:31:1)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47
npm ERR! code 1
npm ERR! path C:\Users\matt9\snaily-cadv3\client
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c react-scripts start

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\matt9\AppData\Local\npm-cache_logs\2020-12-09T23_47_07_358Z-debug.log

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

San Andreas Fire Marshall

For fire Marshall’s in Exia RP. When going 10-08. They should be able to create a officer and select the department as “San Andreas Fire Marshall”

[Bug] Registration not working

Describe the bug
When trying to register for the first time, it does not work correctly. It just sits on the register page and does not process.

Expected behavior
To register the first admin account.

Desktop (please complete the following information):

  • Browser: tried Chrome, Opera, Firefox and IE

Docker Fails to Start snailycad-web

What version of Node.js are you using?

14.18.1

What version of npm are you using?

6.14.15

What operating system are you using?

Debain 11

Describe the Bug

Docker version: 20.10.5+dfsg1, build 55c4c88
Docker-Compose version: 1.29.2, build 5becea4c

Running the docker-compose command provided in the Wiki after editing my .env file to my needs results in this:

image

image

This repeats until I Ctrl+C, where it successfully shuts down.

Expected Behavior

No errors and the Docker container starts up.

To Reproduce

git clone https://github.com/Dev-CasperTheGhost/snaily-cadv3
cd snaily-cadv3
nano .env
(edit .env file)
sudo docker-compose --env-file .env up

[FEATURE REQUEST]: Confirmation for deleting items

In the case when we delete elements, CAD does not ask for confirmation of the action. This means that something can be deleted by mistake.

I would like to see a confirmation mechanism for deleting in the form of a simple modal window with "yes" and "no" buttons

Installation issue

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
I cannot get the cad setup correctly I tried what I did with v2 and it wasn't working. CAN YOU ADD ME ON DISCORD
arcadejackpotmaster#9999
Thanks
Austin
what do i do

Error Code 500 But Still Works

What version of Node.js are you using?

v10.19.0

What version of npm are you using?

6.14.4

What operating system are you using?

Ubuntu

Describe the Bug

Whenever changing someones employment rank on a company or approving someone to a company it shows an error code 500 in the top right even tho the action was actually performed it just doesnt say/show it was until you refresh the page

Expected Behavior

I accept to click accept and then them be removed from pending and put under employees

To Reproduce

To reproduce this issue you can try and join a whitelisted company as a different civ then as the owner try to accept them

[FEATURE REQUEST]: The ability to view a large photo of a citizen

Page: /citizen/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx

When clicking on the citizen's photo, show the enlarged photo.

On my RP server, an advanced character editor is used and there may be important details on the face that are convenient to see in a large photo: burns, scars, moles

Untitled

Job Claims.

Could you add the ability for tow and taxi users to claim a call so others know not to respond to it?
right to the left of "end call" add a button to "claim call"
pretty please with a cherry on top?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.