CH-J Toolsspráva serverů přes SSH
Menu
Vydané zdroje

CH-J Tools

Procházejte adresáře a soubory konkrétního vydání aplikace.

Stáhnout zdroje ZIP
CH-J / Server Manager 872 souborů
core-20261030T220507Z-61e4558d889f Přidáno: · Sestaveno:
modules.rs Přidáno: Datum není evidováno 2,2 KB · 56 řádků
Kód Stáhnout soubor
1//! Module manager commands for the main window (formerly `plugins:*`).
3use super::{logged, main_core, text, CommandResult};
4use crate::core::app::CoreSlot;
5use serde_json::Value;
6use tauri::{State, Webview};
8#[tauri::command]
9pub async fn core_modules_list(webview: Webview, slot: State<'_, CoreSlot>) -> CommandResult {
10 let core = main_core(&webview, &slot)?;
11 logged(&core, "plugins:list", core.services.modules.registry.list_installed().map(Value::Array))
14#[tauri::command]
15pub async fn core_modules_get_state(webview: Webview, slot: State<'_, CoreSlot>) -> CommandResult {
16 let core = main_core(&webview, &slot)?;
17 logged(&core, "plugins:getState", core.services.modules.get_state())
20#[tauri::command]
21pub async fn core_modules_check_catalog(webview: Webview, slot: State<'_, CoreSlot>) -> CommandResult {
22 let core = main_core(&webview, &slot)?;
23 let result = core.services.modules.check_catalog(&core).await;
24 logged(&core, "plugins:checkCatalog", result)
27#[tauri::command]
28pub async fn core_modules_install(webview: Webview, slot: State<'_, CoreSlot>, payload: Option<Value>) -> CommandResult {
29 let core = main_core(&webview, &slot)?;
30 let payload = super::payload(payload);
31 let result = async {
32 core.services.biometrics.require_sensitive_action().await?;
33 core.services.modules.install(&core, text(&payload, "releaseId")).await
34 }
35 .await;
36 logged(&core, "plugins:install", result)
39#[tauri::command]
40pub async fn core_modules_uninstall(webview: Webview, slot: State<'_, CoreSlot>, payload: Option<Value>) -> CommandResult {
41 let core = main_core(&webview, &slot)?;
42 let payload = super::payload(payload);
43 let result = async {
44 core.services.biometrics.require_sensitive_action().await?;
45 core.services.modules.uninstall(&core, text(&payload, "pluginId")).await
46 }
47 .await;
48 logged(&core, "plugins:uninstall", result)
51#[tauri::command]
52pub async fn core_modules_open(webview: Webview, slot: State<'_, CoreSlot>, payload: Option<Value>) -> CommandResult {
53 let core = main_core(&webview, &slot)?;
54 let payload = super::payload(payload);
55 logged(&core, "plugins:open", core.services.modules.open(&core, text(&payload, "pluginId")))
SHA-25642eca85afa98bc684e58a97714aca081c3f282ac57598ec6a02f3cf42432613c

CH-J Proprietary Software License 1.14 · Zdroje jsou zveřejněny pod CH-J Proprietary Software License 1.14. Jejich dostupnost nemění licenční podmínky ani neposkytuje další oprávnění.

SHA-256 archivu77380d4805485ffa4027fbe7858b5836f197a4aa9d52358a43e2d12d018744df
Soubory