|
|
@ -83,11 +83,17 @@ const SettingsGeneralView: FunctionComponent = () => {
|
|
|
|
</CollapseBox>
|
|
|
|
</CollapseBox>
|
|
|
|
<Text
|
|
|
|
<Text
|
|
|
|
label="API Key"
|
|
|
|
label="API Key"
|
|
|
|
disabled
|
|
|
|
// User can copy through the clipboard button
|
|
|
|
|
|
|
|
disabled={window.isSecureContext}
|
|
|
|
|
|
|
|
// Enable user to at least copy when not in secure context
|
|
|
|
|
|
|
|
readOnly={!window.isSecureContext}
|
|
|
|
rightSectionWidth={95}
|
|
|
|
rightSectionWidth={95}
|
|
|
|
rightSectionProps={{ style: { justifyContent: "flex-end" } }}
|
|
|
|
rightSectionProps={{ style: { justifyContent: "flex-end" } }}
|
|
|
|
rightSection={
|
|
|
|
rightSection={
|
|
|
|
<MantineGroup spacing="xs" mx="xs" position="right">
|
|
|
|
<MantineGroup spacing="xs" mx="xs" position="right">
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Clipboard API is only available in secure contexts See: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#interfaces
|
|
|
|
|
|
|
|
window.isSecureContext && (
|
|
|
|
<Action
|
|
|
|
<Action
|
|
|
|
label="Copy API Key"
|
|
|
|
label="Copy API Key"
|
|
|
|
variant="light"
|
|
|
|
variant="light"
|
|
|
@ -100,7 +106,9 @@ const SettingsGeneralView: FunctionComponent = () => {
|
|
|
|
toggleState(setCopy, 1500);
|
|
|
|
toggleState(setCopy, 1500);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
></Action>
|
|
|
|
/>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
<Action
|
|
|
|
<Action
|
|
|
|
label="Regenerate"
|
|
|
|
label="Regenerate"
|
|
|
|
variant="light"
|
|
|
|
variant="light"
|
|
|
|