diff --git a/app/components/monitor/updateInfo.jsx b/app/components/monitor/updateInfo.jsx index 2953a39..15ca7b9 100644 --- a/app/components/monitor/updateInfo.jsx +++ b/app/components/monitor/updateInfo.jsx @@ -1,8 +1,7 @@ import './uptime.scss'; // import dependencies -import 'moment-timezone'; -import moment from 'moment'; +import dayjs from 'dayjs'; import classNames from 'classnames'; // import local files @@ -21,9 +20,11 @@ const UptimeInfo = ({ heartbeat = {} }) => {
{heartbeat?.isDown ? 'DOWN' : 'UP'}
- {moment(heartbeat.date) - .tz(timezone) - .format(`${dateformat} ${timeformat}`)} + {dayjs( + new Date(heartbeat.date).toLocaleString('en-US', { + timeZone: timezone, + }) + ).format(`${dateformat} ${timeformat}`)}
{heartbeat.message || 'Unknown'} diff --git a/app/components/monitor/uptime.jsx b/app/components/monitor/uptime.jsx index 44ea044..d632869 100644 --- a/app/components/monitor/uptime.jsx +++ b/app/components/monitor/uptime.jsx @@ -1,7 +1,6 @@ import './uptime.scss'; // import dependencies -import 'moment-timezone'; import PropTypes from 'prop-types'; // import local files diff --git a/app/components/settings/manage/member/row.jsx b/app/components/settings/manage/member/row.jsx index 1aae89f..fe344a0 100644 --- a/app/components/settings/manage/member/row.jsx +++ b/app/components/settings/manage/member/row.jsx @@ -1,7 +1,7 @@ import './row.scss'; // import dependencies -import moment from 'moment'; +import dayjs from 'dayjs'; import { observer } from 'mobx-react-lite'; // import local files @@ -36,8 +36,8 @@ const MemberTableRow = ({ member = {} }) => { ? 'Unverified' : positions[member.permission]; - const date = moment(member.createdAt).format('MMM DD, YYYY'); - const time = moment(member.createdAt).format('hh:mm A'); + const date = dayjs(member.createdAt).format('MMM DD, YYYY'); + const time = dayjs(member.createdAt).format('hh:mm A'); const avatarUrl = isImageUrl(member.avatar) ? member.avatar diff --git a/docs/internals/changelog.md b/docs/internals/changelog.md index f302e8f..afac1a3 100644 --- a/docs/internals/changelog.md +++ b/docs/internals/changelog.md @@ -1,5 +1,18 @@ # Previous updates +## v0.5.3 + +### Moving away from moment and compressing images + +### Summary + +Realised that moment wasn't the best library for date/time manipulation and that it was bloating the bundle size. I've decided to move away from moment and use dayjs instead. Along with that I've also compressed and resized all the default avatars. Each avatar was taking up around 1.5MB, they are now taking all nearly under 100KB. Along with that I've also changed the size from 1024x1024 to 512x512. Planning on compressing/resizing further possibly in the future. + +### Updates + +- Moved from moment to dayjs +- Compressed images + ## v0.5.2 ### Moves to router and finally adds error page diff --git a/package-lock.json b/package-lock.json index b7c257d..17ba68c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lunalytics", - "version": "0.5.1", + "version": "0.5.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lunalytics", - "version": "0.5.1", + "version": "0.5.3", "license": "SEE LICENSE IN LICENSE", "dependencies": { "axios": "^1.6.2", @@ -25,8 +25,6 @@ "knex": "^3.0.1", "mobx": "^6.12.0", "mobx-react-lite": "^4.0.5", - "moment": "^2.30.1", - "moment-timezone": "^0.5.44", "prop-types": "^15.8.1", "react": "^18.2.0", "react-chartjs-2": "^5.2.0", @@ -5061,20 +5059,6 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "license": "ISC" }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -7565,27 +7549,6 @@ } } }, - "node_modules/moment": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", - "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", - "license": "MIT", - "engines": { - "node": "*" - } - }, - "node_modules/moment-timezone": { - "version": "0.5.45", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.45.tgz", - "integrity": "sha512-HIWmqA86KcmCAhnMAN0wuDOARV/525R2+lOLotuGFzn4HO+FH+/645z2wx0Dt3iDv6/p61SIvKnDstISainhLQ==", - "license": "MIT", - "dependencies": { - "moment": "^2.29.4" - }, - "engines": { - "node": "*" - } - }, "node_modules/mrmime": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", diff --git a/package.json b/package.json index 091d098..d96aeb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lunalytics", - "version": "0.5.2", + "version": "0.5.3", "description": "Open source Node.js server/website monitoring tool", "private": true, "author": "KSJaay ", @@ -50,8 +50,6 @@ "knex": "^3.0.1", "mobx": "^6.12.0", "mobx-react-lite": "^4.0.5", - "moment": "^2.30.1", - "moment-timezone": "^0.5.44", "prop-types": "^15.8.1", "react": "^18.2.0", "react-chartjs-2": "^5.2.0", diff --git a/public/icons/Ape.png b/public/icons/Ape.png index 66b4ca4..ef9d934 100644 Binary files a/public/icons/Ape.png and b/public/icons/Ape.png differ diff --git a/public/icons/Bear.png b/public/icons/Bear.png index c67f6f7..f52bc7a 100644 Binary files a/public/icons/Bear.png and b/public/icons/Bear.png differ diff --git a/public/icons/Cat.png b/public/icons/Cat.png index 5f2d10a..ff1e4de 100644 Binary files a/public/icons/Cat.png and b/public/icons/Cat.png differ diff --git a/public/icons/Dog.png b/public/icons/Dog.png index 2146260..b4bffbf 100644 Binary files a/public/icons/Dog.png and b/public/icons/Dog.png differ diff --git a/public/icons/Duck.png b/public/icons/Duck.png index 7e9ae97..54817ee 100644 Binary files a/public/icons/Duck.png and b/public/icons/Duck.png differ diff --git a/public/icons/Eagle.png b/public/icons/Eagle.png index 9c68918..a979d84 100644 Binary files a/public/icons/Eagle.png and b/public/icons/Eagle.png differ diff --git a/public/icons/Fox.png b/public/icons/Fox.png index 78d04b9..366293f 100644 Binary files a/public/icons/Fox.png and b/public/icons/Fox.png differ diff --git a/public/icons/Gerbil.png b/public/icons/Gerbil.png index 568d9e7..21c1089 100644 Binary files a/public/icons/Gerbil.png and b/public/icons/Gerbil.png differ diff --git a/public/icons/Hamster.png b/public/icons/Hamster.png index 016331e..13a20ef 100644 Binary files a/public/icons/Hamster.png and b/public/icons/Hamster.png differ diff --git a/public/icons/Hedgehog.png b/public/icons/Hedgehog.png index 6ef0d6c..b4e8753 100644 Binary files a/public/icons/Hedgehog.png and b/public/icons/Hedgehog.png differ diff --git a/public/icons/Koala.png b/public/icons/Koala.png index 86d6f70..6dbb566 100644 Binary files a/public/icons/Koala.png and b/public/icons/Koala.png differ diff --git a/public/icons/Ostrich.png b/public/icons/Ostrich.png index 073c487..c481275 100644 Binary files a/public/icons/Ostrich.png and b/public/icons/Ostrich.png differ diff --git a/public/icons/Panda.png b/public/icons/Panda.png index 37832f9..7eee211 100644 Binary files a/public/icons/Panda.png and b/public/icons/Panda.png differ diff --git a/public/icons/Rabbit.png b/public/icons/Rabbit.png index 042f9d3..e378fe9 100644 Binary files a/public/icons/Rabbit.png and b/public/icons/Rabbit.png differ diff --git a/public/icons/Rocket.png b/public/icons/Rocket.png index e363687..02370eb 100644 Binary files a/public/icons/Rocket.png and b/public/icons/Rocket.png differ diff --git a/public/icons/Smart-Dog.png b/public/icons/Smart-Dog.png index 0480d98..f52c8b0 100644 Binary files a/public/icons/Smart-Dog.png and b/public/icons/Smart-Dog.png differ diff --git a/public/icons/Tiger.png b/public/icons/Tiger.png index fe687a8..19e50f4 100644 Binary files a/public/icons/Tiger.png and b/public/icons/Tiger.png differ diff --git a/public/vite.svg b/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file