Skip to content

Commit

Permalink
[feature] ai, complete answer jump url
Browse files Browse the repository at this point in the history
**Phenomenon and reproduction steps**

none

**Root cause and solution**

none

**Impactions**

none

**Test method**

none

**Affected branch(es)**

- main

**Checklist**

- [ ] Dependencies update required
- [ ] Common bug (similar problem in other repo)
  • Loading branch information
twou12031 committed Apr 10, 2024
1 parent c3c7c0f commit cd33d35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions deepflow-apptracing-panel/src/components/AskGPT.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ export const AskGPT: React.FC<Props> = ({ data }) => {

return data
.map((d: any, i: number) => {
const { node_type } = d
if (node_type?.toLocaleLowerCase() === 'pod') {
const { node_type, name: podName } = d
if (node_type?.toLocaleLowerCase() === 'pod' && podName) {
const prefix = window.location.href.split('/d')[0]
const href = `${prefix}/d/Application_K8s_Pod/application-k8s-pod?orgId=1`
const href = `${prefix}/d/Application_K8s_Pod/application-k8s-pod?orgId=1&var-pod=${podName}`
return `<a style="margin: 10px 0; text-decoration: underline; color: #6e9fff; display: block;" href="${href}" target="_blank">进一步查看 ${d.name} (pod)</a>`
} else {
return `<pre style="margin: 10px 0;">${Object.keys(d)
Expand Down
7 changes: 3 additions & 4 deletions deepflow-topo-panel/src/components/AskGPT.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ export const AskGPT: React.FC<Props> = ({ data }) => {

return data
.map((d: any, i: number) => {
const { node_type } = d
if (node_type?.toLocaleLowerCase() === 'pod') {
const { node_type, name: podName } = d
if (node_type?.toLocaleLowerCase() === 'pod' && podName) {
const prefix = window.location.href.split('/d')[0]
const href = `${prefix}/d/Application_K8s_Pod/application-k8s-pod?orgId=1`
const href = `${prefix}/d/Application_K8s_Pod/application-k8s-pod?orgId=1&var-pod=${podName}`
return `<a style="margin: 10px 0; text-decoration: underline; color: #6e9fff; display: block;" href="${href}" target="_blank">进一步查看 ${d.name} (pod)</a>`
} else {
return `<pre style="margin: 10px 0;">${Object.keys(d)
Expand Down Expand Up @@ -263,7 +263,6 @@ export const AskGPT: React.FC<Props> = ({ data }) => {
setCheckedAiEngine(list.filter(e => !e.disabled)?.[0].value || '')
} catch (error: any) {
setErrorMsg(`GET ENGINES FAILED: ${error.message}`)

setTimeout(() => {
setErrorMsg('')
}, 800)
Expand Down

0 comments on commit cd33d35

Please sign in to comment.