forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
71846: ui: add reload button for Loading component r=maryliag a=Azhng Resolves cockroachdb#68602 https://user-images.githubusercontent.com/9267198/138362614-96f15559-9761-4c4b-8a47-2843cad7978d.mov Release note (ui change): when an error is encoutered in the statement/ transaction/session page, user can now click on reload button to reload the page. Co-authored-by: Azhng <[email protected]>
- Loading branch information
Showing
10 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
pkg/ui/workspaces/cluster-ui/src/sqlActivity/errorComponent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2021 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
import React from "react"; | ||
import classNames from "classnames/bind"; | ||
import styles from "./sqlActivity.module.scss"; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
interface SQLActivityErrorProps { | ||
statsType: string; | ||
} | ||
|
||
const SQLActivityError: React.FC<SQLActivityErrorProps> = props => { | ||
return ( | ||
<div className={cx("row")}> | ||
<span> | ||
This page had an unexpected error while loading | ||
{" " + props.statsType}. | ||
</span> | ||
| ||
<a | ||
className={cx("action")} | ||
onClick={() => { | ||
window.location.reload(); | ||
}} | ||
> | ||
Reload this page | ||
</a> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SQLActivityError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,8 @@ | |
text-decoration: underline; | ||
} | ||
} | ||
|
||
.row { | ||
display: flex; | ||
flex-direction: row; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters