Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/slurmcostmanager.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ nav button:hover {
color: red;
}

.error-details {
border: 1px solid #ccc;
background: #fdd;
padding: 0.5em;
white-space: pre-wrap;
margin-top: 0.5em;
}

.clickable {
cursor: pointer;
}
Expand Down
22 changes: 20 additions & 2 deletions src/slurmcostmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,7 @@ function Rates({ onRatesUpdated }) {
function App() {
const [view, setView] = useState('summary');
const { data, error, reload } = useBillingData();
const [showErrorDetails, setShowErrorDetails] = useState(false);

return React.createElement(
'div',
Expand Down Expand Up @@ -1077,9 +1078,26 @@ function App() {
view !== 'settings' &&
error &&
React.createElement(
'p',
'div',
{ className: 'error' },
`Failed to load data: ${error}`
React.createElement(
'p',
null,
'Failed to load data ',
React.createElement(
'a',
{
href: '#',
onClick: e => {
e.preventDefault();
setShowErrorDetails(v => !v);
}
},
'(Click here to Learn More)'
)
),
showErrorDetails &&
React.createElement('pre', { className: 'error-details' }, error)
),
data &&
view === 'summary' &&
Expand Down
Loading