Skip to content

Commit ebf6a64

Browse files
authored
Merge pull request #818 from gotify/upgrade-ui
Upgrade UI
2 parents a9ecbdc + d99b423 commit ebf6a64

65 files changed

Lines changed: 5628 additions & 14622 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ ifdef GOTOOLCHAIN
77
else
88
GO_VERSION=$(shell go mod edit -json | jq -r .Toolchain | sed -e 's/go//')
99
endif
10-
DOCKER_BUILD_IMAGE=gotify/build
10+
DOCKER_BUILD_IMAGE=docker.io/gotify/build
1111
DOCKER_WORKDIR=/proj
1212
DOCKER_RUN=docker run --rm -e LD_FLAGS="$$LD_FLAGS" -v "$$PWD/.:${DOCKER_WORKDIR}" -v "`go env GOPATH`/pkg/mod/.:/go/pkg/mod:ro" -w ${DOCKER_WORKDIR}
1313
DOCKER_GO_BUILD=go build -mod=readonly -a -installsuffix cgo -ldflags "$$LD_FLAGS"
1414
DOCKER_TEST_LEVEL ?= 0 # Optionally run a test during docker build
15-
NODE_OPTIONS=$(shell if node --help | grep -q -- "--openssl-legacy-provider"; then echo --openssl-legacy-provider; fi)
1615

1716
test: test-coverage test-js
1817
check: check-go check-swagger check-js
@@ -116,7 +115,7 @@ _build_within_docker:
116115
${DOCKER_GO_BUILD} -o ${OUTPUT}
117116

118117
build-js:
119-
(cd ui && NODE_OPTIONS="${NODE_OPTIONS}" yarn build)
118+
(cd ui && yarn build)
120119

121120
build-linux-amd64:
122121
${DOCKER_RUN} ${DOCKER_BUILD_IMAGE}:$(GO_VERSION)-linux-amd64 make _build_within_docker OUTPUT=${BUILD_DIR}/gotify-linux-amd64

ui/.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

ui/.eslintrc.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

ui/eslint.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import tseslint from 'typescript-eslint';
5+
6+
export default tseslint.config(eslint.configs.recommended, tseslint.configs.recommended);
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
66
<meta name="theme-color" content="#3f51b5">
7-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
7+
<link rel="manifest" href="manifest.json">
88
<title>Gotify</title>
99

1010
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="static/apple-touch-icon-57x57.png" />
@@ -35,8 +35,7 @@
3535
Gotify requires JavaScript.
3636
</noscript>
3737
<div id="root"></div>
38-
<% if (process.env.NODE_ENV === 'production') { %>
39-
<script>window.config = %CONFIG%;</script>
40-
<% } %>
38+
<script>window.config = %CONFIG%;</script>
39+
<script type="module" src="/src/index.tsx"></script>
4140
</body>
4241
</html>

ui/package.json

Lines changed: 44 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -5,72 +5,59 @@
55
"homepage": ".",
66
"proxy": "http://localhost:80",
77
"dependencies": {
8-
"@material-ui/core": "^4.11.4",
9-
"@material-ui/icons": "^4.9.1",
10-
"axios": "^0.21.1",
11-
"codemirror": "^5.61.1",
12-
"detect-browser": "^5.2.0",
13-
"js-base64": "^3.6.1",
14-
"mobx": "^5.15.6",
15-
"mobx-react": "^6.3.0",
16-
"mobx-utils": "^5.6.1",
8+
"@emotion/react": "^11.14.0",
9+
"@emotion/styled": "^11.14.1",
10+
"@mui/icons-material": "^7.2.0",
11+
"@mui/material": "^7.2.0",
12+
"@uiw/codemirror-theme-material": "^4.24.2",
13+
"@uiw/react-codemirror": "^4.24.2",
14+
"@vitejs/plugin-react": "^4.7.0",
15+
"axios": "^1.11.0",
16+
"detect-browser": "^5.3.0",
17+
"mobx": "^6.13.7",
18+
"mobx-react": "^9.2.0",
19+
"mobx-utils": "^6.1.1",
1720
"notifyjs": "^3.0.0",
18-
"prop-types": "^15.6.2",
19-
"react": "^16.4.2",
20-
"react-codemirror2": "^7.2.1",
21-
"react-dom": "^16.4.2",
22-
"react-infinite": "^0.13.0",
23-
"react-markdown": "^6.0.2",
24-
"react-router": "^5.2.0",
25-
"react-router-dom": "^5.2.0",
26-
"react-timeago": "^6.2.1",
27-
"remark-gfm": "^1.0.0",
28-
"remove-markdown": "^0.3.0",
29-
"typeface-roboto": "1.1.13"
21+
"notistack": "^3.0.2",
22+
"react": "^19.1.1",
23+
"react-dom": "^19.1.1",
24+
"react-markdown": "^10.1.0",
25+
"react-router": "^7.7.1",
26+
"react-router-dom": "^7.7.1",
27+
"react-timeago": "^8.3.0",
28+
"react-virtuoso": "^4.13.0",
29+
"remark-gfm": "^4.0.1",
30+
"remove-markdown": "^0.6.2",
31+
"tss-react": "^4.9.19",
32+
"typeface-roboto": "1.1.13",
33+
"vite": "^7.0.6",
34+
"vitest": "^3.2.4"
3035
},
3136
"scripts": {
32-
"start": "react-scripts start",
33-
"build": "react-scripts build",
34-
"test": "react-scripts test --env=node",
35-
"eject": "react-scripts eject",
37+
"start": "vite",
38+
"prebuild": "tsc",
39+
"build": "vite build",
40+
"test": "vitest --disable-console-intercept --no-file-parallelism",
3641
"lint": "eslint \"src/**/*.{ts,tsx}\"",
3742
"format": "prettier \"src/**/*.{ts,tsx}\" --write",
3843
"testformat": "prettier \"src/**/*.{ts,tsx}\" --list-different"
3944
},
4045
"devDependencies": {
41-
"@types/codemirror": "5.60.0",
42-
"@types/detect-browser": "^4.0.0",
43-
"@types/get-port": "^4.0.0",
44-
"@types/jest": "^26.0.23",
45-
"@types/js-base64": "^3.3.1",
46-
"@types/node": "^15.12.2",
47-
"@types/notifyjs": "^3.0.2",
48-
"@types/puppeteer": "^5.4.6",
49-
"@types/react": "^16.9.49",
50-
"@types/react-dom": "^16.9.8",
51-
"@types/react-infinite": "0.0.35",
52-
"@types/react-router-dom": "^5.1.7",
53-
"@types/remove-markdown": "^0.3.0",
54-
"@types/rimraf": "^3.0.0",
55-
"@typescript-eslint/eslint-plugin": "^4.1.0",
56-
"@typescript-eslint/parser": "^4.1.0",
57-
"eslint-config-prettier": "^6.11.0",
58-
"eslint-plugin-import": "^2.22.0",
59-
"eslint-plugin-jest": "^24.0.0",
60-
"eslint-plugin-prefer-arrow": "^1.2.2",
61-
"eslint-plugin-react": "^7.20.6",
62-
"eslint-plugin-unicorn": "^21.0.0",
63-
"get-port": "^5.1.1",
64-
"prettier": "^2.3.1",
65-
"puppeteer": "^17.1.3",
66-
"react-scripts": "^4.0.3",
67-
"rimraf": "^3.0.2",
46+
"@eslint/js": "^9.32.0",
47+
"@types/notifyjs": "^3.0.5",
48+
"@types/react": "^19.1.9",
49+
"@types/react-dom": "^19.1.7",
50+
"@types/react-router-dom": "^5.3.3",
51+
"@types/remove-markdown": "^0.3.4",
52+
"eslint": "^9.32.0",
53+
"get-port": "^7.1.0",
54+
"prettier": "^3.6.2",
55+
"puppeteer": "^24.15.0",
56+
"rimraf": "^6.0.1",
6857
"tree-kill": "^1.2.0",
69-
"typescript": "4.0.2",
70-
"wait-on": "^5.3.0"
71-
},
72-
"eslintConfig": {
73-
"extends": "react-app"
58+
"typescript": "^5.9.2",
59+
"typescript-eslint": "^8.38.0",
60+
"wait-on": "^8.0.4"
7461
},
7562
"browserslist": {
7663
"production": [

ui/serve.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ func Register(r *gin.Engine, version model.VersionInfo, register bool) {
3535
ui.GET("/", serveFile("index.html", "text/html", replaceConfig))
3636
ui.GET("/index.html", serveFile("index.html", "text/html", replaceConfig))
3737
ui.GET("/manifest.json", serveFile("manifest.json", "application/json", noop))
38-
ui.GET("/asset-manifest.json", serveFile("asset-manifest.json", "application/json", noop))
3938

4039
subBox, err := fs.Sub(box, "build")
4140
if err != nil {

0 commit comments

Comments
 (0)