全站汉化 + antd zhCN locale
This commit is contained in:
1 parent
2e4594fa77
commit
b96323eb99
9 files changed
+134
-136
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import {
|
||||
Card, Form, Input, Button, DatePicker, Typography, message, Space, Alert, Divider,
|
||||
Card, Form, Input, Button, DatePicker, Typography, message, Space, Alert,
|
||||
} from 'antd'
|
||||
import { CopyOutlined, ArrowLeftOutlined } from '@ant-design/icons'
|
||||
import { createStream } from '../../api/streams'
|
||||
@@ -24,9 +24,9 @@ export default function StreamForm() {
|
||||
scheduled_at: values.scheduled_at?.toISOString(),
|
||||
})
|
||||
setResult({ rtmp_url: res.rtmp_url, stream_key: res.stream_key })
|
||||
message.success('Stream created')
|
||||
message.success('直播已创建')
|
||||
} catch {
|
||||
message.error('Failed to create stream')
|
||||
message.error('创建失败')
|
||||
}
|
||||
setLoading(false)
|
||||
}
|
||||
@@ -34,14 +34,14 @@ export default function StreamForm() {
|
||||
if (result) {
|
||||
return (
|
||||
<div style={{ maxWidth: 640 }}>
|
||||
<Title level={3} style={{ marginBottom: 24 }}>Stream Created</Title>
|
||||
<Title level={3} style={{ marginBottom: 24 }}>直播已创建</Title>
|
||||
<Alert
|
||||
type="success"
|
||||
message="Your stream is ready"
|
||||
message="推流信息已生成"
|
||||
description={
|
||||
<Space direction="vertical" size="middle" style={{ width: '100%' }}>
|
||||
<div>
|
||||
<Text strong>Stream Key (UUID):</Text>
|
||||
<Text strong>推流码 (UUID):</Text>
|
||||
<div style={{
|
||||
marginTop: 8, padding: 12,
|
||||
background: '#F5F2EE', borderRadius: 6,
|
||||
@@ -52,7 +52,7 @@ export default function StreamForm() {
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Text strong>RTMP Push URL:</Text>
|
||||
<Text strong>RTMP 推流地址:</Text>
|
||||
<div style={{
|
||||
marginTop: 8, padding: 12,
|
||||
background: '#F5F2EE', borderRadius: 6,
|
||||
@@ -72,15 +72,15 @@ export default function StreamForm() {
|
||||
icon={<CopyOutlined />}
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(
|
||||
`Stream Key: ${result.stream_key}\nRTMP URL: ${result.rtmp_url}`
|
||||
`推流码: ${result.stream_key}\nRTMP 地址: ${result.rtmp_url}`
|
||||
)
|
||||
message.success('Copied to clipboard')
|
||||
message.success('已复制到剪贴板')
|
||||
}}
|
||||
>
|
||||
Copy All
|
||||
复制全部
|
||||
</Button>
|
||||
<Button type="primary" onClick={() => navigate('/admin/streams')}>
|
||||
Back to Streams
|
||||
返回列表
|
||||
</Button>
|
||||
</Space>
|
||||
</div>
|
||||
@@ -95,30 +95,30 @@ export default function StreamForm() {
|
||||
onClick={() => navigate('/admin/streams')}
|
||||
style={{ marginBottom: 16 }}
|
||||
>
|
||||
Back
|
||||
返回
|
||||
</Button>
|
||||
<Card>
|
||||
<Title level={3} style={{ marginBottom: 24 }}>New Stream</Title>
|
||||
<Title level={3} style={{ marginBottom: 24 }}>创建直播</Title>
|
||||
<Form layout="vertical" onFinish={handleSubmit}>
|
||||
<Form.Item
|
||||
name="title"
|
||||
label="Title"
|
||||
rules={[{ required: true, message: 'Enter a title' }]}
|
||||
label="直播标题"
|
||||
rules={[{ required: true, message: '请输入直播标题' }]}
|
||||
>
|
||||
<Input placeholder="Stream title" size="large" />
|
||||
<Input placeholder="输入直播标题" size="large" />
|
||||
</Form.Item>
|
||||
<Form.Item name="description" label="Description">
|
||||
<TextArea rows={3} placeholder="Stream description (optional)" />
|
||||
<Form.Item name="description" label="直播简介">
|
||||
<TextArea rows={3} placeholder="可选,直播内容简介" />
|
||||
</Form.Item>
|
||||
<Form.Item name="cover_url" label="Cover Image URL">
|
||||
<Form.Item name="cover_url" label="封面图片地址">
|
||||
<Input placeholder="https://..." />
|
||||
</Form.Item>
|
||||
<Form.Item name="scheduled_at" label="Scheduled Time">
|
||||
<DatePicker showTime style={{ width: '100%' }} size="large" />
|
||||
<Form.Item name="scheduled_at" label="预定开播时间">
|
||||
<DatePicker showTime style={{ width: '100%' }} size="large" placeholder="选择预定时间" />
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit" loading={loading} size="large" block>
|
||||
Create Stream
|
||||
创建直播
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
||||
Reference in new issue
Block a user