Skip to content

Commit

Permalink
Merge branch 'main' into fix/indexmanagement_service_api_url
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 authored Aug 24, 2023
2 parents 994f5b1 + 323878e commit e3c1f12
Show file tree
Hide file tree
Showing 13 changed files with 275 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,44 @@ export const TextExpansionOutput: FC<{

export const DocumentResult: FC<{
response: FormattedTextExpansionResponse;
}> = ({ response }) => {
const statInfo = useResultStatFormatting(response);

return (
<>
{response.text !== undefined ? (
<>
<EuiStat
title={roundToDecimalPlace(response.score, 3)}
textAlign="left"
titleColor={statInfo.color}
description={
<EuiTextColor color={statInfo.color}>
<span>
{statInfo.icon !== null ? (
<EuiIcon type={statInfo.icon} color={statInfo.color} />
) : null}
{statInfo.text}
</span>
</EuiTextColor>
}
/>

<EuiSpacer size="s" />
<span css={{ color: statInfo.textColor }}>{response.text}</span>
<EuiSpacer size="s" />
</>
) : null}
</>
);
};

/*
* Currently not used. Tokens could contain sensitive words, so need to be hidden from the user.
* This may change in the future, in which case this function will be used.
*/
export const DocumentResultWithTokens: FC<{
response: FormattedTextExpansionResponse;
}> = ({ response }) => {
const tokens = response.adjustedTokenWeights
.filter(({ value }) => value > 0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
package_var_secret: {{package_var_secret}}
package_var_non_secret: {{package_var_non_secret}}
input_var_secret: {{input_var_secret}}
input_var_non_secret: {{input_var_non_secret}}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
config.version: "2"
package_var_secret: {{package_var_secret}}
package_var_non_secret: {{package_var_non_secret}}
input_var_secret: {{input_var_secret}}
input_var_non_secret: {{input_var_non_secret}}
stream_var_secret: {{stream_var_secret}}
stream_var_non_secret: {{stream_var_non_secret}}
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ streams:
multi: false
show_user: true
secret: true
- name: stream_var_non_secret
type: text
title: Stream Var Non Secret
multi: false
show_user: true
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 1.0.0
name: secrets
title: Package with secrets
description: This integration package has 3 secrets.
description: This integration package has 3 secret and 3 non secret vars.
version: 1.0.0
categories: []
# Options are experimental, beta, ga
Expand Down Expand Up @@ -32,6 +32,12 @@ vars:
required: true
show_user: true
secret: true
- name: package_var_non_secret
type: text
title: Package Var Non Secret
multi: false
required: true
show_user: true
policy_templates:
- name: secrets
title: This
Expand All @@ -48,4 +54,9 @@ policy_templates:
title: Input Var Secret
multi: false
show_user: true
secret: true
secret: true
- name: input_var_non_secret
type: text
title: Input Var Non Secret
multi: false
show_user: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package_var_secret: {{package_var_secret}}
package_var_non_secret: {{package_var_non_secret}}
input_var_secret: {{input_var_secret}}
input_var_non_secret: {{input_var_non_secret}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
config.version: "2"
package_var_secret: {{package_var_secret}}
package_var_non_secret: {{package_var_non_secret}}
input_var_secret: {{input_var_secret}}
input_var_non_secret: {{input_var_non_secret}}
stream_var_secret: {{stream_var_secret}}
stream_var_non_secret: {{stream_var_non_secret}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: data_stream.type
type: constant_keyword
description: >
Data stream type.
- name: data_stream.dataset
type: constant_keyword
description: >
Data stream dataset.
- name: data_stream.namespace
type: constant_keyword
description: >
Data stream namespace.
- name: '@timestamp'
type: date
description: >
Event timestamp.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
title: Test stream
type: logs
streams:
- input: test_input
title: test input
vars:
- name: stream_var_secret
type: text
title: Stream Var Secret
multi: false
show_user: true
secret: true
- name: stream_var_non_secret
type: text
title: Stream Var Non Secret
multi: false
show_user: true
secret: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# secrets

This package has secrets
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
format_version: 1.0.0
name: secrets
title: Package with secrets
description: This integration package has 3 secret and 3 non secret vars.
version: 1.1.0
categories: []
# Options are experimental, beta, ga
release: beta
# The package type. The options for now are [integration, solution], more type might be added in the future.
# The default type is integration and will be set if empty.
type: integration
license: basic
owner:
github: elastic/fleet

requirement:
elasticsearch:
versions: ">7.7.0"
kibana:
versions: ">7.7.0"

icons:
- src: "/img/logo.svg"
size: "16x16"
type: "image/svg+xml"

vars:
- name: package_var_secret
type: password
title: Package Var Secret
multi: false
required: true
show_user: true
secret: true
- name: package_var_non_secret
type: text
title: Package Var Non Secret
multi: false
required: true
show_user: true
secret: true
policy_templates:
- name: secrets
title: This
description: Test Package for Upgrading Package Policies
inputs:
- type: test_input
title: Test Input
description: Test Input
enabled: true
template_path: input.yml.hbs
vars:
- name: input_var_secret
type: text
title: Input Var Secret
multi: false
show_user: true
secret: true
- name: input_var_non_secret
type: text
title: Input Var Non Secret
multi: false
show_user: true
secret: true
Loading

0 comments on commit e3c1f12

Please sign in to comment.