feat(community): 展示持久桌面包与绑定的安装预览

This commit is contained in:
2026-09-08 22:08:42 +08:00
parent 9106ac5123
commit 86b9d06dcc
10 changed files with 187 additions and 3 deletions
+1
View File
@@ -23,6 +23,7 @@ fn main() {
"extension_stage_prepare",
"extension_stage_cancel",
"extension_stage_status",
"extension_staged",
"record_get",
"record_write",
"sync_login",
+2 -1
View File
@@ -56,6 +56,7 @@
"allow-extension-stage",
"allow-extension-stage-prepare",
"allow-extension-stage-cancel",
"allow-extension-stage-status"
"allow-extension-stage-status",
"allow-extension-staged"
]
}
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!
[[permission]]
identifier = "allow-extension-staged"
description = "Enables the extension_staged command without any pre-configured scope."
commands.allow = ["extension_staged"]
[[permission]]
identifier = "deny-extension-staged"
description = "Denies the extension_staged command without any pre-configured scope."
commands.deny = ["extension_staged"]
@@ -225,6 +225,28 @@ pub fn extension_stage_status(
serde_json::to_value(receipt).map_err(|_| "EXTENSION_STATUS_FAILED".into())
}
#[tauri::command]
pub async fn extension_staged(
window: WebviewWindow,
host: State<'_, Host>,
offset: u32,
limit: u32,
) -> Result<Value, String> {
main_window(&window)?;
let extensions = host.extensions.clone();
tauri::async_runtime::spawn_blocking(move || {
let store = extensions.lock().map_err(|_| "HOST_BUSY")?;
let items = store
.as_ref()
.ok_or("EXTENSIONS_NOT_READY")?
.staged(offset, limit)
.map_err(|e| e.code)?;
serde_json::to_value(items).map_err(|_| "EXTENSION_LIST_FAILED".into())
})
.await
.map_err(|_| "EXTENSION_LIST_FAILED".to_string())?
}
#[cfg(test)]
mod tests {
use super::*;
+1
View File
@@ -855,6 +855,7 @@ fn main() {
extension_stage_prepare,
extension_stage_cancel,
extension_stage_status,
extension_staged,
record_get,
record_write,
sync_login,