Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Moecube Store
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Moecube Store
Commits
11972cb6
You need to sign in or sign up before continuing.
Commit
11972cb6
authored
Mar 10, 2017
by
HJISTC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New Page
parent
a322d39e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
6 deletions
+36
-6
src/About.js
src/About.js
+11
-0
src/App.js
src/App.js
+7
-4
src/Translate.js
src/Translate.js
+1
-1
src/index.js
src/index.js
+17
-1
No files found.
src/About.js
0 → 100644
View file @
11972cb6
import
React
from
'
react
'
export
default
class
About
extends
React
.
Component
{
render
()
{
return
(
<
div
>
about
<
/div
>
)
}
}
\ No newline at end of file
src/App.js
View file @
11972cb6
...
...
@@ -8,6 +8,7 @@ import i18Data from '../i18data.json'
import
{
FormattedMessage
}
from
'
react-intl
'
import
{
Layout
,
Row
,
Col
,
Button
,
Card
,
Timeline
,
Dropdown
,
Menu
,
Icon
}
from
'
antd
'
import
{
Link
}
from
'
react-router
'
const
{
Content
,
Footer
,
Header
}
=
Layout
...
...
@@ -68,7 +69,7 @@ export default class App extends Component {
params
.
set
(
'
api_username
'
,
config
.
ygobbs
.
api_username
);
let
data
=
await
fetch
(
`
${
config
.
ygobbs
.
dashboard
}
?
${
params
.
toString
()}
`
).
then
(
res
=>
res
.
json
())
return
data
.
global_reports
.
find
((
item
:
any
)
=>
item
.
type
===
'
signups
'
).
total
return
data
.
global_reports
.
find
((
item
)
=>
item
.
type
===
'
signups
'
).
total
}
async
get_stats_online
()
{
...
...
@@ -175,7 +176,9 @@ export default class App extends Component {
<
p
className
=
"
App-Card-content
"
>
<
FormattedMessage
id
=
{
"
CardContent2
"
}
/
>
<
/p
>
<
a
href
=
""
><
Button
type
=
"
primary
"
icon
=
"
plus-square-o
"
><
FormattedMessage
id
=
{
"
CardAction2
"
}
/></
Button
><
/a
>
<
Link
to
=
"
about
"
>
<
Button
type
=
"
primary
"
icon
=
"
plus-square-o
"
><
FormattedMessage
id
=
{
"
CardAction2
"
}
/></
Button
>
<
/Link
>
<
/Card
>
<
/Col
>
<
/Row
>
...
...
@@ -311,10 +314,10 @@ export default class App extends Component {
{
language
===
'
en-US
'
?
(
<
a
className
=
"
ant-dropdown-link changelanguage
"
href
=
"
#
"
>
<
img
alt
=
"
img
"
src
=
{
require
(
'
../public/USFlag.png
'
)}
/
>
&
nbsp
;
English
<
Icon
type
=
"
down
"
class
=
"
flag
"
/>
&
nbsp
;
English
<
Icon
type
=
"
down
"
class
Name
=
"
flag
"
/>
<
/a>
)
:
(
<a className="ant-dropdown-link changelanguage" href="#"
>
<
img
alt
=
"
img
"
src
=
{
require
(
'
../public/CNFlag.png
'
)}
/
>
&
nbsp
;
中文
<
Icon
type
=
"
down
"
class
=
"
flag
"
/>
&
nbsp
;
中文
<
Icon
type
=
"
down
"
class
Name
=
"
flag
"
/>
<
/a>
)
}
<
/Dropdown
>
<
/div
>
...
...
src/Translate.js
View file @
11972cb6
...
...
@@ -17,7 +17,7 @@ export default class Translate extends React.Component {
render
()
{
return
(
<
IntlProvider
locale
=
{
language
}
messages
=
{
messages
}
>
{
React
.
cloneElement
(
this
.
props
.
Template
,
{
language
})}
{
React
.
cloneElement
(
this
.
props
.
Template
,
{
language
})}
<
/IntlProvider
>
)
}
...
...
src/index.js
View file @
11972cb6
import
React
from
'
react
'
import
ReactDOM
from
'
react-dom
'
import
App
from
'
./App
'
import
About
from
'
./About
'
import
Translate
from
'
./Translate
'
import
'
./index.css
'
import
{
Router
,
Route
,
browserHistory
}
from
'
react-router
'
const
NotFound
=
()
=>
<
div
>
404
<
/div
>
class
Index
extends
React
.
Component
{
render
()
{
return
(
<
Router
history
=
{
browserHistory
}
>
<
Route
path
=
"
/
"
component
=
{
App
}
/
>
<
Route
path
=
"
about
"
component
=
{
About
}
/
>
<
Route
path
=
"
*
"
component
=
{
NotFound
}
/
>
<
/Router
>
)
}
}
ReactDOM
.
render
(
<
Translate
Template
=
{
<
App
/>
}
/>
,
<
Translate
Template
=
{
<
Index
/>
}
/>
,
document
.
getElementById
(
'
root
'
)
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment