mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
fix: cannot ota upgrade when connect to remote node #424
This commit is contained in:
parent
f41b6bc07b
commit
7ef4fec896
8 changed files with 115 additions and 156 deletions
|
@ -13,5 +13,8 @@ func InitPublicRouter(r *gin.RouterGroup) {
|
||||||
func InitPrivateRouter(r *gin.RouterGroup) {
|
func InitPrivateRouter(r *gin.RouterGroup) {
|
||||||
r.GET("upgrade/release", GetRelease)
|
r.GET("upgrade/release", GetRelease)
|
||||||
r.GET("upgrade/current", GetCurrentVersion)
|
r.GET("upgrade/current", GetCurrentVersion)
|
||||||
|
}
|
||||||
|
|
||||||
|
func InitWebSocketRouter(r *gin.RouterGroup) {
|
||||||
r.GET("upgrade/perform", PerformCoreUpgrade)
|
r.GET("upgrade/perform", PerformCoreUpgrade)
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,3 +21,47 @@ manual `h(...)` calls), you can enable Volar's Take Over mode by following these
|
||||||
2. Reload the VS Code window by running `Developer: Reload Window` from the command palette.
|
2. Reload the VS Code window by running `Developer: Reload Window` from the command palette.
|
||||||
|
|
||||||
You can learn more about Take Over mode [here](https://github.com/johnsoncodehk/volar/discussions/471).
|
You can learn more about Take Over mode [here](https://github.com/johnsoncodehk/volar/discussions/471).
|
||||||
|
|
||||||
|
## Project Setup
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pnpm install
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** The default target of the api proxy is `http://localhost:9000`,
|
||||||
|
if you need to change this, create the `.env` file in root directory and set your target in it.
|
||||||
|
|
||||||
|
```env
|
||||||
|
VITE_PROXY_TARGET=http://localhost:9001
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compile and Hot-Reload for Development
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pnpm dev
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** The default port of the dev server is `3002`,
|
||||||
|
if you need to change this, create the `.env` file in root directory and set your port in it.
|
||||||
|
|
||||||
|
```env
|
||||||
|
VITE_PORT=3456
|
||||||
|
```
|
||||||
|
|
||||||
|
### Code Style Check
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pnpm lint
|
||||||
|
```
|
||||||
|
|
||||||
|
### Type Check
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pnpm typecheck
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compile and Minify for Production
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pnpm build
|
||||||
|
```
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":"2.0.0-beta.26","build_id":141,"total_build":345}
|
{"version":"2.0.0-beta.26","build_id":142,"total_build":346}
|
|
@ -1 +1 @@
|
||||||
{"version":"2.0.0-beta.26","build_id":141,"total_build":345}
|
{"version":"2.0.0-beta.26","build_id":142,"total_build":346}
|
|
@ -71,6 +71,7 @@ export default defineConfig(({ mode }) => {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
|
port: Number.parseInt(env.VITE_PORT) || 3002,
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: env.VITE_PROXY_TARGET || 'http://localhost:9000',
|
target: env.VITE_PROXY_TARGET || 'http://localhost:9000',
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -65,9 +65,7 @@ func (e *Environment) GetWebSocketURL(uri string) (decodedUri string, err error)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// http will be replaced with ws, https will be replaced with wss
|
// http will be replaced with ws, https will be replaced with wss
|
||||||
decodedUri = strings.ReplaceAll(decodedUri, "http", "ws")
|
decodedUri = strings.ReplaceAll(decodedUri, "http", "ws")
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,8 +71,8 @@ func InitRouter() *gin.Engine {
|
||||||
terminal.InitRouter(w)
|
terminal.InitRouter(w)
|
||||||
nginx.InitNginxLogRouter(w)
|
nginx.InitNginxLogRouter(w)
|
||||||
upstream.InitRouter(w)
|
upstream.InitRouter(w)
|
||||||
|
system.InitWebSocketRouter(w)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r
|
return r
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue