Browse Source

publish the web version

master
godo 10 months ago
parent
commit
f86f2403d2
  1. 1
      .gitignore
  2. 26
      README.en.md
  3. 25
      README.md
  4. 15
      frontend/src/components/setting/SetSystem.vue
  5. 35
      godo/build.sh
  6. 26
      godo/cmd/main.go

1
.gitignore

@ -1,4 +1,5 @@
build/bin
node_modules
frontend/dist
dist

26
README.en.md

@ -15,7 +15,7 @@ English | [简体中文](README.md)
</div>
### 👇 Download and Install
### 👇 Desktop Download and Install
1. 💻 **Windows User**:
@ -35,10 +35,28 @@ English | [简体中文](README.md)
- Linux (AMD64) [**gitee Download**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos-linux-amd64.zip) | [**github Download**](https://github.com/phpk/godoos/releases/download/v1.0.0/godoos-macos-arm64.zip)
4. 📥 **web installation**
- Download and install the corresponding version of the installation program, download [web version](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/dist.zip) Extract to the program installation directory/ dist, Start the program. Access address: http://localhost:56780/
5. 🚢 **Docker installation**
### 📥 Download and install the web version
- **First, download** [**The dist**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/dist.zip) Extract to the program installation directory/ dist。
- Next, download the corresponding system's server. Put it in the program installation directory./.
- Finally, start the server. The access address is: http://localhost:8215/
1. 💻 **Windows User**:
- Windows (AMD64) [**gitee Download**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos_windows_amd64.exe)
- Windows (ARM64) [**gitee Download**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos_windows_arm64.exe)
2. 💼 **MacOS User**:
- MacOS (AMD64) [**gitee Download**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos_darwin_amd64)
- MacOS (ARM64) [**gitee Download**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos_darwin_arm64)
3. 💽 **Linux User**:
- Linux (AMD64) [**gitee Download**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos_linux_amd64)
- Linux (ARM64) [**gitee Download**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos_linux_arm64)
### 🚢 **Docker installation**
```
docker run -d -p 56780:56780 -p 8185:80 --name godoos godoos/godoos:latest
```

25
README.md

@ -15,7 +15,7 @@
</div>
### 👇 下载安装
### 👇 桌面版下载安装
1. 💻 **Windows 用户**:
@ -35,10 +35,27 @@
- Linux (AMD64) [**国内下载**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos-linux-amd64.zip) | [**github下载**](https://github.com/phpk/godoos/releases/download/v1.0.0/godoos-macos-arm64.zip)
4. 📥 **网页版下载**
- 下载对应版本的安装程序下载安装,下载[网页版](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/dist.zip)解压到程序安装目录./dist,启动程序。访问地址:http://localhost:56780/
### 📥 WEB版下载安装
- **首先下载**[**dist静态包**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/dist.zip)解压到程序安装目录./dist。
- 其次下载对应系统的服务端。放到程序安装目录./。
- 最后启动服务端。访问地址为:http://localhost:8215/
1. 💻 **Windows 用户**:
- Windows (AMD64) [**国内下载**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos_windows_amd64.exe)
- Windows (ARM64) [**国内下载**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos_windows_arm64.exe)
2. 💼 **MacOS 用户**:
- MacOS (AMD64) [**国内下载**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos_darwin_amd64)
- MacOS (ARM64) [**国内下载**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos_darwin_arm64)
3. 💽 **Linux 用户**:
- Linux (AMD64) [**国内下载**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos_linux_amd64)
- Linux (ARM64) [**国内下载**](https://gitee.com/ruitao_admin/godoos/releases/download/v1.0.0/godoos_linux_arm64)
5. 🚢 **Docker安装**
### 🚢 **Docker安装**
```
docker run -d -p 56780:56780 -p 8185:80 --name godoos godoos/godoos:latest
```

15
frontend/src/components/setting/SetSystem.vue

@ -121,7 +121,7 @@ import { Dialog, join, System, t } from "@/system";
import JSZip from "jszip";
import FileSaver from "file-saver";
import { getSystemConfig, setSystemConfig } from "@/system/config";
import { OpenDirDialog } from "@/util/goutil";
import { OpenDirDialog, RestartApp } from "@/util/goutil";
const config = ref(getSystemConfig());
const sys = inject<System>("system")!;
let zipFile: File | undefined = undefined;
@ -177,10 +177,12 @@ function submitOsInfo() {
};
if (saveData.storeType === "local") {
if (saveData.storePath === "") {
Dialog.showMessageBox({
message: "存储地址不能为空",
type: "error",
});
// Dialog.showMessageBox({
// message: "",
// type: "error",
// });
setSystemConfig(saveData);
RestartApp();
return;
}
postData.value = saveData.storePath;
@ -223,7 +225,8 @@ function submitOsInfo() {
title: t("language"),
type: "info",
}).then(() => {
location.reload();
//location.reload();
RestartApp();
});
} else {
Dialog.showMessageBox({

35
godo/build.sh

@ -0,0 +1,35 @@
#!/bin/bash
# 定义要构建的平台
PLATFORMS=("linux/amd64" "windows/amd64" "darwin/amd64" "linux/arm64" "windows/arm64" "darwin/arm64")
# 定义版本号
SCRIPT_VERSION="1.0.0"
# 获取当前脚本的绝对路径
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
for PLATFORM in "${PLATFORMS[@]}"; do
# 分割平台字符串
OS=$(echo $PLATFORM | cut -d '/' -f 1)
ARCH=$(echo $PLATFORM | cut -d '/' -f 2)
# 设置后缀
case $OS in
"windows") SUFFIX=".exe" ;;
*) SUFFIX="" ;;
esac
OUT_PATH="../dist/"
if [ ! -d "$OUT_PATH" ]; then
mkdir "$OUT_PATH"
fi
# 输出文件名
OUTPUT_FILE="${OUT_PATH}godoos_${OS}_${ARCH}${SUFFIX}"
# 设置GOOS和GOARCH环境变量
export GOOS=$OS
export GOARCH=$ARCH
# 执行编译命令,并处理可能的错误
go build -o "$OUTPUT_FILE" ./main.go || { echo "编译 $OS/$ARCH 失败,请检查错误并尝试解决。"; continue; }
echo "编译 $OS/$ARCH 成功,生成文件: $OUTPUT_FILE"
done

26
godo/cmd/main.go

@ -15,8 +15,11 @@ import (
)
const serverAddress = ":56780"
const staticServerAddress = ":8215"
var srv *http.Server
var staticSrv *http.Server
var staticRouter *http.ServeMux
func OsStart() {
libs.Initdir()
@ -27,11 +30,13 @@ func OsStart() {
staticDir := libs.GetStaticDir()
router.PathPrefix("/static").Handler(http.StripPrefix("/static", http.FileServer(http.Dir(staticDir))))
router.HandleFunc("/ping", store.Ping).Methods(http.MethodGet)
if libs.PathExists("./dist") {
router.PathPrefix("/").Handler(http.StripPrefix("/", http.FileServer(http.Dir("./dist"))))
} else {
if !libs.PathExists("./dist") {
router.HandleFunc("/", store.Ping).Methods(http.MethodGet)
} else {
staticRouter = http.NewServeMux()
staticRouter.Handle("/", http.FileServer(http.Dir("./dist")))
}
progressRouter := router.PathPrefix("/store").Subrouter()
progressRouter.HandleFunc("/start/{name}", store.StartProcess).Methods(http.MethodGet)
progressRouter.HandleFunc("/stop/{name}", store.StopProcess).Methods(http.MethodGet)
@ -74,7 +79,15 @@ func OsStart() {
router.HandleFunc("/localchat/sse", localchat.SseHandler).Methods(http.MethodGet)
router.HandleFunc("/localchat/message", localchat.HandleMessage).Methods(http.MethodPost)
router.HandleFunc("/localchat/upload", localchat.MultiUploadHandler).Methods(http.MethodPost)
// 将静态文件服务放在最后,作为默认处理程序
router.PathPrefix("/").Handler(http.NotFoundHandler())
if staticRouter != nil {
go func() {
log.Printf("Static Server listening on port: %v", staticServerAddress)
staticSrv = &http.Server{Addr: staticServerAddress, Handler: staticRouter}
Serve(staticSrv)
}()
}
go store.CheckActive(context.Background())
log.Printf("Listening on port: %v", serverAddress)
srv = &http.Server{Addr: serverAddress, Handler: router}
@ -90,5 +103,10 @@ func OsStop() {
if err := srv.Shutdown(ctx); err != nil {
log.Fatalf("Server forced to shutdown: %v", err)
}
if staticSrv != nil {
if err := staticSrv.Shutdown(ctx); err != nil {
log.Fatalf("Static Server forced to shutdown: %v", err)
}
}
log.Println("Server stopped.")
}

Loading…
Cancel
Save