Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src-tauri/examples/import_quick_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ struct QuickCommand {
risk_level: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
sort_order: Option<i32>,
#[serde(default, skip_serializing_if = "Option::is_none")]
target_connection_ids: Option<Vec<String>>,
}

#[derive(Debug, Deserialize)]
Expand Down Expand Up @@ -395,6 +397,7 @@ fn merge_import(
source,
risk_level,
sort_order: command.sort_order,
target_connection_ids: None,
},
);
imported_commands += 1;
Expand Down
3 changes: 3 additions & 0 deletions src-tauri/src/config/quick_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ pub struct QuickCommand {
pub use_count: Option<u32>,
#[serde(default)]
pub sort_order: Option<i32>,
/// 一键命令:目标服务器连接 ID 列表。留空则沿用原行为(发送到当前活动会话)。
#[serde(default, skip_serializing_if = "Option::is_none")]
pub target_connection_ids: Option<Vec<String>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
1 change: 1 addition & 0 deletions src-tauri/src/core/cloud_sync/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ mod tests {
created_at: None,
use_count: None,
sort_order: None,
target_connection_ids: None,
});
snapshot.payload_hash = calculate_payload_hash(&snapshot).expect("hash snapshot");
snapshot
Expand Down
1 change: 1 addition & 0 deletions src-tauri/src/core/portable_snapshot/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ mod tests {
created_at: None,
use_count: None,
sort_order: None,
target_connection_ids: None,
});
snapshot.payload_hash = calculate_payload_hash(&snapshot).expect("hash snapshot");
snapshot
Expand Down
1 change: 1 addition & 0 deletions src-tauri/src/core/quick_commands/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ fn merge_import(
created_at: Some(now),
use_count: None,
sort_order: command.sort_order,
target_connection_ids: command.target_connection_ids,
};

if upsert_command(config, imported) {
Expand Down
2 changes: 2 additions & 0 deletions src-tauri/src/core/quick_commands/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ fn parse_windterm_quickbar(raw: &str) -> AppResult<ImportConfig> {
source: Some("manual".to_string()),
risk_level: None,
sort_order: None,
target_connection_ids: None,
});
}

Expand Down Expand Up @@ -191,6 +192,7 @@ fn parse_xshell_quick_buttons_content(raw: &str) -> ImportConfig {
source: Some("manual".to_string()),
risk_level: None,
sort_order: None,
target_connection_ids: None,
})
})
.collect();
Expand Down
1 change: 1 addition & 0 deletions src-tauri/src/core/quick_commands/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ Button_2_Action=whoami
created_at: Some(5),
use_count: Some(7),
sort_order: Some(3),
target_connection_ids: None,
}],
categories: Vec::new(),
};
Expand Down
2 changes: 2 additions & 0 deletions src-tauri/src/core/quick_commands/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ struct ImportCommand {
risk_level: Option<String>,
#[serde(default)]
sort_order: Option<i32>,
#[serde(default)]
target_connection_ids: Option<Vec<String>>,
}

#[derive(Debug, Default)]
Expand Down
Loading