Skip to content

Commit 24f3979

Browse files
committed
update url
1 parent f2c8dc7 commit 24f3979

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

site/edit/en-US.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module.exports = {
3030
'app.header.publish-cloud.success': 'Publish Succeeded',
3131
'app.header.publish-cloud.successRemarks': 'Your website has been publish succeeded, URL:',
3232
'app.header.publish-cloud.error': 'Publish Error!!!',
33+
'app.header.publish-cloud.currentURL': 'If the publication is successful, visit the URL: ',
3334
'app.header.edit-data': 'Edit data',
3435
'app.header.edit-data.header': 'Current edit data',
3536
'app.header.edit-data.remarks': 'Paste the downloaded JSON here, please don\'t change the data. Please refresh if the data is wrong.',

site/edit/template/components/PublishModal.jsx

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import PropTypes from 'prop-types';
23
import { Icon, Button, Form, Modal, Input, Tooltip, message, notification } from 'antd';
34
import { FormattedMessage } from 'react-intl';
45
import ticker from 'rc-tween-one/lib/ticker';
@@ -50,11 +51,15 @@ class PublishModal extends React.Component {
5051
<p key="0"><FormattedMessage id="app.header.publish-cloud.build" /></p>,
5152
<p key="1">
5253
<FormattedMessage id="app.header.publish-cloud.state" />
53-
{' BUILDING'}
54+
{' FORMAT'}
5455
</p>,
5556
],
5657
};
5758

59+
static contextTypes = {
60+
intl: PropTypes.object.isRequired,
61+
};
62+
5863
componentDidMount() {
5964
// 监听有没有在发布
6065
const { templateData } = this.props;
@@ -102,7 +107,9 @@ class PublishModal extends React.Component {
102107

103108
onMonitorPublishState = (id) => {
104109
const { explain } = this.state;
110+
const { templateData } = this.props;
105111
ticker.clear(this.getPublishState);
112+
const currentUrl = `${templateData.uid}.antdlanding.now.sh`;
106113
this.getPublishState = ticker.interval(() => {
107114
fetch(`${nowURL}api/deploy/${id}`, {
108115
method: 'GET',
@@ -116,12 +123,12 @@ class PublishModal extends React.Component {
116123
switch (item.readyState) {
117124
case 'READY':
118125
notification.open({
119-
message: <FormattedMessage id="app.header.publish-cloud.success" />,
126+
message: this.context.intl.formatMessage({ id: 'app.header.publish-cloud.success' }),
120127
description: (
121128
<p>
122-
<FormattedMessage id="app.header.publish-cloud.successRemarks" />
123-
<a href={`https://${url}`} target="_blank">
124-
{url}
129+
{this.context.intl.formatMessage({ id: 'app.header.publish-cloud.successRemarks' })}
130+
<a href={`https://${currentUrl}`} target="_blank">
131+
{currentUrl}
125132
</a>
126133
</p>
127134
),
@@ -130,7 +137,7 @@ class PublishModal extends React.Component {
130137
this.publishEnd();
131138
break;
132139
case 'ERROR':
133-
message.error(<FormattedMessage id="app.header.publish-cloud.error" />);
140+
message.error(this.context.intl.formatMessage({ id: 'pp.header.publish-cloud.error' }));
134141
this.publishEnd();
135142
break;
136143
default:
@@ -198,6 +205,7 @@ class PublishModal extends React.Component {
198205
const { isLoad, explain } = this.state;
199206
const locale = isZhCN(location.pathname) ? 'zh-CN' : 'en-US';
200207
const page = templateData.data.page || {};
208+
const url = `${templateData.uid}.antdlanding.now.sh`;
201209
return (
202210
<Modal
203211
{...props}
@@ -238,7 +246,6 @@ class PublishModal extends React.Component {
238246
<h3 style={{ marginTop: 16 }}>
239247
<FormattedMessage id="app.header.publish-cloud.meta" />
240248
</h3>
241-
<p />
242249
<Form onSubmit={this.onClick} className="modal-form">
243250
<Item label="Title">
244251
{getFieldDecorator('title', {
@@ -268,8 +275,15 @@ class PublishModal extends React.Component {
268275
<Button disabled={isLoad} type="primary" icon={isLoad ? 'loading' : 'cloud-upload'} htmlType="submit">
269276
<FormattedMessage id="app.header.publish-cloud.button" />
270277
</Button>
278+
271279
</Item>
272280
</Form>
281+
<p style={{ lineHeight: 2, fontSize: 14, marginTop: 8 }}>
282+
<FormattedMessage id="app.header.publish-cloud.currentURL" />
283+
<a href={`https://${url}`} target="_blank">
284+
{url}
285+
</a>
286+
</p>
273287
</>
274288
)}
275289
</Modal>

site/edit/zh-CN.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module.exports = {
3030
'app.header.publish-cloud.success': '发布成功',
3131
'app.header.publish-cloud.successRemarks': '你的网站已发布成功,URL地址:',
3232
'app.header.publish-cloud.error': '发布失败!!!',
33+
'app.header.publish-cloud.currentURL': '如果发布成功,请访问 URL: ',
3334
'app.header.edit-data': '编辑数据',
3435
'app.header.edit-data.header': '当前编辑数据',
3536
'app.header.edit-data.remarks': '将下载的 JSON 粘贴到此处,请不要随便改更数据。如果数据出错请刷新。',

0 commit comments

Comments
 (0)