Browse Source

add readme

master
godo 11 months ago
parent
commit
254355bd24
  1. 61
      README.md
  2. 4
      app/download.go
  3. 0
      docs/Api.md
  4. 0
      docs/Guide.md
  5. 241
      docs/file.md
  6. 1
      docs/img/Linux.svg
  7. 1
      docs/img/MacOS.svg
  8. 1
      docs/img/Windows.svg
  9. BIN
      docs/img/baiban.png
  10. BIN
      docs/img/cal.png
  11. BIN
      docs/img/doc.png
  12. BIN
      docs/img/excel.png
  13. BIN
      docs/img/file.png
  14. BIN
      docs/img/fileeditor.png
  15. BIN
      docs/img/gant.png
  16. BIN
      docs/img/home.png
  17. BIN
      docs/img/ie.png
  18. BIN
      docs/img/kanban.png
  19. 1
      docs/img/license_ MIT.svg
  20. BIN
      docs/img/localchat.png
  21. BIN
      docs/img/markdown.png
  22. BIN
      docs/img/mind.png
  23. BIN
      docs/img/pic.png
  24. BIN
      docs/img/ppt.png
  25. BIN
      docs/img/rili.png
  26. BIN
      docs/img/setting-store.png
  27. 2
      frontend/package.json
  28. 6
      frontend/src/components/localchat/ChatContent.vue
  29. 2
      frontend/src/system/applist.ts
  30. 19
      frontend/src/system/index.ts
  31. 26
      frontend/src/system/initBuiltin.ts
  32. 9
      frontend/src/util/update.ts
  33. 4
      frontend/tsconfig.json

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
here: https://wails.io/docs/reference/project-config
[![license][license-image]][license-url]
## 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" />

4
app/download.go

@ -104,10 +104,8 @@ func (a *App) AddToDownloadList(path string, url string) {
Url: url,
Downloading: false,
})
a.ContinueDownload(url)
} else {
a.ContinueDownload(url)
}
a.ContinueDownload(url)
}
func (a *App) DownloadLoop() {

0
docs/Api.md

0
docs/Guide.md

241
docs/file.md

@ -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

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.1 KiB

1
docs/img/MacOS.svg

@ -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

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

BIN
docs/img/cal.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 KiB

BIN
docs/img/doc.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

BIN
docs/img/excel.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

BIN
docs/img/file.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 KiB

BIN
docs/img/fileeditor.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
docs/img/gant.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

BIN
docs/img/home.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 KiB

BIN
docs/img/ie.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 KiB

BIN
docs/img/kanban.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

1
docs/img/license_ MIT.svg

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 KiB

BIN
docs/img/markdown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 KiB

BIN
docs/img/mind.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

BIN
docs/img/pic.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

BIN
docs/img/ppt.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

BIN
docs/img/rili.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 KiB

BIN
docs/img/setting-store.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 KiB

2
frontend/package.json

@ -1,7 +1,7 @@
{
"name": "godoos",
"private": true,
"version": "0.0.0",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",

6
frontend/src/components/localchat/ChatContent.vue

@ -97,7 +97,9 @@ async function scroll({ scrollTop }: { scrollTop: number }) {
<ChatFoot class="mt-20px"></ChatFoot>
</div>
<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>
</template>
<style scoped lang="scss">
@ -205,6 +207,8 @@ $win10-light-grey: #f2f2f2;
.no-message-container {
height: 100%;
margin: 120px auto;
text-align: center;
justify-content: center;
}
.file-bubble {
background-color: #f0f0f0; /* 背景色,可以根据需要调整 */

2
frontend/src/system/applist.ts

@ -225,7 +225,7 @@ export const appList = [
{
name: 'calculator',
appIcon: "calculator",
content: "/calculator/index.html",
url: "/calculator/index.html",
frame: true,
width: 366,
height: 550,

19
frontend/src/system/index.ts

@ -241,8 +241,6 @@ export class System {
}
private async initFileSystem() {
// 如果传入了自定义fs,就使用传入的fs
//if (this._options.fs) {
if (getSystemKey("storeType") == 'local'){
//this.fs = this._options.fs;
this.fs = useOsFile();
@ -345,22 +343,6 @@ export class System {
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:
* force
@ -391,7 +373,6 @@ export class System {
} else {
this.isFirstRun = true;
setSystemKey('isFirstRun', true)
// localStorage.setItem('godoOS_firstRun', 'true');
this.emit('firstRun');
return true;
}

26
frontend/src/system/initBuiltin.ts

@ -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({
component: "DateTime",
});

9
frontend/src/util/update.ts

@ -1,20 +1,23 @@
//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() {
if(!(window as any).go) return;
const config = getSystemConfig();
const updateGiteeUrl = `https://gitee.com/api/v5/repos/ruitao_admin/godoos/releases/`
const releaseRes = await fetch(updateGiteeUrl)
if(!releaseRes.ok) return;
const releaseData = await releaseRes.json()
const versionTag = releaseData.tag_name;
if(!versionTag) return;
if (versionTag.replace('v', '') <= manifest.version) return;
if (versionTag.replace('v', '') <= config.version) return;
const verifyUrl = `${updateGiteeUrl}tags/${versionTag}`;
const verRes = await fetch(verifyUrl);
if(!verRes.ok) return;
const verData = await verRes.json()
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) => {
if (r.ok) {

4
frontend/tsconfig.json

@ -7,7 +7,6 @@
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
//"strict": true, // js/ts false
//"jsx": "preserve",
"importHelpers": true,
//"moduleResolution": "node",
"experimentalDecorators": true,
@ -15,7 +14,6 @@
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"noImplicitThis": true, // js/ts false
//"baseUrl": ".",
/* Bundler mode */
"moduleResolution": "node",
"allowImportingTsExtensions": true,
@ -23,8 +21,6 @@
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
//"types": ["custom-types"],
/* Linting */
"strict": true,

Loading…
Cancel
Save