CH-J ToolsSSH를 통한 서버 관리
메뉴
공개된 소스

CH-J Tools

특정 애플리케이션 릴리스의 디렉터리와 파일을 살펴보세요.

소스 ZIP 다운로드
CH-J / Server Manager 1704 개 파일
0.1.2-beta 추가됨: · 빌드됨:
standby.rs 추가됨: 날짜 기록 없음 1.4 KB · 31 줄
코드 파일 다운로드
1//! Settings → Standby Helper (main window only). The helper itself applies the system entries.
2use super::{main_core, CommandResult};
3use crate::core::{app::CoreSlot, error::CoreError, standby};
4use serde_json::{json, Value};
5use tauri::{State, Webview};
7#[tauri::command]
8pub async fn core_standby_get(webview: Webview, slot: State<'_, CoreSlot>) -> CommandResult {
9 let core = main_core(&webview, &slot)?;
10 let data = core.paths.data.clone();
11 tokio::task::spawn_blocking(move || Ok(json!({"settings": standby::load(&data), "status": standby::status(&data)})))
12 .await
13 .map_err(|_| CoreError::plain("Standby helper status failed."))?
16#[tauri::command]
17pub async fn core_standby_set(webview: Webview, slot: State<'_, CoreSlot>, payload: Option<Value>) -> CommandResult {
18 let core = main_core(&webview, &slot)?;
19 let settings = super::payload(payload);
20 let data = core.paths.data.clone();
21 let profiles = if core.vault.is_unlocked() { core.profiles.list().ok() } else { None };
22 let result = tokio::task::spawn_blocking(move || -> Result<Value, CoreError> {
23 let saved = standby::save(&data, &settings)?;
24 standby::sync_servers(&data, profiles.as_deref())?;
25 let status = standby::apply(&data)?;
26 Ok(json!({"settings": saved, "status": status}))
27 })
28 .await
29 .map_err(|_| CoreError::plain("Standby helper update failed."))?;
30 super::logged(&core, "standby:set", result)
SHA-256c1e8f6c47e002bbc397a02ffb6b143189ec8195d17e073741d1957064c4edb8e

CH-J Proprietary Software License 1.14 · 소스는 CH-J Proprietary Software License 1.14에 따라 제공됩니다. 소스를 공개한다고 해서 라이선스 조항이 바뀌거나 추가 권리가 부여되지는 않습니다.

압축 파일 SHA-256ac8fe790f4ba60fc098f8c985fc2656cfcc6cdc21fb34b30e308a2b54e62258f
파일