-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: fusikai <fusikai@douyu.tv>
- Loading branch information
Showing
11 changed files
with
143 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package proxyintegrat | ||
|
||
import ( | ||
"github.com/douyu/juno/internal/pkg/packages/contrib/output" | ||
"github.com/douyu/juno/internal/pkg/service/aliyunlog" | ||
"github.com/douyu/juno/internal/pkg/service/user" | ||
"github.com/labstack/echo/v4" | ||
) | ||
|
||
// TraceUrl 阿里云trace地址获取 | ||
func TraceURL(c echo.Context) (err error) { | ||
u := user.GetUser(c) | ||
toURL := c.QueryParam("toURL") | ||
data, err := aliyunlog.Instance.CompleteTraceSearchUrl(c.Request().Context(), &aliyunlog.CompleteTraceSearchUrlRequest{ | ||
Region: "华北2(北京)", | ||
ToURL: toURL, | ||
}, u) | ||
if err != nil { | ||
return output.JSON(c, output.MsgErr, err.Error()) | ||
} | ||
return output.JSON(c, output.MsgOk, "", map[string]interface{}{"url": data}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,51 @@ | ||
import React from 'react'; | ||
import React, { useState, useEffect } from 'react'; | ||
import { traceURL } from "../services/proxyintegrat" | ||
|
||
export default class Proxy extends React.Component<any, any> { | ||
render() { | ||
const { proxyURL } = this.props; | ||
return ( | ||
<div | ||
export default function (props) { | ||
let [dynamicUrl, updateDynamicUrl] = useState(''); | ||
const { proxyURL, panelType } = props; | ||
//支持动态嵌入页面 | ||
if (panelType == "alitrace") { | ||
useEffect(() => { | ||
traceURL({ toURL: proxyURL }).then((res) => { | ||
if (res.code == 0) { | ||
updateDynamicUrl(res.data && res.data.url); | ||
} | ||
}) | ||
}, []) | ||
return dynamicUrl !== '' ? <div | ||
style={{ | ||
width: '100%', | ||
display: 'flex', | ||
flex: 1, | ||
}} | ||
> | ||
<iframe | ||
src={dynamicUrl} | ||
style={{ | ||
border: 'none', | ||
width: '100%', | ||
display: 'flex', | ||
flex: 1, | ||
}} | ||
> | ||
<iframe | ||
src={proxyURL} | ||
style={{ | ||
border: 'none', | ||
width: '100%', | ||
flex: 1, | ||
}} | ||
/> | ||
</div> | ||
); | ||
/> | ||
</div > : <div>请设置代理页面</div> | ||
} | ||
return ( | ||
<div | ||
style={{ | ||
width: '100%', | ||
display: 'flex', | ||
flex: 1, | ||
}} | ||
> | ||
<iframe | ||
src={proxyURL} | ||
style={{ | ||
border: 'none', | ||
width: '100%', | ||
flex: 1, | ||
}} | ||
/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import request from '@/utils/request'; | ||
import { stringify } from 'qs'; | ||
|
||
export async function uilist() { | ||
return request('/api/admin/proxyintegrat/uilist'); | ||
} | ||
|
||
export async function traceURL(params) { | ||
return request(`/api/admin/proxyintegrat/traceURL?${stringify(params)}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters