add readme
61
README.md
|
|
@ -1,19 +1,56 @@
|
||||||
# README
|
<p align="center">
|
||||||
|
<img src="./build/appicon.png" width="120" height="120">
|
||||||
|
</p>
|
||||||
|
|
||||||
## About
|
<h1 align="center">GodoOS</h1>
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
This is the official Wails Vue-TS template.
|
一款高效的内网办公平台,内含word/excel/ppt/pdf/内网聊天/白板/思维导图等多个办公系统工具,支持原生文件存储,满足多样化需求。平台界面精仿windows风格,操作简便,同时保持低资源消耗和高性能运行。无需注册即可自动连接内网用户,实现即时通讯和文件共享。
|
||||||
|
|
||||||
You can configure the project by editing `wails.json`. More information about the project settings can be found
|
[![license][license-image]][license-url]
|
||||||
here: https://wails.io/docs/reference/project-config
|
|
||||||
|
|
||||||
## Live Development
|
[English](README.md) | 简体中文
|
||||||
|
|
||||||
To run in live development mode, run `wails dev` in the project directory. This will run a Vite development
|
### 安装
|
||||||
server that will provide very fast hot reload of your frontend changes. If you want to develop in a browser
|
|
||||||
and have access to your Go methods, there is also a dev server that runs on http://localhost:34115. Connect
|
|
||||||
to this in your browser, and you can call your Go code from devtools.
|
|
||||||
|
|
||||||
## Building
|
[![Windows][Windows-image]][Windows-url]
|
||||||
|
[![MacOS][MacOS-image]][MacOS-url]
|
||||||
|
[![Linux][Linux-image]][Linux-url]
|
||||||
|
|
||||||
To build a redistributable, production mode package, use `wails build`.
|
[官方文档](./docs/Api.md) | [使用说明](./docs/Guide.md)
|
||||||
|
|
||||||
|
[license-image]: ./docs/img/license_%20MIT.svg
|
||||||
|
|
||||||
|
[license-url]: https://spdx.org/licenses/MIT.html
|
||||||
|
|
||||||
|
|
||||||
|
[Windows-image]: ./docs/img/Windows.svg
|
||||||
|
|
||||||
|
[Windows-url]: https://github.com/josStorer/RWKV-Runner/blob/master/build/windows/Readme_Install.txt
|
||||||
|
|
||||||
|
[MacOS-image]: ./docs/img/MacOS.svg
|
||||||
|
|
||||||
|
[MacOS-url]: https://github.com/josStorer/RWKV-Runner/blob/master/build/darwin/Readme_Install.txt
|
||||||
|
|
||||||
|
[Linux-image]: ./docs/img/Linux.svg
|
||||||
|
|
||||||
|
[Linux-url]: https://github.com/josStorer/RWKV-Runner/blob/master/build/linux/Readme_Install.txt
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## 功能说明
|
||||||
|
|
||||||
|
一、系统桌面
|
||||||
|
- 精仿windows风格
|
||||||
|
- 桌面文件管理
|
||||||
|
- 支持原生文件拖拽
|
||||||
|
<img src="./docs/img/home.png" width="600" />
|
||||||
|
|
||||||
|
二、文件管理
|
||||||
|
- 文件上传下载
|
||||||
|
- 文件搜索
|
||||||
|
<img src="./docs/img/file.png" width="600" />
|
||||||
|
|
||||||
|
三、内网聊天
|
||||||
|
- 无需繁琐的注册流程,只需在同一局域网内,即可自动发现并列出所有可用的聊天对象,即刻开启即时通讯。支持基于局域网的即时消息传输、文件传输等功能,促进团队内部的无缝沟通与协作。
|
||||||
|
<img src="./docs/img/localchat.png" width="600" />
|
||||||
|
|
|
||||||
|
|
@ -104,10 +104,8 @@ func (a *App) AddToDownloadList(path string, url string) {
|
||||||
Url: url,
|
Url: url,
|
||||||
Downloading: false,
|
Downloading: false,
|
||||||
})
|
})
|
||||||
a.ContinueDownload(url)
|
|
||||||
} else {
|
|
||||||
a.ContinueDownload(url)
|
|
||||||
}
|
}
|
||||||
|
a.ContinueDownload(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) DownloadLoop() {
|
func (a *App) DownloadLoop() {
|
||||||
|
|
|
||||||
0
docs/Api.md
Normal file
0
docs/Guide.md
Normal file
241
docs/file.md
Normal file
|
|
@ -0,0 +1,241 @@
|
||||||
|
---
|
||||||
|
title: 文件系统接口
|
||||||
|
icon: circle-info
|
||||||
|
---
|
||||||
|
|
||||||
|
### 读取目录
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`GET`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/read`
|
||||||
|
|
||||||
|
#### 请求参数
|
||||||
|
- **Query 参数**: `path` (目录路径)
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 目录内容列表
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 获取文件或目录状态
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`GET`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/stat`
|
||||||
|
|
||||||
|
#### 请求参数
|
||||||
|
- **Query 参数**: `path` (文件或目录路径)
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 文件或目录的状态信息
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 更改文件权限
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`POST`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/chmod`
|
||||||
|
|
||||||
|
#### 请求体
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **Body**: `{ "path": "string", "mode": "string" }`
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 操作结果
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 检查文件或目录是否存在
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`GET`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/exists`
|
||||||
|
|
||||||
|
#### 请求参数
|
||||||
|
- **Query 参数**: `path` (文件或目录路径)
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 存在性检查结果
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 读取文件内容
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`GET`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/readfile`
|
||||||
|
|
||||||
|
#### 请求参数
|
||||||
|
- **Query 参数**: `path` (文件路径)
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 文件内容
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 删除文件
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`GET`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/unlink`
|
||||||
|
|
||||||
|
#### 请求参数
|
||||||
|
- **Query 参数**: `path` (文件路径)
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 操作结果
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 清空文件系统
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`GET`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/clear`
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 操作结果
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 重命名文件或目录
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`GET`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/rename`
|
||||||
|
|
||||||
|
#### 请求参数
|
||||||
|
- **Query 参数**: `oldPath` (原文件或目录路径), `newPath` (新文件或目录路径)
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 操作结果
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 创建目录
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`POST`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/mkdir`
|
||||||
|
|
||||||
|
#### 请求参数
|
||||||
|
- **Query 参数**: `dirPath` (目录路径)
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 操作结果
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 删除目录
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`GET`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/rmdir`
|
||||||
|
|
||||||
|
#### 请求参数
|
||||||
|
- **Query 参数**: `dirPath` (目录路径)
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 操作结果
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 复制文件
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`GET`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/copyfile`
|
||||||
|
|
||||||
|
#### 请求参数
|
||||||
|
- **Query 参数**: `srcPath` (源文件路径), `dstPath` (目标文件路径)
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 操作结果
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 写入文件
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`POST`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/writefile`
|
||||||
|
|
||||||
|
#### 请求参数
|
||||||
|
- **Query 参数**: `filePath` (文件路径)
|
||||||
|
|
||||||
|
#### 请求体
|
||||||
|
- **Content-Type**: `multipart/form-data`
|
||||||
|
- **Body**: 包含 `content` 的表单数据
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 操作结果
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 追加文件内容
|
||||||
|
|
||||||
|
#### HTTP 方法
|
||||||
|
`POST`
|
||||||
|
|
||||||
|
#### 路径
|
||||||
|
`/appendfile`
|
||||||
|
|
||||||
|
#### 请求参数
|
||||||
|
- **Query 参数**: `filePath` (文件路径)
|
||||||
|
|
||||||
|
#### 请求体
|
||||||
|
- **Content-Type**: `multipart/form-data`
|
||||||
|
- **Body**: 包含 `content` 的表单数据
|
||||||
|
|
||||||
|
#### 响应
|
||||||
|
- **Content-Type**: `application/json`
|
||||||
|
- **响应体**: 操作结果
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 文件系统事件监听
|
||||||
|
|
||||||
|
#### 功能
|
||||||
|
监听文件系统变化事件
|
||||||
|
|
||||||
|
#### 参数
|
||||||
|
- **path** (监听的文件或目录路径)
|
||||||
|
- **callback** (事件回调函数)
|
||||||
|
- **errback** (错误回调函数)
|
||||||
1
docs/img/Linux.svg
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
1
docs/img/MacOS.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="65" height="20" role="img" aria-label="MacOS"><title>MacOS</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="65" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="0" height="20" fill="#555"/><rect x="0" width="65" height="20" fill="black"/><rect width="65" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><image x="5" y="3" width="14" height="14" xlink:href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJ3aGl0ZXNtb2tlIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+QXBwbGU8L3RpdGxlPjxwYXRoIGQ9Ik0xMi4xNTIgNi44OTZjLS45NDggMC0yLjQxNS0xLjA3OC0zLjk2LTEuMDQtMi4wNC4wMjctMy45MSAxLjE4My00Ljk2MSAzLjAxNC0yLjExNyAzLjY3NS0uNTQ2IDkuMTAzIDEuNTE5IDEyLjA5IDEuMDEzIDEuNDU0IDIuMjA4IDMuMDkgMy43OTIgMy4wMzkgMS41Mi0uMDY1IDIuMDktLjk4NyAzLjkzNS0uOTg3IDEuODMxIDAgMi4zNS45ODcgMy45Ni45NDggMS42MzctLjAyNiAyLjY3Ni0xLjQ4IDMuNjc2LTIuOTQ4IDEuMTU2LTEuNjg4IDEuNjM2LTMuMzI1IDEuNjYyLTMuNDE1LS4wMzktLjAxMy0zLjE4Mi0xLjIyMS0zLjIyLTQuODU3LS4wMjYtMy4wNCAyLjQ4LTQuNDk0IDIuNTk3LTQuNTU5LTEuNDI5LTIuMDktMy42MjMtMi4zMjQtNC4zOS0yLjM3Ni0yLS4xNTYtMy42NzUgMS4wOS00LjYxIDEuMDl6TTE1LjUzIDMuODNjLjg0My0xLjAxMiAxLjQtMi40MjcgMS4yNDUtMy44My0xLjIwNy4wNTItMi42NjIuODA1LTMuNTMyIDEuODE4LS43OC44OTYtMS40NTQgMi4zMzgtMS4yNzMgMy43MTQgMS4zMzguMTA0IDIuNzE1LS42ODggMy41NTktMS43MDEiLz48L3N2Zz4="/><text aria-hidden="true" x="415" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">MacOS</text><text x="415" y="140" transform="scale(.1)" fill="#fff" textLength="370">MacOS</text></g></svg>
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |
1
docs/img/Windows.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="59" height="20" role="img" aria-label="Windows"><title>Windows</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="59" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="0" height="20" fill="#007ec6"/><rect x="0" width="59" height="20" fill="#007ec6"/><rect width="59" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="295" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="490">Windows</text><text x="295" y="140" transform="scale(.1)" fill="#fff" textLength="490">Windows</text></g></svg>
|
||||||
|
After Width: | Height: | Size: 915 B |
BIN
docs/img/baiban.png
Normal file
|
After Width: | Height: | Size: 91 KiB |
BIN
docs/img/cal.png
Normal file
|
After Width: | Height: | Size: 526 KiB |
BIN
docs/img/doc.png
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
docs/img/excel.png
Normal file
|
After Width: | Height: | Size: 222 KiB |
BIN
docs/img/file.png
Normal file
|
After Width: | Height: | Size: 456 KiB |
BIN
docs/img/fileeditor.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
docs/img/gant.png
Normal file
|
After Width: | Height: | Size: 211 KiB |
BIN
docs/img/home.png
Normal file
|
After Width: | Height: | Size: 513 KiB |
BIN
docs/img/ie.png
Normal file
|
After Width: | Height: | Size: 543 KiB |
BIN
docs/img/kanban.png
Normal file
|
After Width: | Height: | Size: 167 KiB |
1
docs/img/license_ MIT.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="78" height="20" role="img" aria-label="license: MIT"><title>license: MIT</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="78" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="47" height="20" fill="#555"/><rect x="47" width="31" height="20" fill="#007ec6"/><rect width="78" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="245" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">license</text><text x="245" y="140" transform="scale(.1)" fill="#fff" textLength="370">license</text><text aria-hidden="true" x="615" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">MIT</text><text x="615" y="140" transform="scale(.1)" fill="#fff" textLength="210">MIT</text></g></svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
BIN
docs/img/localchat.png
Normal file
|
After Width: | Height: | Size: 426 KiB |
BIN
docs/img/markdown.png
Normal file
|
After Width: | Height: | Size: 441 KiB |
BIN
docs/img/mind.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
docs/img/pic.png
Normal file
|
After Width: | Height: | Size: 147 KiB |
BIN
docs/img/ppt.png
Normal file
|
After Width: | Height: | Size: 272 KiB |
BIN
docs/img/rili.png
Normal file
|
After Width: | Height: | Size: 600 KiB |
BIN
docs/img/setting-store.png
Normal file
|
After Width: | Height: | Size: 430 KiB |
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "godoos",
|
"name": "godoos",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "1.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,9 @@ async function scroll({ scrollTop }: { scrollTop: number }) {
|
||||||
<ChatFoot class="mt-20px"></ChatFoot>
|
<ChatFoot class="mt-20px"></ChatFoot>
|
||||||
</div>
|
</div>
|
||||||
<div class="no-message-container" v-else>
|
<div class="no-message-container" v-else>
|
||||||
<Vue3Lottie animationLink="/bot/localchat.json" :height="300" :width="300" />
|
<el-icon :size="180" color="#0078d7">
|
||||||
|
<ChatDotRound />
|
||||||
|
</el-icon>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
@ -205,6 +207,8 @@ $win10-light-grey: #f2f2f2;
|
||||||
.no-message-container {
|
.no-message-container {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 120px auto;
|
margin: 120px auto;
|
||||||
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
.file-bubble {
|
.file-bubble {
|
||||||
background-color: #f0f0f0; /* 背景色,可以根据需要调整 */
|
background-color: #f0f0f0; /* 背景色,可以根据需要调整 */
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ export const appList = [
|
||||||
{
|
{
|
||||||
name: 'calculator',
|
name: 'calculator',
|
||||||
appIcon: "calculator",
|
appIcon: "calculator",
|
||||||
content: "/calculator/index.html",
|
url: "/calculator/index.html",
|
||||||
frame: true,
|
frame: true,
|
||||||
width: 366,
|
width: 366,
|
||||||
height: 550,
|
height: 550,
|
||||||
|
|
|
||||||
|
|
@ -241,8 +241,6 @@ export class System {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async initFileSystem() {
|
private async initFileSystem() {
|
||||||
// 如果传入了自定义fs,就使用传入的fs
|
|
||||||
//if (this._options.fs) {
|
|
||||||
if (getSystemKey("storeType") == 'local'){
|
if (getSystemKey("storeType") == 'local'){
|
||||||
//this.fs = this._options.fs;
|
//this.fs = this._options.fs;
|
||||||
this.fs = useOsFile();
|
this.fs = useOsFile();
|
||||||
|
|
@ -345,22 +343,6 @@ export class System {
|
||||||
this._rootState.windowMap[loc].set(options.name, options);
|
this._rootState.windowMap[loc].set(options.name, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
// async runPlugin(system: System) {
|
|
||||||
// const pluginsFile = await this.fs.readdir(`${this._options.systemLocation}plugs`);
|
|
||||||
// if (pluginsFile) {
|
|
||||||
// await Promise.all(
|
|
||||||
// pluginsFile.map(async (file) => {
|
|
||||||
// const fileContent = await this.fs.readFile(file.path);
|
|
||||||
// if (file.isFile) {
|
|
||||||
// const content = fileContent;
|
|
||||||
// if (content) {
|
|
||||||
// //new Shell(system, '/', 'root').exec('node ' + file.path);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
/**
|
/**
|
||||||
* @description: 添加应用
|
* @description: 添加应用
|
||||||
* force 表示强制,在每次启动时都会添加
|
* force 表示强制,在每次启动时都会添加
|
||||||
|
|
@ -391,7 +373,6 @@ export class System {
|
||||||
} else {
|
} else {
|
||||||
this.isFirstRun = true;
|
this.isFirstRun = true;
|
||||||
setSystemKey('isFirstRun', true)
|
setSystemKey('isFirstRun', true)
|
||||||
// localStorage.setItem('godoOS_firstRun', 'true');
|
|
||||||
this.emit('firstRun');
|
this.emit('firstRun');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -201,32 +201,6 @@ export function initBuiltinFileOpener(system: System) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// system.registerFileOpener(
|
|
||||||
// [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp"],
|
|
||||||
// {
|
|
||||||
// name: "图片",
|
|
||||||
// icon: 'image',
|
|
||||||
// func: (path: string, content: any) => {
|
|
||||||
// const imgwindow = new BrowserWindow({
|
|
||||||
// width: 400,
|
|
||||||
// height: 400,
|
|
||||||
// icon: 'image',
|
|
||||||
// center: true,
|
|
||||||
// title: "图片预览",
|
|
||||||
// content: "ImageViewer",
|
|
||||||
// config: {
|
|
||||||
// content: content,
|
|
||||||
// path: path,
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// imgwindow.show();
|
|
||||||
// },
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const dateTimeT = new Tray({
|
const dateTimeT = new Tray({
|
||||||
component: "DateTime",
|
component: "DateTime",
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,23 @@
|
||||||
//import { EventsOff, EventsOn } from '~/runtime';
|
//import { EventsOff, EventsOn } from '~/runtime';
|
||||||
import manifest from '../../package.json';
|
//import manifest from '../../package.json';
|
||||||
|
import {isWindowsOS,getSystemConfig} from '@/system/config'
|
||||||
export async function checkUpdate() {
|
export async function checkUpdate() {
|
||||||
if(!(window as any).go) return;
|
if(!(window as any).go) return;
|
||||||
|
const config = getSystemConfig();
|
||||||
const updateGiteeUrl = `https://gitee.com/api/v5/repos/ruitao_admin/godoos/releases/`
|
const updateGiteeUrl = `https://gitee.com/api/v5/repos/ruitao_admin/godoos/releases/`
|
||||||
const releaseRes = await fetch(updateGiteeUrl)
|
const releaseRes = await fetch(updateGiteeUrl)
|
||||||
if(!releaseRes.ok) return;
|
if(!releaseRes.ok) return;
|
||||||
const releaseData = await releaseRes.json()
|
const releaseData = await releaseRes.json()
|
||||||
const versionTag = releaseData.tag_name;
|
const versionTag = releaseData.tag_name;
|
||||||
if(!versionTag) return;
|
if(!versionTag) return;
|
||||||
if (versionTag.replace('v', '') <= manifest.version) return;
|
if (versionTag.replace('v', '') <= config.version) return;
|
||||||
const verifyUrl = `${updateGiteeUrl}tags/${versionTag}`;
|
const verifyUrl = `${updateGiteeUrl}tags/${versionTag}`;
|
||||||
const verRes = await fetch(verifyUrl);
|
const verRes = await fetch(verifyUrl);
|
||||||
if(!verRes.ok) return;
|
if(!verRes.ok) return;
|
||||||
const verData = await verRes.json()
|
const verData = await verRes.json()
|
||||||
if(!verData.assets || verData.assets.length <= 0) return;
|
if(!verData.assets || verData.assets.length <= 0) return;
|
||||||
const updateUrl = `${updateGiteeUrl}download/${versionTag}/${asset.name}`;
|
const appName = "godoos"+ versionTag + (isWindowsOS() ? '.exe' : '');
|
||||||
|
const updateUrl = `${updateGiteeUrl}download/${versionTag}/${appName}`;
|
||||||
|
|
||||||
fetch(`${updateGiteeUrl}latest`).then((r) => {
|
fetch(`${updateGiteeUrl}latest`).then((r) => {
|
||||||
if (r.ok) {
|
if (r.ok) {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
//"strict": true, // js/ts 混用时设为false
|
//"strict": true, // js/ts 混用时设为false
|
||||||
//"jsx": "preserve",
|
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
//"moduleResolution": "node",
|
//"moduleResolution": "node",
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
|
|
@ -15,7 +14,6 @@
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"noImplicitThis": true, // js/ts 混用时设为false
|
"noImplicitThis": true, // js/ts 混用时设为false
|
||||||
//"baseUrl": ".",
|
|
||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
|
|
@ -23,8 +21,6 @@
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
|
|
||||||
//"types": ["custom-types"],
|
|
||||||
|
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
|
|
||||||