Skip to content

Commit 43c24d5

Browse files
author
viet salt
committed
ready to deploy
1 parent 1822a77 commit 43c24d5

File tree

18 files changed

+14776
-664
lines changed

18 files changed

+14776
-664
lines changed

client/admin/axios/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ axios.defaults.baseURL = '/api';
1111
const errorHandler = (error) => {
1212
const { response = {}, code, message: msg } = error;
1313
if (code === 'ECONNABORTED' || msg.includes('timeout')) {
14-
message.error('网络超时');
14+
message.error('Hết thời gian kết nối');
1515
return Promise.reject(error);
1616
}
1717
const { status } = response;
1818
switch (status) {
1919
case 401:
2020
// Trả về 401 để xóa thông tin mã thông báo và nhảy vào trang đăng nhập
2121
localStorage.removeItem(config.tokenKey);
22-
// Router.push('/admin/login');
22+
Router.push('/admin/login');
2323
return Promise.reject(error);
2424
case 403:
2525
// Trả về 401 để xóa thông tin mã thông báo và nhảy vào trang đăng nhập
@@ -41,7 +41,7 @@ axios.interceptors.request.use(
4141
const token = localStorage.getItem(tokenKey);
4242
if (!(c.url && (c.url.includes('getFirstLoginInfo') || c.url.includes('login')))) {
4343
if (!token) {
44-
// Router.push('/admin/login');
44+
Router.push('/admin/login');
4545
}
4646
}
4747
c.headers.authorization = token || '';

client/admin/components/EditableInput/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default function Index(props: Props) {
7070
setDisabled(!disabled);
7171
}}
7272
>
73-
<EditOutlined></EditOutlined>编辑
73+
<EditOutlined></EditOutlined>Chỉnh sửa
7474
</Button>
7575
)}
7676
</label>
@@ -87,7 +87,7 @@ export default function Index(props: Props) {
8787
{!disabled && (
8888
<Form.Item className="footer">
8989
<Button type="primary" htmlType="submit" loading={loading}>
90-
<SendOutlined></SendOutlined>保存
90+
<SendOutlined></SendOutlined>Giữ cho
9191
</Button>
9292
<Button
9393
type="default"
@@ -97,7 +97,7 @@ export default function Index(props: Props) {
9797
form.setFieldsValue({ [name]: value });
9898
}}
9999
>
100-
取消
100+
Hủy bỏ
101101
</Button>
102102
</Form.Item>
103103
)}

client/admin/hooks/useImageUpload.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import { isEqual } from 'lodash';
77
function svgBeforeUpload(file) {
88
const isSvg = file.type === 'image/svg+xml';
99
if (!isSvg) {
10-
message.error('只能上传svg文件!');
10+
message.error('Chỉ có thể tải lên các tệp SVG!');
1111
}
1212
const isLt100K = file.size / 1024 < 100;
1313
if (!isLt100K) {
14-
message.error('svg最大只能上传100K!');
14+
message.error('SVG chỉ có thể tải lên 100k!');
1515
}
1616
return isSvg && isLt100K;
1717
}
@@ -23,11 +23,11 @@ function beforeUpload(file) {
2323
file.type === 'image/png' ||
2424
file.type === 'image/svg+xml';
2525
if (!isJpgOrPng) {
26-
message.error('只能上传jpg或者png图片!');
26+
message.error('Chỉ có thể tải lên hình ảnh JPG hoặc PNG!');
2727
}
2828
const isLt10M = file.size / 1024 / 1024 < 10;
2929
if (!isLt10M) {
30-
message.error('图片最大只能上传10MB!');
30+
message.error('Hình ảnh tối đa chỉ có thể tải lên 10MB!');
3131
}
3232
return isJpgOrPng && isLt10M;
3333
}

client/admin/pages/ArticleEdit/index.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ export default function Index() {
7070
const { id } = router.query;
7171
const content = editor.getMarkdown();
7272
if (!isLength(content, { min: 1, max: 15000 })) {
73-
return message.error('文章详情不能为空,且最多15000个字符!');
73+
return message.error('Chi tiết bài viết không thể trống và tối đa 15.000 ký tự!');
7474
}
7575
Object.assign(data, {
7676
content,
7777
screenshot: data?.screenshot[0].url,
7878
});
7979
const p = id ? updateArticle(id, data) : createArticle(data);
8080
p.then(() => {
81-
message.success('提交成功 !');
81+
message.success('gửi thành công !');
8282
Router.push('/admin/content/articles');
8383
});
8484
};
@@ -132,7 +132,13 @@ export default function Index() {
132132
<Form.Item
133133
name="title"
134134
style={{ maxWidth: '700px', width: '100%', margin: '0 auto' }}
135-
rules={[{ required: true, message: 'Tiêu đề không thể trống! Và nhiều nhất 160 ký tự!', max: 160 }]}
135+
rules={[
136+
{
137+
required: true,
138+
message: 'Tiêu đề không thể trống! Và nhiều nhất 160 ký tự!',
139+
max: 160,
140+
},
141+
]}
136142
>
137143
<TextArea placeholder="Vui lòng nhập tiêu đề" rows={1} style={{ textAlign: 'center' }} />
138144
</Form.Item>

client/admin/pages/Articles/index.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ export default function Index() {
103103
>
104104
Chỉnh sửa
105105
</Button>
106-
<Popconfirm title="Xác nhận rằng bạn muốn xóa?" onConfirm={() => deleteArticle(record._id)}>
106+
<Popconfirm
107+
title="Xác nhận rằng bạn muốn xóa?"
108+
onConfirm={() => deleteArticle(record._id)}
109+
>
107110
<Button danger type="link" size="small" title="Xóa bỏ" icon={<DeleteFilled />}>
108111
Xóa
109112
</Button>
@@ -133,7 +136,11 @@ export default function Index() {
133136
title: 'Trạng thái',
134137
dataIndex: 'isDraft',
135138
render: (text, record) =>
136-
record.isDraft ? <Tag color="rgb(229, 239, 245);">Dự thảo</Tag> : <Tag color="default">Được phát hành</Tag>,
139+
record.isDraft ? (
140+
<Tag color="rgb(229, 239, 245);">Dự thảo</Tag>
141+
) : (
142+
<Tag color="default">Được phát hành</Tag>
143+
),
137144
},
138145
{
139146
title: 'Thời điểm tạo',
@@ -175,7 +182,7 @@ export default function Index() {
175182
icon={<PlusOutlined />}
176183
onClick={() => Router.push('/admin/content/articles/edit')}
177184
>
178-
Thêm một tài liệu
185+
Thêm bài viết
179186
</Button>
180187
<Popconfirm
181188
title="Xác nhận rằng bạn muốn xóa?"
@@ -232,7 +239,7 @@ export default function Index() {
232239
}));
233240
}}
234241
>
235-
nhập lại
242+
Nhập lại
236243
</Button>
237244
</Space>
238245
</Row>

client/admin/pages/Categories/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default function Index() {
7676
dataIndex: 'articleCount',
7777
},
7878
{
79-
title: 'vận hành',
79+
title: 'Hành động',
8080
key: 'operation',
8181
width: 180,
8282
render: (text, record) => (
@@ -90,7 +90,7 @@ export default function Index() {
9090
>
9191
Chỉnh sửa
9292
</Button>
93-
93+
9494
<Popconfirm title="Xác nhận rằng bạn muốn xóa?" onConfirm={() => deleteCategory(record._id)}>
9595
<Button danger={true} size="small" title="Xóa" icon={<DeleteFilled />}>
9696
Xóa

client/admin/pages/CommentReply/index.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default function Index() {
4040
Object.assign(data, { parentId: id });
4141
}
4242
axios.post('/admin/reply-comment/', data).then(() => {
43-
message.success('提交成功');
43+
message.success('gửi thành công');
4444
Router.push('/admin/content/comments');
4545
});
4646
};
@@ -52,42 +52,42 @@ export default function Index() {
5252
<Form.Item name="article" style={{ display: 'none' }}>
5353
<Input type="text" />
5454
</Form.Item>
55-
<Form.Item labelCol={{ span: 3 }} wrapperCol={{ span: 10 }} label="昵称:">
55+
<Form.Item labelCol={{ span: 3 }} wrapperCol={{ span: 10 }} label="Tên:">
5656
<span className="ant-form-text">{comment.nickName}</span>
5757
</Form.Item>
58-
<Form.Item labelCol={{ span: 3 }} wrapperCol={{ span: 10 }} label="email:">
58+
<Form.Item labelCol={{ span: 3 }} wrapperCol={{ span: 10 }} label="Email:">
5959
<span className="ant-form-text">{comment.email}</span>
6060
</Form.Item>
61-
<Form.Item labelCol={{ span: 3 }} wrapperCol={{ span: 10 }} label="创建时间:">
61+
<Form.Item labelCol={{ span: 3 }} wrapperCol={{ span: 10 }} label="Thời điểm tạo:">
6262
<span className="ant-form-text">{parseTime(comment.createdAt)}</span>
6363
</Form.Item>
64-
<Form.Item labelCol={{ span: 3 }} wrapperCol={{ span: 10 }} label="文章标题:">
64+
<Form.Item labelCol={{ span: 3 }} wrapperCol={{ span: 10 }} label="Tiêu đề:">
6565
<span className="ant-form-text">{comment.article && comment.article.title}</span>
6666
</Form.Item>
67-
<Form.Item labelCol={{ span: 3 }} wrapperCol={{ span: 10 }} label="内容:">
67+
<Form.Item labelCol={{ span: 3 }} wrapperCol={{ span: 10 }} label="Nội dung:">
6868
<span className="ant-form-text" dangerouslySetInnerHTML={{ __html: comment.content }}></span>
6969
</Form.Item>
7070
<Form.Item
7171
name="content"
7272
labelCol={{ span: 3 }}
7373
wrapperCol={{ span: 10 }}
74-
label="回复内容:"
74+
label="Nội dung trả lời:"
7575
rules={[
7676
{
7777
required: true,
78-
message: '回复内容不能为空!',
78+
message: 'Nội dung trả lời không thể trống!',
7979
min: 1,
8080
},
8181
]}
8282
>
8383
<Input.TextArea
84-
placeholder="请输入回复内容"
84+
placeholder="Vui lòng nhập nội dung trả lời"
8585
autoSize={{ minRows: 2, maxRows: 6 }}
8686
></Input.TextArea>
8787
</Form.Item>
88-
<Form.Item labelCol={{ span: 3 }} wrapperCol={{ span: 10 }} label="操作:">
88+
<Form.Item labelCol={{ span: 3 }} wrapperCol={{ span: 10 }} label="vận hành:">
8989
<Button type="primary" htmlType="submit">
90-
提交
90+
Gửi
9191
</Button>
9292
</Form.Item>
9393
</Form>

client/admin/pages/Comments/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ export default function Comments() {
8585
const getTableColums = () => {
8686
return [
8787
{
88-
title: 'Tên nick',
88+
title: 'Tên ',
8989
dataIndex: 'nickName',
9090
width: 160,
9191
},
9292
{
93-
title: 'email',
93+
title: 'Email',
9494
dataIndex: 'email',
9595
width: 100,
9696
},
@@ -114,15 +114,15 @@ export default function Comments() {
114114
<Button
115115
type="primary"
116116
size="small"
117-
title="编辑"
117+
title="chỉnh sửa"
118118
icon={<EditFilled />}
119119
onClick={() => Router.push('/admin/content/comments/reply/' + record._id)}
120120
>
121121
Phản hồi
122122
</Button>
123123
,
124124
<Popconfirm title="Xác nhận rằng bạn muốn xóa?" onConfirm={() => deleteComment(record._id)}>
125-
<Button danger={true} size="small" title="xóa bỏ" icon={<DeleteFilled />}>
125+
<Button danger={true} size="small" title="Xóa bỏ" icon={<DeleteFilled />}>
126126
Xóa
127127
</Button>
128128
</Popconfirm>

client/admin/pages/Dashboard/LoginLogPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface Props {
1010
export default function LoginLogPanel(props: Props) {
1111
const { recentAdminLogs = [], loading = false } = props;
1212
return (
13-
<Card style={{ marginBottom: 14 }} bordered={false} title="操作日志" loading={loading}>
13+
<Card style={{ marginBottom: 14 }} bordered={false} title="Nhật ký hoạt động" loading={loading}>
1414
<div>
1515
{recentAdminLogs.map((item: any) => (
1616
<List.Item key={item._id} style={{ borderBottom: '1px solid #ccc' }}>

client/admin/pages/Dashboard/NavPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function NavPanel(props: Props) {
1313
<Card
1414
loading={loading}
1515
style={{ marginBottom: 24 }}
16-
title="便捷导航"
16+
title="Điều hướng thuận tiện"
1717
bordered={false}
1818
bodyStyle={{ padding: 0 }}
1919
>

0 commit comments

Comments
 (0)