Merge branch '宫格模式' of https://gitea.23544.com/marking/WGShare.Client.Electron into 视频监控
This commit is contained in:
commit
9e6a862d49
|
|
@ -6,6 +6,7 @@
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self'">
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self'">
|
||||||
|
<meta name="build-time" content="<%- buildTime%>" id="build-time">
|
||||||
<!-- <meta http-equiv="Content-Security-Policy"
|
<!-- <meta http-equiv="Content-Security-Policy"
|
||||||
content="script-src 'self' https://www.google-analytics.com; style-src 'self' https://animate.style"> -->
|
content="script-src 'self' https://www.google-analytics.com; style-src 'self' https://animate.style"> -->
|
||||||
<title></title>
|
<title></title>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -53,6 +53,7 @@
|
||||||
"electron-builder": "^23.1.0",
|
"electron-builder": "^23.1.0",
|
||||||
"typescript": "^4.5.4",
|
"typescript": "^4.5.4",
|
||||||
"vite": "^2.8.0",
|
"vite": "^2.8.0",
|
||||||
|
"vite-plugin-html": "^3.2.2",
|
||||||
"vite-plugin-resolve": "^2.5.1"
|
"vite-plugin-resolve": "^2.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@
|
||||||
|
|
||||||
>div:nth-child(1) {
|
>div:nth-child(1) {
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
font-size: 16px;
|
font-size: 14px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ const Home: React.FC = () => {
|
||||||
]);
|
]);
|
||||||
const [userInfo, setUserInfo] = useState<any>({})
|
const [userInfo, setUserInfo] = useState<any>({})
|
||||||
const [version, setVersion] = useState<string>('')
|
const [version, setVersion] = useState<string>('')
|
||||||
|
const [buildTime, setBuildTime] = useState<string>('0')
|
||||||
const [update, setUpdate] = useState(false)
|
const [update, setUpdate] = useState(false)
|
||||||
const [dateInfo, setDateInfo] = useState<{
|
const [dateInfo, setDateInfo] = useState<{
|
||||||
work: string;
|
work: string;
|
||||||
|
|
@ -60,6 +61,13 @@ const Home: React.FC = () => {
|
||||||
window.electron.getVersion().then(res => {
|
window.electron.getVersion().then(res => {
|
||||||
setVersion(res)
|
setVersion(res)
|
||||||
})
|
})
|
||||||
|
try {
|
||||||
|
const buildStr = document.getElementById('build-time')?.getAttribute('content');
|
||||||
|
const formattedTime = dayjs(Number(buildStr)).format('YYYYMMDDHHmm');
|
||||||
|
setBuildTime(formattedTime)
|
||||||
|
} catch {
|
||||||
|
|
||||||
|
}
|
||||||
const updateTime = () => {
|
const updateTime = () => {
|
||||||
setDateInfo({
|
setDateInfo({
|
||||||
work: dayjs().format('ddd'),
|
work: dayjs().format('ddd'),
|
||||||
|
|
@ -136,7 +144,9 @@ const Home: React.FC = () => {
|
||||||
</div>
|
</div>
|
||||||
<div className='drag'>
|
<div className='drag'>
|
||||||
<div>
|
<div>
|
||||||
<span>版本号:{version}</span>
|
<span>V{version}-
|
||||||
|
<span style={{ fontSize: '12px', color: 'gray' }}>{buildTime}</span>
|
||||||
|
</span>
|
||||||
{update ? <span>new</span> : null}
|
{update ? <span>new</span> : null}
|
||||||
</div>
|
</div>
|
||||||
{update ? <div>
|
{update ? <div>
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 16px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import { v4 as uuidv4 } from 'uuid';
|
||||||
import { GetCheckoutRoomNum, GetRoomInfo, GetRoomRtcToken } from '@/api/Home/Index';
|
import { GetCheckoutRoomNum, GetRoomInfo, GetRoomRtcToken } from '@/api/Home/Index';
|
||||||
import { ExclamationCircleFilled } from '@ant-design/icons';
|
import { ExclamationCircleFilled } from '@ant-design/icons';
|
||||||
import { isVersion } from '@/utils/package/public';
|
import { isVersion } from '@/utils/package/public';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
const { confirm } = Modal;
|
const { confirm } = Modal;
|
||||||
const Login: React.FC = () => {
|
const Login: React.FC = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
@ -39,6 +40,7 @@ const Login: React.FC = () => {
|
||||||
nickName: '',
|
nickName: '',
|
||||||
roomNum: '',
|
roomNum: '',
|
||||||
})
|
})
|
||||||
|
const [buildTime, setBuildTime] = useState<string>('0')
|
||||||
const [nameModal, setNameModal] = useState(false)
|
const [nameModal, setNameModal] = useState(false)
|
||||||
const [env, setEnv] = useState('')
|
const [env, setEnv] = useState('')
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -50,6 +52,13 @@ const Login: React.FC = () => {
|
||||||
window.electron.getEnv().then(res => {
|
window.electron.getEnv().then(res => {
|
||||||
setEnv(res)
|
setEnv(res)
|
||||||
})
|
})
|
||||||
|
try {
|
||||||
|
const buildStr = document.getElementById('build-time')?.getAttribute('content');
|
||||||
|
const formattedTime = dayjs(Number(buildStr)).format('YYYYMMDDHHmm');
|
||||||
|
setBuildTime(formattedTime)
|
||||||
|
} catch {
|
||||||
|
|
||||||
|
}
|
||||||
if (storage.getItem('login')) {
|
if (storage.getItem('login')) {
|
||||||
const login = JSON.parse(storage.getItem('login') as string);
|
const login = JSON.parse(storage.getItem('login') as string);
|
||||||
const data = {
|
const data = {
|
||||||
|
|
@ -319,7 +328,8 @@ const Login: React.FC = () => {
|
||||||
><img src={ImageUrl.icon3} alt="" /></div>
|
><img src={ImageUrl.icon3} alt="" /></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
版本号:{version}
|
V{version}-
|
||||||
|
<span style={{ fontSize: '12px', color: 'gray' }}>{buildTime}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import react from '@vitejs/plugin-react'
|
||||||
import pxtovw from 'postcss-px-to-viewport-8-plugin'
|
import pxtovw from 'postcss-px-to-viewport-8-plugin'
|
||||||
import { resolve as resolvePath } from 'path'
|
import { resolve as resolvePath } from 'path'
|
||||||
import resolve from 'vite-plugin-resolve';
|
import resolve from 'vite-plugin-resolve';
|
||||||
|
import { createHtmlPlugin } from 'vite-plugin-html';
|
||||||
const loder_pxtovw = pxtovw({
|
const loder_pxtovw = pxtovw({
|
||||||
viewportWidth: 1900,
|
viewportWidth: 1900,
|
||||||
viewportUnit: 'vw',
|
viewportUnit: 'vw',
|
||||||
|
|
@ -51,6 +52,20 @@ export default defineConfig({
|
||||||
base: './', // 这里更改打包相对绝对路径
|
base: './', // 这里更改打包相对绝对路径
|
||||||
plugins: [
|
plugins: [
|
||||||
react(),
|
react(),
|
||||||
|
createHtmlPlugin({
|
||||||
|
minify: false,
|
||||||
|
pages: [
|
||||||
|
{
|
||||||
|
template: 'index.html',
|
||||||
|
filename: 'index.html',
|
||||||
|
injectOptions: {
|
||||||
|
data: {
|
||||||
|
buildTime: +new Date()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}),
|
||||||
resolve({
|
resolve({
|
||||||
'agora-electron-sdk': `
|
'agora-electron-sdk': `
|
||||||
const {
|
const {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue