Skip to content

Commit

Permalink
dashboard: minor fixes on stats and texts
Browse files Browse the repository at this point in the history
  • Loading branch information
changkun committed Mar 27, 2021
1 parent 8a69c98 commit 7123c89
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
20 changes: 18 additions & 2 deletions dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dashboard/src/components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Home = (props) => {
<RedirTable isAdmin={props.isAdmin} statsMode={props.statsMode} refreshRef={tableRefresh}/>
</div>
</Content>
<Footer style={{ textAlign: 'center' }}>redir &copy; 2020-2021 Created by <a href='https://changkun.de'>Changkun Ou</a>. Open sourced under MIT license at <a href='https://changkun.de/s/redir'>GitHub</a>.</Footer>
<Footer style={{ textAlign: 'center' }}>redir &copy; 2020-2021 Created by <a href='https://changkun.de'>Changkun Ou</a>. Open sourced under MIT license on <a href='https://changkun.de/s/redir'>GitHub</a>.</Footer>
</Layout>
)
}
Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/components/RedirCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const RedirCreate = (props) => {
message.error(data.message)
return false
}
message.success(`Short link ${window.location.pathname}/${values.alias} is created and have been saved to your clipboard!`, 10)
message.success(`Short link ${window.location.pathname}/${values.alias} is created and has been saved to your clipboard!`, 10)
navigator.clipboard.writeText(`${window.location.host}${window.location.pathname}/${values.alias}`)
ref.current.reload() // refresh table.
return true
Expand All @@ -113,7 +113,7 @@ const RedirCreate = (props) => {
message: 'Please input an alias',
},
{
pattern: /^[\w\-][\w\-. \/]+$/,
pattern: /^[\w-][\w\-. /]+$/,
message: 'Please input a valid alias',
},
]}
Expand Down
1 change: 1 addition & 0 deletions dashboard/src/components/Stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const uaparser = new UAParser()

const Stats = (props) => {
const today = new Date()
today.setDate(today.getDate() + 1)
const start = new Date()
start.setDate(today.getDate() - 30)
const t0 = start.toISOString().slice(0, 10)
Expand Down

0 comments on commit 7123c89

Please sign in to comment.