Skip to content

GoViewPro/PakePro

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,789 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PakePro

Support GoViewPro

项目介绍

一个超级简单,基于 Pake 项目改造的将前端项目打包成桌面端的工具.

这个项目每次打开新的页面,都会创建一个新的窗口.(如果前端逻辑是路由跳转,则不会创建新的窗口)

配置 tauri.conf.json, 配置为 frontendDist:"../dist" 或者线上的前端项目地址, 例如: devUrl:"https://ai.goviewlink.com".

注意: 本地运行时,你需要 devUrl:"http://localhost:8080" 运行自己的前端项目. 打包部署时,你需要将 dist 目录复制到 PakePro 项目的 根目录.

# 安装依赖
npm i

# 本地开发 默认运行本地 http://localhost:8080 的前端项目.
npm run dev

# 将前端项目打包到 dist 目录 , 并将 dist 目录复制到 PakePro 项目的 根目录.
npm run build

# 使用远程前端项目
# 配置 tauri.conf.json, 配置为 `devUrl:"https://ai.goviewlink.com"`

项目修改

  1. PakePro/src-tauri/src/app/invoke.rs
    window_run_label 函数是每次创建新窗口的主要逻辑.

  2. PakePro/src-tauri/src/inject/event.js
    你可以通过修改 window.open 去自定义创建新窗口的逻辑.

  3. PakePro/src-tauri/src/lib.rs
    项目采用的是 tauri_plugin_localhost 插件, http://localhost:9527 提供的本地服务器, tauri:// 协议会导致一些服务无法使用, 你们可以根据自己的需求修改这里的逻辑.

  4. 如果你是打包的本地静态文件, 需要服务端推送自动更新应用, 可以参考 main-pro-updater 分支.

⚠️ 注意安全!

PakePro/src-tauri/capabilities/default.json
为了方便使用, 安全权限采用的是最宽松的, 你可以根据自己的需求修改这里的逻辑.

Project introduction

A super simple, based on Pake project that can package front-end projects into desktop applications.

This project will create a new window each time it opens a new page. (If the front-end logic is route jump, it will not create a new window)

Configure tauri.conf.json, set frontendDist:"../dist" or use the online frontend project address, for example: devUrl:"https://ai.goviewlink.com".

Note: When running locally, you need to run your own front-end project at http://localhost:8080. When deploying, you need to copy the dist directory to the root directory of the PakePro project.

# Install dependencies
npm i

# Local development defaults to running locally http://localhost:8080 The front-end project.
npm run dev

# Package the front-end project into the dist directory and copy the dist directory to the root directory of the PakePro project.
npm run build

Project modification

  1. PakePro/src-tauri/src/app/invoke.rs
    The window_run_label function is the main logic for creating a new window each time.

  2. PakePro/src-tauri/src/inject/event.js
    You can modify window.open to customize the logic for creating a new window.

  3. PakePro/src-tauri/src/lib.rs
    The project uses the tauri_plugin_localhost plugin, which provides a local server at http://localhost:9527. The tauri:// protocol will cause some services to not work, so you can modify the logic here according to your own needs.

  4. If you are packaging local static files, you need to push automatic updates to the server. You can refer to the main-pro-updater branch.

⚠️ Caution!

PakePro/src-tauri/capabilities/default.json
To facilitate use, the security permissions are set to the most relaxed. You can modify the logic here according to your own needs.

About

🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Rust 86.7%
  • Dockerfile 13.3%