mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-28 04:11:16 +01:00
Add previewArgs support for template functions and enhance validation logic for form inputs
This commit is contained in:
@@ -758,6 +758,10 @@ pub struct TemplateFunction {
|
||||
#[ts(optional)]
|
||||
pub aliases: Option<Vec<String>>,
|
||||
pub args: Vec<TemplateFunctionArg>,
|
||||
|
||||
/// A list of arg names to show in the inline preview. If not provided, none will be shown (for privacy reasons).
|
||||
#[ts(optional)]
|
||||
pub preview_args: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
/// Similar to FormInput, but contains
|
||||
|
||||
@@ -22,6 +22,7 @@ pub(crate) fn template_function_secure() -> TemplateFunction {
|
||||
preview_type: Some(TemplateFunctionPreviewType::None),
|
||||
description: Some("Securely store encrypted text".to_string()),
|
||||
aliases: None,
|
||||
preview_args: None,
|
||||
args: vec![TemplateFunctionArg::FormInput(FormInput::Text(
|
||||
FormInputText {
|
||||
multi_line: Some(true),
|
||||
@@ -68,6 +69,7 @@ pub(crate) fn template_function_keyring() -> TemplateFunction {
|
||||
preview_type: Some(TemplateFunctionPreviewType::Live),
|
||||
description: Some(meta.description),
|
||||
aliases: Some(vec!["keyring".to_string()]),
|
||||
preview_args: Some(vec!["service".to_string(), "account".to_string()]),
|
||||
args: vec![
|
||||
TemplateFunctionArg::FormInput(FormInput::Banner(FormInputBanner {
|
||||
inputs: Some(vec![FormInput::Markdown(FormInputMarkdown {
|
||||
|
||||
Reference in New Issue
Block a user