Commit Graph

24 Commits

Author SHA1 Message Date
Aurora Lahtela 5a2bdaf6ba
2360/plugin versions (#3249)
* Add methods to gather plugin versions from servers
* Gathering and storage for plugin version history
* Test plugin gathering
* Test plugin metadata storage
* /v1/pluginHistory endpoint
* Plugin history tab
* Plugin history to performance tab
* Possibly fix ConfigChange.MovedValue being applied all the time
* Updated locale files
* Export pluginHistory for server page
* Add plugin history to network page
* Access control and improvements
* Remove pluginHistory from export since it now requires auth
* Fix access visibility tests
* Fix VelocitySensor during test

Affects issues:
- Close #2360
2023-10-07 08:39:00 +03:00
Aurora Lahtela 621e0b6f6e Add Network Calendar to Network Overview
Does the same as Server Calendar but for the whole network.

Affects issues:
- Close #3111
2023-09-30 17:10:18 +03:00
Aurora Lahtela 01d904c7d1
2905/remove old web files (#3225)
* Removed Plugin.Use_Legacy_Frontend feature flag
* Remove version modal html generation in Java
* Remove contributor list html generation in Java
* Remove more html generation in Java
* Delete old web file bundle
* Removed locale html/js translation from backend
* Move Html#swapColorsToSpan to the React side
* Reimplement datatables and backend for preferences
* Load preferences from backend
* Usability fixes to the players table
* Delete WebAssetVersionCheckTask
* Add new locale to locale files
* Export defaultPreferences as json on react export

Affects issues:
- Close #2905
2023-09-23 22:24:34 +03:00
Aurora Lahtela 5061439d14
1623/access control (#3173)
* Add web authorization permission based on groups
  * Access and parts of website are limited by permissions
* Add group management in /manage page
  * Higher level permissions grant lower level permissions similar to Sponge
* Add command /plan setgroup, which uses plan.setgroup.other permission
* Add command /plan groups, which uses plan.setgroup.other permission
* Add more navigation based on permissions
* API modifications
  * User#hasPermission now returns true if user has parent permission in the tree
  * ResolverService#registerPermissions and ResolverService#registerPermission methods for adding new permissions
* Update locale with new lines
* Various unrelated fixes to CSS and code

Affects issues:
- Close #1623
2023-08-20 11:56:13 +03:00
Aurora Lahtela c20a746bd6
Add player retention analysis graph (#2917)
Adds a graph to network and server pages that has options to:
- Draw graphs at different time resolutions
- Limit input data by time
- Group players by register date or join address
- Visualize retention in different ways
  - Time since registration date
  - Playtime
  - Date
  - Cumulative player gain
  - Percentage / Player count / Stacked player count

Any and all combinations are allowed which allows extensive analysis of player retention. Help sections attempt to make the data understandable and show examples.

Affects issues:
- Close #2159
2023-03-17 18:25:38 +02:00
Aurora Lahtela e9496e924f Fix page breaking after login
Navigation button broke the page due to requiring network metadata,
which was fetched when login page was loaded. Unfortunately
the endpoint required permissions so nothing was actually loaded.

- Load metadata after login
- Remove auth requirement from networkMetadata and serverIdentity endpoints
2023-03-04 10:10:20 +02:00
Aurora Lahtela b92e886a39
React PageExtension Javascript APIs (#2894)
* Page extension api javascript file
* Add support for extending rows with pageExtensionApi
Tested it
* Support javascript snippets in react index.html
* Add context to pageExtensionApi calls
* Fix redirect text overlapping with sidebar
* Add new API for registering custom javascript and css
2023-02-25 13:57:12 +02:00
Aurora Lahtela 022a690446 Implemented parameterized array Sql generation
This bit of code allows passing lists of data in parameterized queries,
which is useful for defining WHERE x IN (?,?,?,?) in a dynamic way.

- Adds AccessControlTest cases for a valid /v1/query call
2022-11-23 17:31:04 +02:00
Aurora Lahtela cb21c45ea9 Visualize join address / day in React server page
Join addresses were missing

- Implemented new group visualizer that allows viewing group data as column/bar/pie/table
- Implemented latest join address pie on server page (was missing)
- Implemented join addresses per day graph on new Join addresses tab
- Made playerbase overview use the group visualizer

Affects issues:
- Close #2362
2022-09-05 16:56:59 +03:00
Aurora Lahtela 3eff46523d Test and fix user move and combination transactions 2022-08-27 15:20:23 +03:00
Aurora Lahtela 8f239b010c
Add Swagger & Swagger UI (#2470)
* Adds swagger dependencies and annotations for json endpoints for documentation
* Add swagger ui to react project
* Access control to swagger endpoints
* Include swagger.json in jars using custom configuration

Also:
* Reworked project shadow configurations to avoid shadowing shadow versions of modules

Why: Extra dependencies were being included when using shadow scope

What:
- modules no longer depend on shadow configurations,
  which speeds up IDEA indexing after build considerably
  (No need to index *-all.jars)
- 'shadow' scope is now used for artifacts that need to be included
- 'shadow' scope is also 'api' so that modules that depend on common
  can import the libraries. This may cause issues in projects
  depending on Plan so this may need to be reconsidered
- Relocations and exclusions were moved to plugin module
  org.slf4j is now included in 2 locations which may cause issues.
  Needs testing with servers
- Found out that all Extension dependencies include junit as compile
  scope which caused it to be included.

Affects issues:
- Close #1890
2022-07-13 21:21:20 +03:00
Aurora Lahtela 2aa189798d
Jetty support (#2132)
- Refactored Webserver request handling code to be easier to read
- Adds support for larger range of cipher suites and protocols for HTTPS
- Adds support for HTTP/2 and ALPN and as result more concurrent users than before
- APIs are fully compatible with previous code

Thanks to Kopo for assistance

Affects issues:
- Close #1987
2022-06-19 18:38:40 +03:00
Aurora Lahtela 09e71cd7ba Wrote some tests for LangCodes and fixed some issues in LocaleJSONResolver
- Removed unnecessary regex that was marked as bug by sonar
2022-06-05 10:49:20 +03:00
Aurora Lahtela 604bfd9e67 Add Plan version to /plan servers
Affects issues:
- Resolve #2245
2022-04-07 18:24:40 +03:00
Aurora Lahtela 3822155b40
Frontend BETA: Rewrite Player page with React (#2312)
* Add extension data to /v1/player endpoint
* Use node gradle plugin for building with yarn
* Add /v1/whoami endpoint
* Add back button to sidebar
* Selenium Tests for locale related js errors
* Convert locale system to use YAML-based storage
* Added a conversion process that runs on startup
* Replace cravatar.eu with crafatar.com for skins (more reliable)
* Add the Header made by Kopo to React

Co-authored-by: Antti Koponen <koponen942@outlook.com>

Affected issues:
- Resolve #1733
- Fixed #1092
- Resolve #1895
- Resolve #1965
- Partial #2260 
- Partial #2099
2022-04-06 17:37:23 +03:00
Aurora Lahtela 206c4e7d96 Add display names to some tests 2022-02-28 19:31:17 +02:00
Risto Lahtela 2071a49091 Fix locale interference with network performance page 2022-02-10 17:57:40 +02:00
Antti Koponen 2293760e7f
Add user & version JSON endpoints (#2131) 2021-10-18 19:25:25 +03:00
Risto Lahtela 13823c044a
Network performance tab (#2009)
* Fixed disk medium threshold not showing color
* Added 'serverName' and 'serverUUID' to optimizedPerformance endpoint
* Added /v1/network/listServers endpoint
* Added /v1/network/performanceOverview?servers endpoint
* Hide negative values from performance graphs
* Allow json cache bypass by not providing timestamp parameter in URIQuery
* Ignore negative values in low tps spike count
* Added (Unavailable with Export) to exported network html performance tab title

Affects issues:
- Close #1693
2021-07-17 12:19:33 +03:00
Risto Lahtela c523e40b7f Refactored the request body PR stuff
- Made sure to not break compatibility with discord bots that use the old
  authentication via query parameters
- Query parameters now accept no-value keys
- Added access control checks for the errors endpoints
2021-07-10 09:11:39 +03:00
Emilia Dreamer 7a51ad9f15
Use POST method in requests such as login (#1988)
- Adds Request#getRequestBody method to the API
- Moves login and register parameters to request body

Co-authored-by: Risto Lahtela <24460436+AuroraLS3@users.noreply.github.com>
Co-authored-by: Henri S <vankka.main@gmail.com>
2021-07-09 20:31:04 +03:00
Antti Koponen f83cbad2b9
Update to Bootstrap 5 by Kopo (#1832)
* Initial update to Bootstrap v5.0.0-beta3
* Add Bootstrap CSS to webpages & export lists
* Begin porting SB Admin 2's changes to a separate file

Due to Bootstrap 5 introducing calculated paddings and margins (gutters) to multiple parts of the grid system (containers, rows, columns etc.), all SBA2 changes involving grid classes and paddings/margins will be left out for now. If custom margins/paddings are needed, BS5 utility classes can be used.

* Bootstrap v5.0.0-alpha1: First changes

- Removed x-ua-compatible header
- Fixed .bg-gradient overlap
- .form-group replaced with margin utilities
- .input-group-append removed
- Changed small.form-text.text-muted to div.form-text
- Minor CSS changes

* v5.0.0-alpha1: Components

- Fixed badges to use bg-* for color

* v5.0.0-alpha2: Components & misc. fixes

- Modal close buttons use .btn-close instead of .close and use a background image instead of a &times icon
- Added .btn-close-white for dark mode close buttons

* v5.0.0-alpha3: Buttons & text utilities

- .btn-block replaced with .w-100 for individual "block buttons"
- .font-weight-* renamed to .fw-*

* v5.0.0-beta1: Change .float-right to .float-end

* v5.0.0-beta1: Change .ml-* and .mr-* to .ms-* and .me-*

* v5.0.0-beta1: Namespace all HTML data attributes to data-bs-*

* v5.0.0-beta1: Namespace data-dismiss to data-bs-dismiss

* Refactor query page to pad & wrap things correctly

- Changed & corrected classes per Bootstrap 5's changes (.input-row isn't used anywhere)
- Significantly increases support for devices with smaller screens, input elements are now correctly padded & wrapped with breakpoints

* Bump Bootstrap from 5.0.0-beta3 to 5.0.0-dist

* Replace .card-columns with Masonry grid

* Update Datatables to BS5 styling

* Remove scrollbar & unnecessary HTML elements from data tables

* Bump DataTables from 1.10.24 to 1.10.25

Bump DataTables-Responsive from 2.2.7 to 2.2.9

* Move Bootstrap to CDN-based distribution

Update Bootstrap to 5.0.1-dist

* Change jQuery CDN to jsDelivr

* Center query page date selector

* Apply final BS5 changes

* Apply dark theme to table when rendering query results

Affects issues:
- Fixes 1947
2021-06-20 08:46:12 +03:00
Risto Lahtela d1e00da51a Started using player UUID instead of name in URLs
- Changed instances where player name was given in a link instead of UUID where possible
  - Could not change for Extensions where "isPlayerName=true" is set for String data, the UUID is
    not available from the query

- Changed 404 error message to have '/player/{uuid/name}' instead of '/player/PlayerName'
- Changed export directory from names to uuids, change log should recommend export users to clear
  their player directory and to run /plan export players
- Fixed issue where Web users with level 2 could not access their own player page via /player/{uuid}

Affects issues:
- Close #1841
2021-04-15 10:13:32 +03:00
Risto Lahtela 03782f18d5 Wrote an access control test for bypass checks
One bypass was discovered for detecting who has played on a server, where
403 is given for level 2 when user has played and 400 when they have not.
This was fixed.

One 500 error was discovered when the network has no proxy server, /v1/network/servers
ran into NullPointerException in a query.
2021-03-22 07:13:27 +02:00