-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from dolthub/taylor/config
Improve configuration page
- Loading branch information
Showing
31 changed files
with
580 additions
and
174 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { registerEnumType } from "@nestjs/graphql"; | ||
|
||
export enum SchemaType { | ||
View, | ||
Procedure, | ||
Event, | ||
Trigger, | ||
Table, | ||
View = "view", | ||
Procedure = "procedure", | ||
Event = "event", | ||
Trigger = "trigger", | ||
Table = "table", | ||
} | ||
|
||
registerEnumType(SchemaType, { name: "SchemaType" }); |
49 changes: 49 additions & 0 deletions
49
packages/web/components/DatabaseHeaderAndNav/ResetConnectionButton.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,49 @@ | ||
import Button from "@components/Button"; | ||
import ErrorMsg from "@components/ErrorMsg"; | ||
import Modal from "@components/Modal"; | ||
import SmallLoader from "@components/SmallLoader"; | ||
import Tooltip from "@components/Tooltip"; | ||
import { useResetDatabaseMutation } from "@gen/graphql-types"; | ||
import useMutation from "@hooks/useMutation"; | ||
import { IoReloadSharp } from "@react-icons/all-files/io5/IoReloadSharp"; | ||
import { useState } from "react"; | ||
import css from "./index.module.css"; | ||
|
||
export default function ResetConnectionButton() { | ||
const { mutateFn, loading, err, setErr } = useMutation({ | ||
hook: useResetDatabaseMutation, | ||
}); | ||
const [errorModalOpen, setErrorModalOpen] = useState(false); | ||
|
||
const onClose = () => { | ||
setErrorModalOpen(false); | ||
setErr(undefined); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Button.Link | ||
className={css.resetButton} | ||
onClick={async () => mutateFn()} | ||
data-tooltip-content="Reset connection" | ||
data-tooltip-id="reset-connection" | ||
> | ||
<SmallLoader | ||
loaded={!loading} | ||
options={{ color: "#fff", top: "0", opacity: 0.5, left: "-0.5rem" }} | ||
> | ||
<IoReloadSharp /> | ||
</SmallLoader> | ||
</Button.Link> | ||
<Tooltip id="reset-connection" /> | ||
<Modal | ||
isOpen={errorModalOpen} | ||
onRequestClose={onClose} | ||
title="Error resetting connection" | ||
> | ||
<ErrorMsg err={err} /> | ||
<Button onClick={onClose}>Close</Button> | ||
</Modal> | ||
</> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,3 +90,7 @@ | |
@apply mt-1 ml-3 block; | ||
} | ||
} | ||
|
||
.resetButton { | ||
@apply mr-5 text-xl text-white hover:text-ld-lightblue; | ||
} |
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
Oops, something went wrong.