|
|
@ -2,9 +2,10 @@ import React, { useEffect, useState, useRef } from 'react'; |
|
|
|
import { connect } from 'react-redux'; |
|
|
|
import { push } from 'react-router-redux'; |
|
|
|
import '../style.less' |
|
|
|
import { Notification, Popconfirm } from "@douyinfe/semi-ui"; |
|
|
|
import { Notification, Popconfirm, Modal } from "@douyinfe/semi-ui"; |
|
|
|
import copy from "copy-to-clipboard"; |
|
|
|
import moment from "moment"; |
|
|
|
import { IconRefresh } from '@douyinfe/semi-icons'; |
|
|
|
|
|
|
|
const Mirroring = (props) => { |
|
|
|
const { history, dispatch, actions, user, loading, StatusPushList } = props; |
|
|
@ -26,6 +27,8 @@ const Mirroring = (props) => { |
|
|
|
]); |
|
|
|
|
|
|
|
const [myCustomList, setMyCustomList] = useState([])//我的自定义镜像服务 |
|
|
|
const [isUpdate, setIsUpate] = useState(false) |
|
|
|
const [updateId, setUpdateId] = useState() |
|
|
|
useEffect(() => { |
|
|
|
getMirror() |
|
|
|
}, []); |
|
|
@ -262,8 +265,13 @@ const Mirroring = (props) => { |
|
|
|
最后发布于:{getTime(item.publishTime)} |
|
|
|
</div> |
|
|
|
<div style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center', marginTop: 12 }}> |
|
|
|
<IconRefresh style={{ color: 'rgb(74 129 205 / 93%)', marginRight: 4 }} onClick={() => { |
|
|
|
setIsUpate(true) |
|
|
|
setUpdateId(item.id) |
|
|
|
}} /> |
|
|
|
<div style={{ display: 'flex', alignItems: 'center', cursor: 'pointer' }} onClick={() => { |
|
|
|
copy(item.mid ? item.mid : "暂无id"); |
|
|
|
const url = document.location?.toString()?.split("/") || [] |
|
|
|
copy(item.mid ? `${url[0] + '//' + url[2] + '/callService?mid=' + item.mid}` : "暂无id"); |
|
|
|
Notification.success({ |
|
|
|
content: "复制成功", |
|
|
|
duration: 2, |
|
|
@ -284,6 +292,32 @@ const Mirroring = (props) => { |
|
|
|
})} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{isUpdate ? <Modal |
|
|
|
title="更新mid" |
|
|
|
visible={true} |
|
|
|
onOk={() => { |
|
|
|
dispatch(openness.putUpdateMid(updateId)).then(res => { |
|
|
|
if (res.success) { |
|
|
|
myCustomList?.forEach(v => { |
|
|
|
if (v.id == updateId) { |
|
|
|
v.mid = res.payload.data?.mid |
|
|
|
} |
|
|
|
}) |
|
|
|
setMyCustomList([...myCustomList]) |
|
|
|
setIsUpate(false) |
|
|
|
setUpdateId('') |
|
|
|
} |
|
|
|
}) |
|
|
|
}} |
|
|
|
onCancel={() => { |
|
|
|
setIsUpate(false) |
|
|
|
setUpdateId('') |
|
|
|
}} |
|
|
|
closeOnEsc={true} |
|
|
|
> |
|
|
|
更新镜像服务的mid后,历史复制的镜像播放地址无效,需复制新的镜像地址。 |
|
|
|
</Modal> : "" |
|
|
|
} |
|
|
|
</> |
|
|
|
) |
|
|
|
} |
|
|
|