Commit Graph

170 Commits

Author SHA1 Message Date
Nick Krecklow
4d13965e6b
Backend cleanup (#146)
* Add ServerRegistration, begin refactoring to match frontend

* move graphData logic into ServerRegistration

* move ping updates/history into ServerRegistration

* start updating main app entry methods

* fix default rates.updateMojangStatus

* fix record loading delays on freshly booted instances

* move database loading logic to method + callback

* use data in frontend for type lookup instead of ping

* cleanup app.js

* reorganize methods to improve flow

* avoid useless mojang updates, remove legacy fields

* rename legacy fields for consistency

* finish restructure around App model

* ensure versions are sorted by release order

* filter errors sent to frontend to avoid data leaks

* fix version listing behavior on frontend

* 5.1.0
2020-04-21 17:59:53 -05:00
Nick Krecklow
9eda8d6bdb
sync footer css with prod 2020-04-21 04:32:31 -05:00
Nick Krecklow
29dc264d6a
tweak footer style and center align 2020-04-19 20:45:29 -05:00
Nick Krecklow
61295d0600
Safely handle legacy recordData that may not include the timestamp payload 2020-04-19 20:04:13 -05:00
Nick Krecklow
203d8df844
fix control buttons color matching background 2020-04-19 19:54:57 -05:00
Nick Krecklow
747fdbda8e
tweak header, footer link colors 2020-04-19 19:44:23 -05:00
Nick Krecklow
43ae91c904
fix inverted footer a:hover color 2020-04-19 19:44:17 -05:00
Nick Krecklow
312fbfcbf0
fix hidden color on graph load button 2020-04-19 19:44:12 -05:00
Nick Krecklow
f875361bc7
Minetrack 5 (#143)
* remove unused #getServer methods, inline #roundToPoint

* replace #safeName regex with incremental ids

* remove legacy #setInterval based #updateMojangServices handling

* add Tooltip class, move faviconSize to css instead of js

* move server id assignment to ServerRegistry

* move printPort logic to formatMinecraftServerAddress, add MINECRAFT_DEFAULT_PORTS

* simplify ping tracking

* rework perc-bar tooltip to not use mousemove event

* begin moving graphing logic to GraphDisplayManager

* begin merge graph point tracking into graphDisplayManager

* centralizing graphing logic into GraphDisplayManager

* properly reset GraphDisplayManager when handling disconnects

* move individual server graph data into ServerGraph class

* constantly run sortServers loop to simplify logic

* inline #updateMojangServices method

* resize performance improvements

* remove legacy bootTime refresh behavior, require manual user refresh

* move class defs to core.js

* remove unused #isGraphDataVisible arg

* remove #toggleControlsDrawer

* dont call #updatePercentageBar in #updateServerStatus calls

* centralize caption handling

* inline #msToTime

* remove hackish seconds handling for timestamps

* reduce #forEach calls with filter/map

* safely fallback to errorMessage if errno/description does not match

* Add /images/missing_favicon.png path instead of putting base64 in js

* remove debug

* cleanup mojang status handling

* move historyPlot instance into GraphDisplayManager

* cleanup checkbox html generation

* cleanup #updateServerStatus

* fix up tooltip styling

* move jquery code out of core.js

* fix add server race condition when initially pinging servers

* send error.placeholder=true for pending pings so the frontend can discard later

* filter placeholder pings sent by the backend

* del assets/images/logo_2014.png

* move graph code into graph.js

* merge pingTracker into ServerRegistry+ServerGraph

* remove todos

* simplify getVisibleGraphData

* fix potential sortServers race condition when adding

* use #show instead of #fadeIn(0)

* remove publicConfig.json, send over socket

* update docs/CHANGELOG.md

* getOrAssign -> getOrCreateId

* dont delete graph controls when disconnected

* early work cleaning up HTML+CSS structures

* cleanup server css elements

* cleanup graph control css elements

* move base CSS color values into @media(prefers-color-scheme: light)

* move CSS magic colors to vars

* reduce duplicated CSS color rules

* inline body text color CSS

* WIP replacing jQuery calls with vanilla JS

* WIP replacing jQuery calls with vanilla JS

* replace getElementsByClass with querySelectorAll

* typeMarker -> serverTypeHTML

* use jQuery slim for remaining flot.js dependency

* merge setAllGraphVisibility into GraphDisplayManager

* break apart element update and redraw logic

* add eslint + parcel bundler

* auto lint assets/js when building

* statically serve favicons/ for faviconOverrides outside of dist/

* only send favicons when changed

* move faviconOverride behavior into entry in servers.json

* add warning to backend server files

* remove .server-favicon-missing class

* add Minetrack 5 migration guide

* add npm run build step to install.sh

* adjust package.json version to 5.0.0

* remove js references from index.html

* move logic and behavior out of site.js

* cleanup ServerRegistry methods

* prevent multiple history graph redraws

* add comments

* cleanup #addServer usage, move to App

* move graph control bindings into GraphDisplayManager

* site.js -> main.js, core.js -> servers.js

* move Tooltip/Caption into util.js

* spacing tweak

* format index.html

* ensure the frontend does not handling updateHistoryGraph events

* prevent versions/record updates if the same value

* avoid empty percbar updates, ensure versions are sorted

* only include main.js ref in index.html

* serve minified copy of font awesome directly

* bundle icons.css into main.css, remove Open Sans 400

* add new SVG logo

* update docs/CHANGELOG.md

* new design, server version grouping

* remove start.sh call from install.sh

* move graph controls into header with new button

* move #handleSettingsToggle back to graph

* fix legacy code behavior of currentVersionIndex applying globally

* fix header text color in light mode

* fix mojang status text color in light mode

* fix toggle settings and checkbox colors

* tweak button hover color

* tweak button hover color

* add new status-overlay to avoid complicated DOM management during loading

* fix initial graph rendering bug

* add comments

* update default graph tick sizes

* prevent #tooltip from overflowing page

* remove localhost spec

* prevent minor connection errors from reshuffling layout

* update CHANGELOG.md

* add message/button for manually loading historical graph on mobile devices

* send isGraphVisible to frontend to prevent alert if logToDatabase: false

* send timestamp data with record

* update docs/CHANGELOG.md

* remove clock icon

* remove 24h peak timestamp

* Only check favicon if present

* safely handle undefined/empty knownVersions in #formatMinecraftVersions

* merge config.versions and minecraft.json into minecraft_versions.json, simplify index matching behavior

* remove localhost url in socket.io config

* stub methods/linkage for FocusManager

* add #isObjectEqual hack, add event proxying to FocusManager

* wip extended stats box

* remove server-type badging

* tweak mojang unstable color

* serve socket.io-client using parcel

* fix incorrect mojang status colors

* remove legacy capitalization design

* redesign focus boxes

* update docs/CHANGELOG.md

* remove localhost ref

* color clock icon

* use background-color for hover effect, remove unused var

* improve stats focus box icons

* change mojang sessions icon to globe

* Add favorites system

* remove focus boxes

* update docs/CHANGELOG.md

* remove focus icons from font

* simplify graph related event binding

* Add Sort By button

* store current sortOption in localStorage

* update docs/CHANGELOG.md

* move magic 0 sortOption to SORT_OPTION_INDEX_DEFAULT

* remove localhost ref

* merge #settings-toggle, #sort-by and .mojang-status CSS

* remove .focus-box CSS

* use sortedServerIds for _lastSortedServers

* tweak --color-blue

* new missing_favicon design to match logo

* edit footer CSS/text, remove github icon

* replace player count diff counter with GROWTH sort option

* italize non-default sort options

* add Only Favorites button to auto sync favorites to the visible graph data

* add icons to graph control buttons

* update docs/CHANGELOG.md

* use * to denote non-default sort option instead

* remove localhost url in socket.io config

* add value highlighting to make sort by easier to read

* remove last remaining uppercase text

* remove serverTypesVisible from config.json

* simplify header CSS, fix spacing with logToDatabase=false

* fix inverted text color on highlighted values

* remove localhost url in socket.io config

* break header into rows on mobile devices

Co-authored-by: Hugo Manrique <contact@hugmanrique.me>
2020-04-19 19:27:59 -05:00
Nick Krecklow
9f5827f06c
automatically set peak label using publicConfig.graphDuration 2020-04-01 22:36:44 -05:00
Nick Krecklow
874685d639
update frontend jquery dependency 2.1.4->3.4.1 2020-04-01 22:01:00 -05:00
Nick Krecklow
cf8f3f0dcd
update socket.io dependency 1.3.7->2.3.0, fixes security vulns 2020-04-01 21:44:35 -05:00
Nick Krecklow
65aabb179a
fix undefined AM/PM time marker 2020-03-31 23:40:03 -05:00
Nick Krecklow
f63d9bba4b
remove legacy category system 2020-03-30 01:06:30 -05:00
Nick Krecklow
f1fe9d02e4
fix early div closure 2020-03-30 00:43:49 -05:00
Nick Krecklow
d4353d8fe1
add 24hr peak 2020-03-30 00:37:49 -05:00
Nick Krecklow
7b8f91af68
add dark mode support 2020-03-30 00:17:20 -05:00
Nick Krecklow
8c4c84e8be
update footer text 2020-03-15 00:20:38 -05:00
Nick Krecklow
9e6e650e02
remove details from generic footer 2020-03-15 00:16:46 -05:00
Crypt
533568d97a
Remove Google Analytics tracker 2019-09-05 16:34:21 -05:00
Hugo Manrique
0392fce6c3 Fix XSS by parsing player counts as raw data and validating favicon URIs (#116)
* Fix XSS by parsing player counts as raw data (instead of parsing it)

* Ensure the returned favicon is a data URI

* Force server favicon size to 64px

* Increase specificity of data URI validation

The previous commit would happily accept any domain (or subdomain) that started with "data"
2019-09-05 16:15:44 -05:00
Cryptkeeper
5a1dc9d862
Shrink version indicators since there's so many now 2018-08-24 16:35:53 -05:00
Cryptkeeper
557c581726 Prevent empty version payloads from breaking frontend 2017-10-23 03:20:45 -05:00
Cryptkeeper
106033adb8 Help readability on individual server elements 2017-05-13 11:21:41 -05:00
Cryptkeeper
7bd33c081b Shrink record and versions listing using server-meta 2017-05-13 11:17:31 -05:00
Cryptkeeper
d2ba338cb6 Darken versions listing 2017-05-13 11:11:42 -05:00
Cryptkeeper
7a751c84b5 Add default status text 2017-05-13 11:08:56 -05:00
Cryptkeeper
be01d5c515 Show loading indicators when disconnected 2017-05-13 11:08:19 -05:00
Cryptkeeper
bfcc896e28 Improved Mojang status indicators and better footer 2017-05-13 11:07:50 -05:00
Hugo Manrique
0955e8dbcd Allow custom Graph colors (#76) 2017-04-03 22:10:46 -05:00
Cryptkeeper
42c744b9dd Use tooltip instead of slider text 2017-03-14 21:14:26 -05:00
Cryptkeeper
b4c716d701 Use #hideCaption instead of manual handling 2017-03-14 21:04:38 -05:00
Cryptkeeper
039d1364ea Dynamically resize the 24hr chart 2017-03-14 20:48:07 -05:00
Cryptkeeper!
ac0ea0d5d7 3.1.0 (#69) 2017-03-14 17:07:58 -05:00
Cryptkeeper!
f1dfe2e21b Add hover effect to percentage bar sections 2017-03-12 11:29:50 -05:00
Cryptkeeper
f9b689199d Simplify the footer 2017-03-11 18:57:35 -06:00
Cryptkeeper
f722f5295a Add new percentage bar feature 2017-03-11 18:52:07 -06:00
Cryptkeeper!
2c4f3e0865 3.0.0 2017-03-11 17:44:21 -06:00
Cryptkeeper
02eb405ad7 Recognize and version test 1.11 2016-12-14 17:42:55 -06:00
Chris
1595b3e904 Will print the port only if it is custom 2016-10-08 01:15:47 +01:00
Cryptkeeper
487285775f 2.2.2, clean up documentation 2016-07-05 14:11:09 -05:00
Cryptkeeper
c0a5958e85 Remove production config/assets 2016-07-05 12:49:39 -05:00
Nick
cf5b07a716 Spice up the header 2016-06-22 04:21:59 -05:00
Nick
549f70b14c Correctly left align the tagline 2016-06-22 04:16:54 -05:00
Nick
7e08eed875 Fix footer symbols 2016-06-22 04:15:05 -05:00
Nick
0eae1e352a Keep this left aligned 2016-06-22 04:14:23 -05:00
Nick
2d2455c50b Center align the header 2016-06-22 04:13:17 -05:00
Nick
e9d62b302d Update the footer layout 2016-06-22 04:12:59 -05:00
Nick
c3ca05e3b4 Center align the footer 2016-06-22 04:12:14 -05:00
Nick
0b859bc109 Remove old column structure 2016-06-22 04:10:42 -05:00
Nick
62ffb6b601 Tweak status alignment 2016-06-22 04:10:23 -05:00
Nick
37d428a953 Fix headers being visible when they shouldn't be 2016-06-21 17:29:11 -05:00
Nick
9287f071a4 Give credit for the compass icon 2016-06-20 23:10:28 -05:00
Nick
782ca68e4e Add files via upload 2016-06-21 00:09:42 -04:00
Cryptkeeper
348f437c8a Lighten background, keep Mojang status at top 2016-06-20 18:56:07 -05:00
Cryptkeeper
35e5d610aa Final page tweaks 2016-06-20 18:33:27 -05:00
Cryptkeeper
fd381fb28a Move header links into footer 2016-06-20 18:27:11 -05:00
Cryptkeeper
aecb45fe07 Remove category visibility controller 2016-06-20 18:14:06 -05:00
Cryptkeeper
d7e3ebc127 Make the header full-width 2016-06-20 18:10:26 -05:00
Cryptkeeper
41a6a25854 Test servers for 1.10 support 2016-06-08 21:36:35 -05:00
Nick Keeper
26939910dc Reset lastMojangServiceUpdate on disconnect 2016-04-26 15:15:39 -05:00
Cryptkeeper
ea5fa03d37 A few quick frontend tweaks 2016-03-06 01:27:47 -06:00
Devin Ryan
ec49a2c07e Unify formatting in main.css 2016-03-01 21:14:42 -06:00
Devin Ryan
43c284aa8a Show supported versions for PC servers
The Minetrack daemon will send a different protocol version each time
it pings a server. If a server responds with the same protocol version,
it is assumed that the version is supported, and it is shown on the
page above the server's player count.

The list of versions to be tried is stored in config.json.
At the moment, 4 versions are checked:
- 4 (Minecraft 1.7.2)
- 5 (Minecraft 1.7.10)
- 47 (Minecraft 1.8)
- 107 (Minecraft 1.9)
2016-03-01 21:09:38 -06:00
Cryptkeeper
3ed9b85db4 Show category options if there's more than 1 category 2016-02-23 19:21:13 -06:00
Cryptkeeper
9ac6502394 Allow the server to control category visibility 2016-02-23 19:19:15 -06:00
Cryptkeeper
28160054c0 Left align this 2016-02-23 18:52:30 -06:00
Cryptkeeper
6204a536c4 New header, controls for category visibility 2016-02-23 18:47:27 -06:00
Cryptkeeper
2fa3f08ae8 Replace the old compass favicon with a custom one
So we aren’t using someone’s art
2016-02-23 16:40:27 -06:00
Cryptkeeper
798dda8f12 Fix frontend not updating publicConfig.json
This changes the handshake sequence to use “bootTime” (a unique key
based off the time) to make sure the frontend configuration matches the
current one. If not, the client pulls the update and validates before
requesting the listing.
2016-02-06 18:26:29 -06:00
Cryptkeeper
143e99876a Ability to categorize networks 2016-02-06 17:34:33 -06:00
Cryptkeeper
4af3d8a85f Avoid race conditions 2016-02-01 05:32:00 -06:00
Cryptkeeper
808418f6bd Correctly init these 2016-02-01 05:31:00 -06:00
Cryptkeeper
ae018acba4 Load back the graph controls 2016-02-01 05:29:09 -06:00
Cryptkeeper
1e5b5efc48 Remove the data if needed 2016-02-01 05:23:42 -06:00
Cryptkeeper
01c427eea2 Fix hooking 2016-02-01 05:21:46 -06:00
Cryptkeeper
c4177abaaf Start work on saving graph controls 2016-02-01 05:20:25 -06:00
Cryptkeeper
266eff4668 Tweak the color hashing system 2016-02-01 05:05:14 -06:00
Cryptkeeper
6d8ab212e0 Fix incorrect IP references 2016-02-01 04:58:05 -06:00
Kailan Blanks
5ae01cf41d Update copyright to 2016 2016-01-22 19:12:09 +00:00
Cryptkeeper
53c3c5e556 Don't apply min: 0 to the small graphs 2016-01-06 15:42:50 -06:00
Cryptkeeper
096c919dd0 Disallow networks from graphing < 0 players 2016-01-06 13:15:34 -06:00
Cryptkeeper
047f9306bb Drop Lifeboat, add Cosmic PVP 2015-12-27 20:00:18 -06:00
Cryptkeeper
123967cac4 Vertically shrink "the graph" 2015-12-23 14:25:05 -06:00
Cryptkeeper
2cfe39b6f9 Add a footer. 2015-12-18 21:53:13 -06:00
Cryptkeeper
d1197bf159 Fat, away! 2015-12-18 21:39:08 -06:00
Cryptkeeper
454627b2a9 Numerous graph fixes 2015-12-18 21:23:24 -06:00
Cryptkeeper
438a060823 Fix visibility 2015-12-18 19:05:43 -06:00
Cryptkeeper
88173ead11 Don't show graph on mobile browsers 2015-12-18 19:00:57 -06:00
Cryptkeeper
a426a6afa2 Fancy controls 2015-12-18 18:49:18 -06:00
Cryptkeeper
8e999cee1b Toggle buttons 2015-12-18 18:33:43 -06:00
Cryptkeeper
5a9be282f7 Work on frontend, fix removal of useless data 2015-12-18 18:25:59 -06:00
Cryptkeeper
649d8abd33 Fix race condition, add graph toggles 2015-12-18 18:10:58 -06:00
Cryptkeeper
c87a377621 Destroy the graph on disconnect 2015-12-18 02:47:35 -06:00
Cryptkeeper
a0524ce41b Ignore data for networks that don't exist in config.json 2015-12-18 02:43:44 -06:00
Cryptkeeper
7e4d3c1f58 Merge branch 'master' into big-graph 2015-12-18 01:53:17 -06:00
Cryptkeeper
8f66475a28 Big graph, away! 2015-12-18 01:45:38 -06:00
LegitModern
bbf726dcf6 Space 2015-12-14 18:17:34 -05:00
Cryptkeeper
9ad7f261e1 Fix rounded corners on icons 2015-12-04 16:26:07 -06:00
Cryptkeeper
97d6368c16 Add mobcrush favicon. 2015-12-04 15:57:50 -06:00