优化配套pake-cli命令1文档
This commit is contained in:
32
bin/README.md
vendored
32
bin/README.md
vendored
@@ -88,3 +88,35 @@ url 为你需要打包的网页链接 🔗,必须提供。
|
||||
```shell
|
||||
--fullscreen <value>
|
||||
```
|
||||
|
||||
#### [user-agent]
|
||||
|
||||
自定义浏览器请求头, 默认为空。
|
||||
|
||||
```shell
|
||||
--user-agent <value>
|
||||
```
|
||||
|
||||
#### [show-menu]
|
||||
|
||||
显示菜单栏, 默认不显示
|
||||
|
||||
```shell
|
||||
--show-menu
|
||||
```
|
||||
|
||||
#### [show-system-tray]
|
||||
|
||||
显示通知栏托盘, 默认不显示
|
||||
|
||||
```shell
|
||||
--show-system-tray <value>
|
||||
```
|
||||
|
||||
#### [system-tray-icon]
|
||||
|
||||
通知栏托盘图标,仅当显示通知栏托盘时有效, 图标必须为.ico或者.png格式的,512*512像素的图片。
|
||||
|
||||
```shell
|
||||
--system-tray-icon <value>
|
||||
```
|
||||
32
bin/README_EN.md
vendored
32
bin/README_EN.md
vendored
@@ -87,3 +87,35 @@ Whether to open the full screen after opening the application. The default is `f
|
||||
```shell
|
||||
--fullscreen <value>
|
||||
```
|
||||
|
||||
#### [user-agent]
|
||||
|
||||
Custom browser user agent, default is empty.
|
||||
|
||||
```shell
|
||||
--user-agent <value>
|
||||
```
|
||||
|
||||
#### [show-menu]
|
||||
|
||||
Display the menu bar, not display it by default.
|
||||
|
||||
```shell
|
||||
--show-menu
|
||||
```
|
||||
|
||||
#### [show-system-tray]
|
||||
|
||||
Display the notification tray, not display it by default.
|
||||
|
||||
```shell
|
||||
--show-system-tray <value>
|
||||
```
|
||||
|
||||
#### [system-tray-icon]
|
||||
|
||||
The notification tray icon is only valid when the notification tray is displayed. The icon must be a 512*512 pixel image in .ico or .png format.
|
||||
|
||||
```shell
|
||||
--system-tray-icon <value>
|
||||
```
|
||||
|
||||
24
bin/builders/common.ts
vendored
24
bin/builders/common.ts
vendored
@@ -119,6 +119,18 @@ export async function mergeTauriConfig(
|
||||
if (process.platform === "darwin") {
|
||||
tauriConf.pake.user_agent.macos = true;
|
||||
}
|
||||
} else {
|
||||
if (process.platform === "win32") {
|
||||
tauriConf.pake.menu.windows = false;
|
||||
}
|
||||
|
||||
if (process.platform === "linux") {
|
||||
tauriConf.pake.menu.linux = false;
|
||||
}
|
||||
|
||||
if (process.platform === "darwin") {
|
||||
tauriConf.pake.user_agent.macos = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 处理托盘
|
||||
@@ -134,6 +146,18 @@ export async function mergeTauriConfig(
|
||||
if (process.platform === "darwin") {
|
||||
tauriConf.pake.system_tray.macos = true;
|
||||
}
|
||||
} else {
|
||||
if (process.platform === "win32") {
|
||||
tauriConf.pake.system_tray.windows = false;
|
||||
}
|
||||
|
||||
if (process.platform === "linux") {
|
||||
tauriConf.pake.system_tray.linux = false;
|
||||
}
|
||||
|
||||
if (process.platform === "darwin") {
|
||||
tauriConf.pake.system_tray.macos = false;
|
||||
}
|
||||
}
|
||||
|
||||
tauriConf.package.productName = name;
|
||||
|
||||
51
dist/cli.js
vendored
51
dist/cli.js
vendored
@@ -1709,6 +1709,17 @@ function mergeTauriConfig(url, options, tauriConf) {
|
||||
tauriConf.pake.user_agent.macos = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (process.platform === "win32") {
|
||||
tauriConf.pake.menu.windows = false;
|
||||
}
|
||||
if (process.platform === "linux") {
|
||||
tauriConf.pake.menu.linux = false;
|
||||
}
|
||||
if (process.platform === "darwin") {
|
||||
tauriConf.pake.user_agent.macos = false;
|
||||
}
|
||||
}
|
||||
// 处理托盘
|
||||
if (showSystemTray) {
|
||||
if (process.platform === "win32") {
|
||||
@@ -1721,6 +1732,17 @@ function mergeTauriConfig(url, options, tauriConf) {
|
||||
tauriConf.pake.system_tray.macos = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (process.platform === "win32") {
|
||||
tauriConf.pake.system_tray.windows = false;
|
||||
}
|
||||
if (process.platform === "linux") {
|
||||
tauriConf.pake.system_tray.linux = false;
|
||||
}
|
||||
if (process.platform === "darwin") {
|
||||
tauriConf.pake.system_tray.macos = false;
|
||||
}
|
||||
}
|
||||
tauriConf.package.productName = name;
|
||||
tauriConf.tauri.bundle.identifier = identifier;
|
||||
// 处理应用图标
|
||||
@@ -1977,22 +1999,29 @@ var tauri$3 = {
|
||||
active: false
|
||||
},
|
||||
systemTray: {
|
||||
iconPath: "/home/tlntin/data/code/rust_study/Pake/src-tauri/png/code_512.png",
|
||||
iconPath: "png/weread_512.png",
|
||||
iconAsTemplate: true
|
||||
}
|
||||
};
|
||||
var build = {
|
||||
devPath: "../dist",
|
||||
distDir: "../dist",
|
||||
beforeBuildCommand: "",
|
||||
beforeDevCommand: ""
|
||||
};
|
||||
var CommonConf = {
|
||||
"package": {
|
||||
productName: "baidu",
|
||||
productName: "WeRead",
|
||||
version: "1.0.0"
|
||||
},
|
||||
tauri: tauri$3
|
||||
tauri: tauri$3,
|
||||
build: build
|
||||
};
|
||||
|
||||
var windows = [
|
||||
{
|
||||
url: "https://www.baidu.com",
|
||||
transparent: false,
|
||||
url: "https://weread.qq.com/",
|
||||
transparent: true,
|
||||
fullscreen: false,
|
||||
width: 1200,
|
||||
height: 780,
|
||||
@@ -2007,7 +2036,7 @@ var user_agent = {
|
||||
};
|
||||
var menu = {
|
||||
macos: true,
|
||||
linux: true,
|
||||
linux: false,
|
||||
windows: false
|
||||
};
|
||||
var system_tray = {
|
||||
@@ -2094,9 +2123,10 @@ var MacConf = {
|
||||
var tauri = {
|
||||
bundle: {
|
||||
icon: [
|
||||
"/home/tlntin/data/code/rust_study/Pake/src-tauri/png/code_512.png"
|
||||
"png/weread_256.ico",
|
||||
"png/weread_512.png"
|
||||
],
|
||||
identifier: "pake-f9751d",
|
||||
identifier: "com.tw93.weread",
|
||||
active: true,
|
||||
category: "DeveloperTool",
|
||||
copyright: "",
|
||||
@@ -2112,7 +2142,10 @@ var tauri = {
|
||||
"librsvg2-dev",
|
||||
"gnome-video-effects",
|
||||
"gnome-video-effects-extra"
|
||||
]
|
||||
],
|
||||
files: {
|
||||
"/usr/share/applications/com-tw93-weread.desktop": "assets/com-tw93-weread.desktop"
|
||||
}
|
||||
},
|
||||
externalBin: [
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user