oipage 1.7.0-rc.0 → 1.8.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG +10 -2
- package/README.md +87 -95
- package/bin/help.js +48 -45
- package/bin/run +5 -3
- package/bin/serve.d.ts +71 -64
- package/bin/serve.js +9 -1
- package/bin/tools/openBrowser.js +26 -0
- package/bin/website-htmls/pages/appStore/index.html +1 -20
- package/bin/website-htmls/pages/appStore/index.scss +43 -41
- package/bin/website-htmls/pages/chart/index.scss +3 -2
- package/bin/website-htmls/pages/home/index.html +22 -0
- package/bin/website-htmls/pages/home/index.js +20 -0
- package/bin/website-htmls/pages/home/index.scss +29 -0
- package/bin/website-htmls/pages/image-editor/index.scss +4 -2
- package/bin/website-htmls/router.config.js +16 -9
- package/nodejs/animation/index.js +6 -6
- package/nodejs/cmdlog/index.js +1 -1
- package/nodejs/disk/index.js +1 -1
- package/nodejs/format/index.js +1 -1
- package/nodejs/json/index.js +1 -1
- package/nodejs/logform/index.js +1 -1
- package/nodejs/reader/index.js +1 -1
- package/nodejs/throttle/index.js +1 -1
- package/package.json +1 -1
- package/web/XMLHttpRequest/index.js +1 -1
- package/web/animation/index.js +6 -6
- package/web/format/index.js +1 -1
- package/web/json/index.js +1 -1
- package/web/onReady/index.js +1 -1
- package/web/performChunk/index.js +1 -1
- package/web/reader/index.js +1 -1
- package/web/style/index.js +1 -1
- package/web/throttle/index.js +1 -1
- package/snipping/chart.png +0 -0
- package/snipping/image-editor.png +0 -0
package/CHANGELOG
CHANGED
|
@@ -143,7 +143,7 @@ v1.6.1:
|
|
|
143
143
|
1、修复run命令在Windows中运行错误
|
|
144
144
|
(关联issue: https://github.com/oi-contrib/OIPage/issues/8 )
|
|
145
145
|
v1.7.0:
|
|
146
|
-
date:
|
|
146
|
+
date:2026-01-06
|
|
147
147
|
changes:
|
|
148
148
|
- 优化改造
|
|
149
149
|
1、types定义模块,方便使用时代码提示
|
|
@@ -154,4 +154,12 @@ v1.7.0:
|
|
|
154
154
|
3、修改types错误定义(intercept)
|
|
155
155
|
- 新增功能
|
|
156
156
|
1、开发服务器
|
|
157
|
-
* 转发功能 proxy
|
|
157
|
+
* 转发功能 proxy
|
|
158
|
+
v1.8.0:
|
|
159
|
+
date:
|
|
160
|
+
changes:
|
|
161
|
+
- 优化改造
|
|
162
|
+
1、animation兼容对支付宝小程序等支持
|
|
163
|
+
- 新增功能
|
|
164
|
+
1、开发服务器
|
|
165
|
+
* 自动打开浏览器 open
|
package/README.md
CHANGED
|
@@ -1,95 +1,87 @@
|
|
|
1
|
-
- 💘 开源不易,去 <i>[Github给个Star](https://github.com/oi-contrib/OIPage) </i>吧!
|
|
2
|
-
|
|
3
|
-
<img src='https://oi-contrib.github.io/OIPage/images/logo.png' height='100px'/>
|
|
4
|
-
|
|
5
|
-
<p>
|
|
6
|
-
<a href="https://zxl20070701.github.io/toolbox/#/npm-download?packages=oipage&interval=7">
|
|
7
|
-
<img src="https://img.shields.io/npm/dm/oipage.svg" alt="downloads">
|
|
8
|
-
</a>
|
|
9
|
-
<a href="https://www.npmjs.com/package/oipage">
|
|
10
|
-
<img src="https://img.shields.io/npm/v/oipage.svg" alt="npm">
|
|
11
|
-
</a>
|
|
12
|
-
<a href="https://github.com/oi-contrib/OIPage/issues">
|
|
13
|
-
<img src="https://img.shields.io/github/issues/oi-contrib/OIPage" alt="issue">
|
|
14
|
-
</a>
|
|
15
|
-
<a href="https://github.com/oi-contrib/OIPage" target='_blank'>
|
|
16
|
-
<img alt="GitHub repo stars" src="https://img.shields.io/github/stars/oi-contrib/OIPage?style=social">
|
|
17
|
-
</a>
|
|
18
|
-
<a href="https://github.com/oi-contrib/OIPage">
|
|
19
|
-
<img src="https://img.shields.io/github/forks/oi-contrib/OIPage" alt="forks">
|
|
20
|
-
</a>
|
|
21
|
-
<a href="https://gitee.com/oi-contrib/OIPage" target='_blank'>
|
|
22
|
-
<img alt="Gitee repo stars" src="https://gitee.com/oi-contrib/OIPage/badge/star.svg">
|
|
23
|
-
</a>
|
|
24
|
-
<a href="https://gitee.com/oi-contrib/OIPage">
|
|
25
|
-
<img src="https://gitee.com/oi-contrib/OIPage/badge/fork.svg" alt="forks">
|
|
26
|
-
</a>
|
|
27
|
-
</p>
|
|
28
|
-
|
|
29
|
-
<img src="https://nodei.co/npm/oipage.png?downloads=true&downloadRank=true&stars=true" alt="NPM">
|
|
30
|
-
|
|
31
|
-
# [OIPage](https://github.com/oi-contrib/OIPage)
|
|
32
|
-
前端网页或应用快速开发助手,包括开发服务器、辅助命令、实用API等。官网地址:[https://oi-contrib.github.io/OIPage](https://oi-contrib.github.io/OIPage)
|
|
33
|
-
|
|
34
|
-
## 如何使用?
|
|
35
|
-
|
|
36
|
-
你可以作为一个命令行使用,那么你需要全局安装:
|
|
37
|
-
|
|
38
|
-
```shell
|
|
39
|
-
npm install -g oipage
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
也可以作为项目开发中的一个功能加强,在 package.json 中配置命令或nodejs文件中引入需要的模块使用,那么就在项目中执行安装命令:
|
|
43
|
-
|
|
44
|
-
```shell
|
|
45
|
-
npm install oipage --save
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
安装后,就可以直接作为命令行使用了。你可以打印帮助查看:
|
|
49
|
-
|
|
50
|
-
```shell
|
|
51
|
-
oipage-cli
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
比如会出现类似下列内容:
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
OIPage@v1.2.0
|
|
58
|
-
|
|
59
|
-
可以使用的命令如下:
|
|
60
|
-
|
|
61
|
-
【1】oipage-cli serve 开发服务器
|
|
62
|
-
--port|-p 端口号
|
|
63
|
-
--baseUrl 服务器根目录
|
|
64
|
-
......
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
根据提示我们知道,比如第一个命令,其提供了一个快速访问本地资源服务器的功能,比如执行:
|
|
68
|
-
|
|
69
|
-
```shell
|
|
70
|
-
oipage-cli serve -p 8080
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
启动成功后,直接访问: http://localhost:8080/ 即可。
|
|
74
|
-
|
|
75
|
-
如果你需要在项目中使用,我们也提供了一些有用的API,具体可以访问[ 在线文档 ](https://oi-contrib.github.io/OIPage)进行了解。
|
|
76
|
-
|
|
77
|
-
## 应用市场
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
已有功能或更多功能我们将根据实际情况逐步完善和维护,当然,你可以通过 [issue](https://github.com/oi-contrib/OIPage/issues) 给我们留言,告诉我们你的改进意见。
|
|
90
|
-
|
|
91
|
-
## 版权
|
|
92
|
-
|
|
93
|
-
MIT License
|
|
94
|
-
|
|
95
|
-
Copyright (c) [zxl20070701](https://zxl20070701.github.io/notebook/home.html) 走一步,再走一步
|
|
1
|
+
- 💘 开源不易,去 <i>[Github给个Star](https://github.com/oi-contrib/OIPage) </i>吧!
|
|
2
|
+
|
|
3
|
+
<img src='https://oi-contrib.github.io/OIPage/images/logo.png' height='100px'/>
|
|
4
|
+
|
|
5
|
+
<p>
|
|
6
|
+
<a href="https://zxl20070701.github.io/toolbox/#/npm-download?packages=oipage&interval=7">
|
|
7
|
+
<img src="https://img.shields.io/npm/dm/oipage.svg" alt="downloads">
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/oipage">
|
|
10
|
+
<img src="https://img.shields.io/npm/v/oipage.svg" alt="npm">
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://github.com/oi-contrib/OIPage/issues">
|
|
13
|
+
<img src="https://img.shields.io/github/issues/oi-contrib/OIPage" alt="issue">
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://github.com/oi-contrib/OIPage" target='_blank'>
|
|
16
|
+
<img alt="GitHub repo stars" src="https://img.shields.io/github/stars/oi-contrib/OIPage?style=social">
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://github.com/oi-contrib/OIPage">
|
|
19
|
+
<img src="https://img.shields.io/github/forks/oi-contrib/OIPage" alt="forks">
|
|
20
|
+
</a>
|
|
21
|
+
<a href="https://gitee.com/oi-contrib/OIPage" target='_blank'>
|
|
22
|
+
<img alt="Gitee repo stars" src="https://gitee.com/oi-contrib/OIPage/badge/star.svg">
|
|
23
|
+
</a>
|
|
24
|
+
<a href="https://gitee.com/oi-contrib/OIPage">
|
|
25
|
+
<img src="https://gitee.com/oi-contrib/OIPage/badge/fork.svg" alt="forks">
|
|
26
|
+
</a>
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
<img src="https://nodei.co/npm/oipage.png?downloads=true&downloadRank=true&stars=true" alt="NPM">
|
|
30
|
+
|
|
31
|
+
# [OIPage](https://github.com/oi-contrib/OIPage)
|
|
32
|
+
前端网页或应用快速开发助手,包括开发服务器、辅助命令、实用API等。官网地址:[https://oi-contrib.github.io/OIPage](https://oi-contrib.github.io/OIPage)
|
|
33
|
+
|
|
34
|
+
## 如何使用?
|
|
35
|
+
|
|
36
|
+
你可以作为一个命令行使用,那么你需要全局安装:
|
|
37
|
+
|
|
38
|
+
```shell
|
|
39
|
+
npm install -g oipage
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
也可以作为项目开发中的一个功能加强,在 package.json 中配置命令或nodejs文件中引入需要的模块使用,那么就在项目中执行安装命令:
|
|
43
|
+
|
|
44
|
+
```shell
|
|
45
|
+
npm install oipage --save
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
安装后,就可以直接作为命令行使用了。你可以打印帮助查看:
|
|
49
|
+
|
|
50
|
+
```shell
|
|
51
|
+
oipage-cli
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
比如会出现类似下列内容:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
OIPage@v1.2.0
|
|
58
|
+
|
|
59
|
+
可以使用的命令如下:
|
|
60
|
+
|
|
61
|
+
【1】oipage-cli serve 开发服务器
|
|
62
|
+
--port|-p 端口号
|
|
63
|
+
--baseUrl 服务器根目录
|
|
64
|
+
......
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
根据提示我们知道,比如第一个命令,其提供了一个快速访问本地资源服务器的功能,比如执行:
|
|
68
|
+
|
|
69
|
+
```shell
|
|
70
|
+
oipage-cli serve -p 8080
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
启动成功后,直接访问: http://localhost:8080/ 即可。
|
|
74
|
+
|
|
75
|
+
如果你需要在项目中使用,我们也提供了一些有用的API,具体可以访问[ 在线文档 ](https://oi-contrib.github.io/OIPage)进行了解。
|
|
76
|
+
|
|
77
|
+
## 应用市场
|
|
78
|
+
|
|
79
|
+
为了方便日常使用,内置了一个应用市场网站,比如有如下功能:群聊天、图片编辑器等。
|
|
80
|
+
|
|
81
|
+
已有功能或更多功能我们将根据实际情况逐步完善和维护,当然,你可以通过 [issue](https://github.com/oi-contrib/OIPage/issues) 给我们留言,告诉我们你的改进意见。
|
|
82
|
+
|
|
83
|
+
## 版权
|
|
84
|
+
|
|
85
|
+
MIT License
|
|
86
|
+
|
|
87
|
+
Copyright (c) [zxl20070701](https://zxl20070701.github.io/notebook/home.html) 走一步,再走一步
|
package/bin/help.js
CHANGED
|
@@ -1,46 +1,49 @@
|
|
|
1
|
-
const packageValue = require("../package.json");
|
|
2
|
-
|
|
3
|
-
module.exports = function () {
|
|
4
|
-
console.log(`\x1b[36m
|
|
5
|
-
OIPage@v${packageValue.version}
|
|
6
|
-
|
|
7
|
-
可以使用的命令如下:
|
|
8
|
-
|
|
9
|
-
【1】oipage-cli serve 开发服务器
|
|
10
|
-
--port|-p [端口号]
|
|
11
|
-
默认8080
|
|
12
|
-
--baseUrl [文件夹地址]
|
|
13
|
-
服务器根目录
|
|
14
|
-
--
|
|
15
|
-
|
|
16
|
-
--
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
--
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
【
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
const packageValue = require("../package.json");
|
|
2
|
+
|
|
3
|
+
module.exports = function () {
|
|
4
|
+
console.log(`\x1b[36m
|
|
5
|
+
OIPage@v${packageValue.version}
|
|
6
|
+
|
|
7
|
+
可以使用的命令如下:
|
|
8
|
+
|
|
9
|
+
【1】oipage-cli serve 开发服务器
|
|
10
|
+
--port|-p [端口号]
|
|
11
|
+
默认8080
|
|
12
|
+
--baseUrl [文件夹地址]
|
|
13
|
+
服务器根目录
|
|
14
|
+
--open
|
|
15
|
+
自动打开浏览器
|
|
16
|
+
(也可以设置打开地址,比如 oipage-cli serve --open docs/index.html)
|
|
17
|
+
--config|-c [配置文件地址]
|
|
18
|
+
设置配置文件,相对地址是相对当前命令行
|
|
19
|
+
--cache [true|false]
|
|
20
|
+
是否启用304(默认true表示开启)
|
|
21
|
+
(eg: oipage-cli serve -p 20000 )
|
|
22
|
+
--proxy [转发前缀] [转发地址]
|
|
23
|
+
(注意:转发前缀会被替换为空,相当于设置了 pathRewrite: { '^/demo': '' })
|
|
24
|
+
|
|
25
|
+
【2】oipage-cli disk 磁盘操作
|
|
26
|
+
--force|-f
|
|
27
|
+
强制执行,如果目标地址已有内容,会直接强制删除已有内容
|
|
28
|
+
--delete|-d [文件或文件夹地址]
|
|
29
|
+
删除文件或文件夹
|
|
30
|
+
--delempty [文件夹地址]
|
|
31
|
+
删除空文件夹
|
|
32
|
+
--move|-m [源地址] [软链接地址]
|
|
33
|
+
移动文件或文件夹
|
|
34
|
+
--copy|-c [源地址] [目标地址]
|
|
35
|
+
复制文件或文件夹
|
|
36
|
+
--link|-l [源地址] [软链接地址]
|
|
37
|
+
创建磁盘链接
|
|
38
|
+
(eg: oipage-cli disk -m ./test.js ~/test.js -f )
|
|
39
|
+
|
|
40
|
+
【3】oipage-cli run "任务一" "任务二" ... 运行多命令
|
|
41
|
+
( 如果希望动态给任务传递参数,可以查看: https://github.com/oi-contrib/OIPage/issues/5 )
|
|
42
|
+
|
|
43
|
+
【4】oipage-cli network 网络相关
|
|
44
|
+
--log
|
|
45
|
+
打印网络信息
|
|
46
|
+
(eg: oipage-cli network --log )
|
|
47
|
+
\x1b[0m`);
|
|
48
|
+
|
|
46
49
|
};
|
package/bin/run
CHANGED
|
@@ -22,6 +22,7 @@ if (process.argv[2] === "serve") {
|
|
|
22
22
|
devServer: {
|
|
23
23
|
port: 8080,
|
|
24
24
|
baseUrl: "./",
|
|
25
|
+
open: false,
|
|
25
26
|
cache: true,
|
|
26
27
|
proxy: {},
|
|
27
28
|
intercept: []
|
|
@@ -50,9 +51,10 @@ if (process.argv[2] === "serve") {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
if (
|
|
54
|
-
if (
|
|
55
|
-
if (
|
|
54
|
+
if (argvObj["--port"]) config.devServer.port = argvObj["--port"][0];
|
|
55
|
+
if (argvObj["--baseUrl"]) config.devServer.baseUrl = argvObj["--baseUrl"][0];
|
|
56
|
+
if (argvObj["--cache"]) config.devServer.cache = argvObj["--cache"][0] === "true";
|
|
57
|
+
if (argvObj["--open"]) config.devServer.open = argvObj["--open"][0] || true;
|
|
56
58
|
|
|
57
59
|
require("./serve.js")(config);
|
|
58
60
|
}
|
package/bin/serve.d.ts
CHANGED
|
@@ -1,65 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
interface DevServerType {
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
1
|
+
|
|
2
|
+
interface DevServerType {
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 是否自动打开浏览器,默认false,true表示打开
|
|
6
|
+
*
|
|
7
|
+
* 也可以是一段地址,比如设置open=“docs/index.html”
|
|
8
|
+
*/
|
|
9
|
+
open?: boolean | string
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 服务器端口号
|
|
13
|
+
*/
|
|
14
|
+
port: number
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 服务器根路径
|
|
18
|
+
*/
|
|
19
|
+
baseUrl: string
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 是否开启304缓存,默认开启
|
|
23
|
+
*/
|
|
24
|
+
cache: boolean
|
|
25
|
+
|
|
26
|
+
intercept?: Array<InterceptType>
|
|
27
|
+
|
|
28
|
+
proxy?: {
|
|
29
|
+
[key: string]: {
|
|
30
|
+
target: string
|
|
31
|
+
pathRewrite?: {
|
|
32
|
+
[key: string]: string
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface InterceptType {
|
|
39
|
+
test: RegExp
|
|
40
|
+
handler(request: any, response: any): void
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface LoaderType {
|
|
44
|
+
(source: string): string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface ConfigType {
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 服务器名称
|
|
51
|
+
*/
|
|
52
|
+
name?: string
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 服务器版本
|
|
56
|
+
*/
|
|
57
|
+
version?: string
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 服务器运行配置
|
|
61
|
+
*/
|
|
62
|
+
devServer: DevServerType
|
|
63
|
+
|
|
64
|
+
module?: {
|
|
65
|
+
rules: Array<{
|
|
66
|
+
test: RegExp
|
|
67
|
+
use: LoaderType
|
|
68
|
+
}>
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
65
72
|
export default function (config?: ConfigType): void
|
package/bin/serve.js
CHANGED
|
@@ -6,6 +6,7 @@ const network = require("./tools/network.js");
|
|
|
6
6
|
const mineTypes = require("./data/mineTypes.json");
|
|
7
7
|
const resolve404 = require("./tools/resolve404.js");
|
|
8
8
|
const resolveImportFactory = require("./tools/resolveImport.js");
|
|
9
|
+
const openBrowser = require("./tools/openBrowser.js");
|
|
9
10
|
const { doIntercept } = require("./intercept.js");
|
|
10
11
|
const proxy = require("./proxy.js");
|
|
11
12
|
|
|
@@ -175,6 +176,13 @@ module.exports = function (config) {
|
|
|
175
176
|
for (let ipv4Item of networkValue.IPv4) console.log('<i> \x1b[1m\x1b[32m[' + name + '] On Your Network (IPv4):\x1b[36m http://' + ipv4Item.address + ':' + port + '/\x1b[0m');
|
|
176
177
|
for (let ipv6Item of networkValue.IPv6) console.log('<i> \x1b[1m\x1b[32m[' + name + '] On Your Network (IPv6): \x1b[36mhttp://[' + ipv6Item.address + ']:' + port + '/\x1b[0m');
|
|
177
178
|
console.log('<i> \x1b[1m\x1b[32m[' + name + '] Content not from ' + (config.name || "OIPage") + ' is served from \x1b[36m"' + basePath + '" \x1b[0mdirectory');
|
|
179
|
+
|
|
180
|
+
if (typeof config.devServer.open === "string" || config.devServer.open) {
|
|
181
|
+
let url = 'http://localhost:' + port + "/" + (typeof config.devServer.open === "string" ? config.devServer.open : "");
|
|
182
|
+
openBrowser(url);
|
|
183
|
+
console.log('<i> \x1b[1m\x1b[32m[' + name + '] Open: \x1b[36m' + url + '\x1b[0m');
|
|
184
|
+
}
|
|
185
|
+
|
|
178
186
|
if (!cache) console.log('<i> \x1b[1m\x1b[32m[' + name + '] Cancel 304 Cache!\x1b[0m');
|
|
179
|
-
console.log('\n' + (config.name || "OIPage") + ' ' + version + ' compiled \x1b[1m\x1b[32msuccessfully\x1b[0m in ' + (new Date().valueOf() - startTime) + ' ms\n')
|
|
187
|
+
console.log('\n' + (config.name || "OIPage") + ' ' + version + ' compiled \x1b[1m\x1b[32msuccessfully\x1b[0m in ' + (new Date().valueOf() - startTime) + ' ms\n');
|
|
180
188
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const { exec } = require('child_process');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
|
|
4
|
+
module.exports = function (url) {
|
|
5
|
+
const platform = os.platform();
|
|
6
|
+
let command;
|
|
7
|
+
|
|
8
|
+
switch (platform) {
|
|
9
|
+
case 'win32': // Windows
|
|
10
|
+
command = `start ${url}`;
|
|
11
|
+
break;
|
|
12
|
+
case 'darwin': // macOS
|
|
13
|
+
command = `open ${url}`;
|
|
14
|
+
break;
|
|
15
|
+
default: // Linux及其他
|
|
16
|
+
command = `xdg-open ${url}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
exec(command, (error) => {
|
|
20
|
+
if (error) {
|
|
21
|
+
console.error(`无法打开浏览器: ${error}`);
|
|
22
|
+
} else {
|
|
23
|
+
// todo
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -2,24 +2,5 @@
|
|
|
2
2
|
<header>
|
|
3
3
|
应用市场
|
|
4
4
|
</header>
|
|
5
|
-
<
|
|
6
|
-
<li z-on:click.prevent="goto" tag="chart">
|
|
7
|
-
<img src="./images/chart.png" />
|
|
8
|
-
<h2>
|
|
9
|
-
群聊天
|
|
10
|
-
</h2>
|
|
11
|
-
</li>
|
|
12
|
-
<li z-on:click="goto" tag="image-editor">
|
|
13
|
-
<img src="./images/image-editor.png" />
|
|
14
|
-
<h2>
|
|
15
|
-
图片编辑器
|
|
16
|
-
</h2>
|
|
17
|
-
</li>
|
|
18
|
-
<li z-on:click="goto" tag="img-to-pdf">
|
|
19
|
-
<img src="./images/img-to-pdf.svg" />
|
|
20
|
-
<h2>
|
|
21
|
-
图片转PDF
|
|
22
|
-
</h2>
|
|
23
|
-
</li>
|
|
24
|
-
</ul>
|
|
5
|
+
<router></router>
|
|
25
6
|
</div>
|
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
.appstore-view {
|
|
2
|
-
|
|
3
|
-
header {
|
|
4
|
-
height: 50px;
|
|
5
|
-
line-height: 50px;
|
|
6
|
-
background-color: white;
|
|
7
|
-
box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 4px;
|
|
8
|
-
background-image: url("./images/logo.png");
|
|
9
|
-
background-size: auto 90%;
|
|
10
|
-
background-repeat: no-repeat;
|
|
11
|
-
background-position-x: 5px;
|
|
12
|
-
padding-left: 50px;
|
|
13
|
-
font-size: 18px;
|
|
14
|
-
font-weight: 800;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
ul {
|
|
18
|
-
text-align:
|
|
19
|
-
padding:
|
|
20
|
-
|
|
21
|
-
&>li {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
.appstore-view {
|
|
2
|
+
|
|
3
|
+
header {
|
|
4
|
+
height: 50px;
|
|
5
|
+
line-height: 50px;
|
|
6
|
+
background-color: white;
|
|
7
|
+
box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 4px;
|
|
8
|
+
background-image: url("./images/logo.png");
|
|
9
|
+
background-size: auto 90%;
|
|
10
|
+
background-repeat: no-repeat;
|
|
11
|
+
background-position-x: 5px;
|
|
12
|
+
padding-left: 50px;
|
|
13
|
+
font-size: 18px;
|
|
14
|
+
font-weight: 800;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
ul {
|
|
18
|
+
text-align: left;
|
|
19
|
+
padding: 20px 10px;
|
|
20
|
+
|
|
21
|
+
&>li {
|
|
22
|
+
text-align: center;
|
|
23
|
+
display: inline-block;
|
|
24
|
+
margin: 10px;
|
|
25
|
+
width: 90px;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
text-decoration: underline;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&>img {
|
|
33
|
+
border-radius: 10px;
|
|
34
|
+
width: 50px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&>h2 {
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
line-height: 2em;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
42
44
|
}
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
&>.content {
|
|
3
3
|
position: fixed;
|
|
4
4
|
width: 350px;
|
|
5
|
-
height: calc(100% -
|
|
5
|
+
height: calc(100% - 150px);
|
|
6
6
|
border: 2px solid #000000;
|
|
7
7
|
left: 50%;
|
|
8
|
-
top:
|
|
8
|
+
top: 100px;
|
|
9
9
|
transform: translateX(-50%);
|
|
10
10
|
padding: 5px;
|
|
11
11
|
overflow: auto;
|
|
12
|
+
border-radius: 10px 10px 0 0;
|
|
12
13
|
|
|
13
14
|
&::-webkit-scrollbar {
|
|
14
15
|
width: 0;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<div class="home-view">
|
|
2
|
+
<ul>
|
|
3
|
+
<li z-on:click.prevent="goto" tag="chart">
|
|
4
|
+
<img src="./images/chart.png" />
|
|
5
|
+
<h2>
|
|
6
|
+
群聊天
|
|
7
|
+
</h2>
|
|
8
|
+
</li>
|
|
9
|
+
<li z-on:click="goto" tag="image-editor">
|
|
10
|
+
<img src="./images/image-editor.png" />
|
|
11
|
+
<h2>
|
|
12
|
+
图片编辑器
|
|
13
|
+
</h2>
|
|
14
|
+
</li>
|
|
15
|
+
<li z-on:click="goto" tag="img-to-pdf">
|
|
16
|
+
<img src="./images/img-to-pdf.svg" />
|
|
17
|
+
<h2>
|
|
18
|
+
图片转PDF
|
|
19
|
+
</h2>
|
|
20
|
+
</li>
|
|
21
|
+
</ul>
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineElement, ref } from "zipaper"
|
|
2
|
+
import template from "./index.html"
|
|
3
|
+
import style from "./index.scss"
|
|
4
|
+
|
|
5
|
+
export default defineElement({
|
|
6
|
+
template,
|
|
7
|
+
data() {
|
|
8
|
+
return {
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
methods: {
|
|
13
|
+
goto(event, target) {
|
|
14
|
+
this.$goto("/appStore/" + target.getAttribute("tag"))
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
style: {
|
|
18
|
+
content: style
|
|
19
|
+
}
|
|
20
|
+
})
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.home-view {
|
|
2
|
+
ul {
|
|
3
|
+
text-align: left;
|
|
4
|
+
padding: 20px 10px;
|
|
5
|
+
|
|
6
|
+
&>li {
|
|
7
|
+
text-align: center;
|
|
8
|
+
display: inline-block;
|
|
9
|
+
margin: 10px;
|
|
10
|
+
width: 90px;
|
|
11
|
+
|
|
12
|
+
&:hover {
|
|
13
|
+
text-decoration: underline;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&>img {
|
|
18
|
+
border-radius: 10px;
|
|
19
|
+
width: 50px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&>h2 {
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
line-height: 2em;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
.image-editor-view {
|
|
2
|
+
position: relative;
|
|
3
|
+
padding-top: 100px;
|
|
4
|
+
|
|
2
5
|
&>.menu {
|
|
3
|
-
position:
|
|
6
|
+
position: absolute;
|
|
4
7
|
left: 50%;
|
|
5
8
|
top: 5px;
|
|
6
9
|
transform: translateX(-50%);
|
|
@@ -28,7 +31,6 @@
|
|
|
28
31
|
|
|
29
32
|
&>.content {
|
|
30
33
|
text-align: center;
|
|
31
|
-
margin-top: 100px;
|
|
32
34
|
|
|
33
35
|
#drawId {
|
|
34
36
|
display: inline-block;
|
|
@@ -7,14 +7,21 @@ export default defineRouter({
|
|
|
7
7
|
}, {
|
|
8
8
|
path: "/appStore",
|
|
9
9
|
component: () => import("./pages/appStore/index.js"),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
children: [{
|
|
11
|
+
path: "/",
|
|
12
|
+
redirect: "/home"
|
|
13
|
+
}, {
|
|
14
|
+
path: "/home",
|
|
15
|
+
component: () => import("./pages/home/index.js"),
|
|
16
|
+
}, {
|
|
17
|
+
path: "/chart",
|
|
18
|
+
component: () => import("./pages/chart/index.js"),
|
|
19
|
+
}, {
|
|
20
|
+
path: "/image-editor",
|
|
21
|
+
component: () => import("./pages/image-editor/index.js"),
|
|
22
|
+
}, {
|
|
23
|
+
path: "/img-to-pdf",
|
|
24
|
+
component: () => import("./pages/img-to-pdf/index.js"),
|
|
25
|
+
}]
|
|
19
26
|
}]
|
|
20
27
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* animation of OIPage v1.
|
|
2
|
+
* animation of OIPage v1.8.0-alpha.0
|
|
3
3
|
* git+https://github.com/oi-contrib/OIPage.git
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -43,13 +43,13 @@ function animation(doback, duration, callback) {
|
|
|
43
43
|
//开启唯一的定时器timerId
|
|
44
44
|
"start": function () {
|
|
45
45
|
if (!$timerId) {
|
|
46
|
-
if (
|
|
47
|
-
$timerId = setInterval(clock.tick, $interval);
|
|
48
|
-
} else {
|
|
46
|
+
if (globalThis && globalThis.requestAnimationFrame) {
|
|
49
47
|
$timerId = globalThis.requestAnimationFrame(function step() {
|
|
50
48
|
clock.tick();
|
|
51
49
|
if ($timerId) $timerId = globalThis.requestAnimationFrame(step);
|
|
52
50
|
});
|
|
51
|
+
} else {
|
|
52
|
+
$timerId = setInterval(clock.tick, $interval);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
},
|
|
@@ -88,8 +88,8 @@ function animation(doback, duration, callback) {
|
|
|
88
88
|
//停止定时器,重置timerId=null
|
|
89
89
|
"stop": function () {
|
|
90
90
|
if ($timerId) {
|
|
91
|
-
if (
|
|
92
|
-
else
|
|
91
|
+
if (globalThis && globalThis.requestAnimationFrame) globalThis.cancelAnimationFrame($timerId);
|
|
92
|
+
else clearInterval($timerId);
|
|
93
93
|
$timerId = null;
|
|
94
94
|
}
|
|
95
95
|
}
|
package/nodejs/cmdlog/index.js
CHANGED
package/nodejs/disk/index.js
CHANGED
package/nodejs/format/index.js
CHANGED
package/nodejs/json/index.js
CHANGED
package/nodejs/logform/index.js
CHANGED
package/nodejs/reader/index.js
CHANGED
package/nodejs/throttle/index.js
CHANGED
package/package.json
CHANGED
package/web/animation/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* animation of OIPage v1.
|
|
2
|
+
* animation of OIPage v1.8.0-alpha.0
|
|
3
3
|
* git+https://github.com/oi-contrib/OIPage.git
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -43,13 +43,13 @@ export function animation(doback, duration, callback) {
|
|
|
43
43
|
//开启唯一的定时器timerId
|
|
44
44
|
"start": function () {
|
|
45
45
|
if (!$timerId) {
|
|
46
|
-
if (
|
|
47
|
-
$timerId = setInterval(clock.tick, $interval);
|
|
48
|
-
} else {
|
|
46
|
+
if (globalThis && globalThis.requestAnimationFrame) {
|
|
49
47
|
$timerId = globalThis.requestAnimationFrame(function step() {
|
|
50
48
|
clock.tick();
|
|
51
49
|
if ($timerId) $timerId = globalThis.requestAnimationFrame(step);
|
|
52
50
|
});
|
|
51
|
+
} else {
|
|
52
|
+
$timerId = setInterval(clock.tick, $interval);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
},
|
|
@@ -88,8 +88,8 @@ export function animation(doback, duration, callback) {
|
|
|
88
88
|
//停止定时器,重置timerId=null
|
|
89
89
|
"stop": function () {
|
|
90
90
|
if ($timerId) {
|
|
91
|
-
if (
|
|
92
|
-
else
|
|
91
|
+
if (globalThis && globalThis.requestAnimationFrame) globalThis.cancelAnimationFrame($timerId);
|
|
92
|
+
else clearInterval($timerId);
|
|
93
93
|
$timerId = null;
|
|
94
94
|
}
|
|
95
95
|
}
|
package/web/format/index.js
CHANGED
package/web/json/index.js
CHANGED
package/web/onReady/index.js
CHANGED
package/web/reader/index.js
CHANGED
package/web/style/index.js
CHANGED
package/web/throttle/index.js
CHANGED
package/snipping/chart.png
DELETED
|
Binary file
|
|
Binary file
|