Skip to content

Commit 43e1946

Browse files
committed
Merge branch 'dashboard' of github.com:Coding/WebIDE-Frontend into dashboard
2 parents 5859a61 + 054c6ae commit 43e1946

File tree

10 files changed

+395
-81
lines changed

10 files changed

+395
-81
lines changed

app/changelog.html

Lines changed: 149 additions & 44 deletions
Large diffs are not rendered by default.

app/components/Plugins/component.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const PluginArea = observer(({ position = '', childProps = {}, children, getChil
1414
// 如果侧边栏插件的数量超过 5 条,则只显示图标
1515
if (pluginsArray.filter(plugin => plugin.position === SIDEBAR.RIGHT).length > 5) {
1616
pluginsArray.map(plugin => {
17-
console.log(plugin.label)
1817
if (plugin.position === SIDEBAR.RIGHT && plugin.label && typeof plugin.label === 'object') {
1918
plugin.label.onlyIcon = true;
2019
}

app/dashboard/api/global.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ export const markReaded = (data) => {
1111
export const getMessage = () => {
1212
return axios.get('/workspaces/message?page=1&pageSize=10');
1313
}
14+
15+
export const renameGlobalKey = (data) => {
16+
return axios.post('/user/modify-new-global-key', data);
17+
}

app/dashboard/i18n/en_US/global.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"deleting": "Deleting",
4444
"repoUrl": "Repo Url",
4545
"recentdeleted": "Recently Deleted",
46-
"inputTip": "A minimum of two characters, only letters, numbers, or underscores (_), underscores (-), dots (.)",
46+
"inputTip": "Only letters, numbers, or underscores (_), underscores (-), dots (.)",
4747
"sync": "Sync",
4848
"syncing": "Syncing",
4949
"nodata": "No Data",
@@ -72,10 +72,12 @@
7272
"quit": "Quit",
7373
"quiting": "Quiting",
7474
"period": ".",
75-
"globalTip1": "The system has detected that your username has not been modified.",
76-
"globalTip2": "Please go to [ Tencent Cloud Dev Platform > Personal Settings ] and then log in again.",
77-
"gotoModify": "Go to edit",
75+
"globalTip": "You have not set a username yet. Please set a username first, which will be your unique identifier on this platform.",
76+
"submitting": "Submitting...",
7877
"eventStreamBulletin1": "Dear developer, due to ",
7978
"eventStreamBulletin2": "[ event-stream package event ]",
80-
"eventStreamBulletin3": " Impact, your plugin needs to manually delete the `yarn.lock` file and reinstall the dependencies, then push the code to release a new version or pre-release."
79+
"eventStreamBulletin3": " Impact, your plugin needs to manually delete the `yarn.lock` file and reinstall the dependencies, then push the code to release a new version or pre-release.",
80+
"globalTip1": "The system has detected that your username has not been modified.",
81+
"globalTip2": "Please go to [ Tencent Cloud Dev Platform > Personal Settings ] and then log in again.",
82+
"gotoModify": "Go to edit"
8183
}

app/dashboard/i18n/zh_CN/global.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"deleting": "删除中",
4444
"repoUrl": "仓库地址",
4545
"recentdeleted": "最近删除",
46-
"inputTip": "最少两个字符,仅支持字母、数字或者下划线(_)、中划线(-)、点(.)",
46+
"inputTip": "仅支持字母、数字或者下划线(_)、中划线(-)、点(.)",
4747
"sync": "同步",
4848
"syncing": "同步中",
4949
"nodata": "暂无数据",
@@ -72,10 +72,12 @@
7272
"quit": "退出",
7373
"quiting": "退出中",
7474
"period": "",
75-
"globalTip1": "系统检测到您的用户名尚未修改。",
76-
"globalTip2": "请先进入 [ 腾讯云开发者平台 > 个人设置 ] 修改后再重新登录使用。",
77-
"gotoModify": "前往修改",
75+
"globalTip": "您还没有设置用户名,请先设置用户名,该用户名将作为您在该平台上的唯一标识。",
76+
"submitting": "提交中...",
7877
"eventStreamBulletin1": "尊敬的开发者,由于受 ",
7978
"eventStreamBulletin2": "[ event-stream 包事件 ]",
80-
"eventStreamBulletin3": " 影响,您的插件需要手动删除 `yarn.lock` 文件并重新安装依赖,再推送代码发布新版本或预发布。"
79+
"eventStreamBulletin3": " 影响,您的插件需要手动删除 `yarn.lock` 文件并重新安装依赖,再推送代码发布新版本或预发布。",
80+
"globalTip1": "系统检测到您的用户名尚未修改。",
81+
"globalTip2": "请先进入 [ 腾讯云开发者平台 > 个人设置 ] 修改后再重新登录使用。",
82+
"gotoModify": "前往修改"
8183
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import React, { Component } from 'react';
2+
3+
import './mask.css';
4+
5+
import Inbox from '../../../share/inbox';
6+
7+
import api from '../../../api';
8+
import i18n from '../../../utils/i18n';
9+
10+
class Mask extends Component {
11+
state = {
12+
loading: false,
13+
value: '',
14+
error: '',
15+
}
16+
17+
render() {
18+
const { loading, value, error } = this.state;
19+
return (
20+
<div className="dash-global-mask">
21+
<div className="panel">
22+
<div className="line">{i18n('global.globalTip')}</div>
23+
<Inbox holder="global.inputTip" value={value} onChange={this.handleChange} />
24+
<div className={`error${error ? ' on' : ''}`}>{error}</div>
25+
{!loading ? (
26+
<button className="com-button primary" onClick={this.handleSubmit}>{i18n('global.ok')}</button>
27+
) : <button className="com-button primary">{i18n('global.submitting')}</button>}
28+
</div>
29+
</div>
30+
);
31+
}
32+
33+
handleChange = (event) => {
34+
this.setState({ value: event.target.value });
35+
}
36+
37+
handleSubmit = () => {
38+
const { value } = this.state;
39+
this.setState({ loading: true });
40+
api.renameGlobalKey({ newGlobalKey: value }).then(res => {
41+
this.setState({ loading: false });
42+
if (res.code === 0) {
43+
window.reload();
44+
} else {
45+
this.setState({ error: res.msg });
46+
}
47+
});
48+
}
49+
}
50+
51+
export default Mask;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Mask from './Mask';
2+
3+
export default Mask;
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.dash-global-mask {
2+
width: 100%;
3+
height: 100%;
4+
background-color: #000;
5+
position: fixed;
6+
top: 0;
7+
left: 0;
8+
z-index: 100;
9+
}
10+
.dash-global-mask .panel {
11+
width: 95%;
12+
max-width: 420px;
13+
padding: 15px;
14+
border-radius: 4px;
15+
font-size: 14px;
16+
color: #ccc;
17+
background-color: #333;
18+
transform: translate(-50%, -50%);
19+
position: absolute;
20+
top: 40%;
21+
left: 50%;
22+
}
23+
.dash-global-mask .panel input {
24+
margin-top: 10px;
25+
}
26+
.dash-global-mask .panel .error {
27+
height: 0;
28+
font-size: 12px;
29+
color: #f84a4a;
30+
overflow: hidden;
31+
transition: height .2s ease, margin-top .2s ease;
32+
}
33+
.dash-global-mask .panel .error.on {
34+
height: 16px;
35+
margin-top: 5px;
36+
}
37+
.dash-global-mask .panel button {
38+
min-width: 55px;
39+
padding: 4px 13px;
40+
margin-top: 10px;
41+
font-size: 12px;
42+
}

app/dashboard/view/home/mask/Mask.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { Component } from 'react';
22

33
import './mask.css';
44

0 commit comments

Comments
 (0)