-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: PWA支持 * feat: 静态文件嵌入到可执行文件 * docs: 修改文档 * feat: 修改 manifest.json 文件 * feat: 支持 service worker
- Loading branch information
Showing
12 changed files
with
1,414 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use actix_web::{error::ErrorNotFound, HttpRequest, HttpResponse, Responder, Result}; | ||
use rust_embed::RustEmbed; | ||
|
||
#[derive(RustEmbed)] | ||
#[folder = "www"] | ||
struct Asset; | ||
|
||
pub async fn serve(req: HttpRequest) -> Result<impl Responder> { | ||
let path = &req.path()[1..]; | ||
|
||
let file = Asset::get(path) | ||
.or(Asset::get("index.html")) | ||
.ok_or(ErrorNotFound("Not Found"))?; | ||
|
||
Ok( | ||
HttpResponse::Ok() | ||
.content_type(file.metadata.mimetype()) | ||
.body(file.data), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "Wol", | ||
"short_name": "Wol", | ||
"start_url": ".", | ||
"display": "standalone", | ||
"background_color": "#001529", | ||
"description": "Wol 是 wake on lan 的简写,是一个轻量、简洁的 Wol 管理服务,支持检测设备是否开机成功。", | ||
"icons": [ | ||
{ | ||
"src": "favicon.svg", | ||
"sizes": "any" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.