Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
905bab9c86 | ||
|
|
7e877ce9f4 | ||
|
|
b1bfb09dfd | ||
|
|
c8a4521677 |
@@ -1,3 +1,12 @@
|
|||||||
|
### [0.3.4](https://github.com/stonith404/pingvin-share/compare/v0.3.3...v0.3.4) (2022-12-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* show alternative to copy button if site is not using https ([7e877ce](https://github.com/stonith404/pingvin-share/commit/7e877ce9f4b82d61c9b238e17def9f4c29e7aeb8))
|
||||||
|
* sign up page available when registration is disabled ([c8a4521](https://github.com/stonith404/pingvin-share/commit/c8a4521677280d6aba89d293a1fe0c38adf9f92c))
|
||||||
|
* tables on mobile ([b1bfb09](https://github.com/stonith404/pingvin-share/commit/b1bfb09dfd5c90cc18847470a9ce1ce8397c1476))
|
||||||
|
|
||||||
### [0.3.3](https://github.com/stonith404/pingvin-share/compare/v0.3.2...v0.3.3) (2022-12-08)
|
### [0.3.3](https://github.com/stonith404/pingvin-share/compare/v0.3.2...v0.3.3) (2022-12-08)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
16
frontend/src/components/account/showShareLinkModal.tsx
Normal file
16
frontend/src/components/account/showShareLinkModal.tsx
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { Stack, TextInput } from "@mantine/core";
|
||||||
|
import { ModalsContextProps } from "@mantine/modals/lib/context";
|
||||||
|
|
||||||
|
const showShareLinkModal = (modals: ModalsContextProps, shareId: string) => {
|
||||||
|
const link = `${window.location.origin}/share/${shareId}`;
|
||||||
|
return modals.openModal({
|
||||||
|
title: "Share link",
|
||||||
|
children: (
|
||||||
|
<Stack align="stretch">
|
||||||
|
<TextInput variant="filled" value={link} />
|
||||||
|
</Stack>
|
||||||
|
),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export default showShareLinkModal;
|
||||||
@@ -1,4 +1,12 @@
|
|||||||
import { ActionIcon, Code, Group, Skeleton, Table, Text } from "@mantine/core";
|
import {
|
||||||
|
ActionIcon,
|
||||||
|
Box,
|
||||||
|
Code,
|
||||||
|
Group,
|
||||||
|
Skeleton,
|
||||||
|
Table,
|
||||||
|
Text,
|
||||||
|
} from "@mantine/core";
|
||||||
import { useModals } from "@mantine/modals";
|
import { useModals } from "@mantine/modals";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { TbEdit, TbLock } from "react-icons/tb";
|
import { TbEdit, TbLock } from "react-icons/tb";
|
||||||
@@ -43,53 +51,55 @@ const AdminConfigTable = () => {
|
|||||||
));
|
));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Table verticalSpacing="sm" horizontalSpacing="xl" withBorder>
|
<Box sx={{ display: "block", overflowX: "auto" }}>
|
||||||
<thead>
|
<Table verticalSpacing="sm" horizontalSpacing="xl" withBorder>
|
||||||
<tr>
|
<thead>
|
||||||
<th>Key</th>
|
<tr>
|
||||||
<th>Value</th>
|
<th>Key</th>
|
||||||
<th></th>
|
<th>Value</th>
|
||||||
</tr>
|
<th></th>
|
||||||
</thead>
|
</tr>
|
||||||
<tbody>
|
</thead>
|
||||||
{isLoading
|
<tbody>
|
||||||
? skeletonRows
|
{isLoading
|
||||||
: configVariables.map((configVariable) => (
|
? skeletonRows
|
||||||
<tr key={configVariable.key}>
|
: configVariables.map((configVariable) => (
|
||||||
<td style={{ maxWidth: "200px" }}>
|
<tr key={configVariable.key}>
|
||||||
<Code>{configVariable.key}</Code>{" "}
|
<td style={{ maxWidth: "200px" }}>
|
||||||
{configVariable.secret && <TbLock />} <br />
|
<Code>{configVariable.key}</Code>{" "}
|
||||||
<Text size="xs" color="dimmed">
|
{configVariable.secret && <TbLock />} <br />
|
||||||
{configVariable.description}
|
<Text size="xs" color="dimmed">
|
||||||
</Text>
|
{configVariable.description}
|
||||||
</td>
|
</Text>
|
||||||
<td>
|
</td>
|
||||||
{configVariable.obscured
|
<td>
|
||||||
? "•".repeat(configVariable.value.length)
|
{configVariable.obscured
|
||||||
: configVariable.value}
|
? "•".repeat(configVariable.value.length)
|
||||||
</td>
|
: configVariable.value}
|
||||||
<td>
|
</td>
|
||||||
<Group position="right">
|
<td>
|
||||||
<ActionIcon
|
<Group position="right">
|
||||||
color="primary"
|
<ActionIcon
|
||||||
variant="light"
|
color="primary"
|
||||||
size={25}
|
variant="light"
|
||||||
onClick={() =>
|
size={25}
|
||||||
showUpdateConfigVariableModal(
|
onClick={() =>
|
||||||
modals,
|
showUpdateConfigVariableModal(
|
||||||
configVariable,
|
modals,
|
||||||
getConfigVariables
|
configVariable,
|
||||||
)
|
getConfigVariables
|
||||||
}
|
)
|
||||||
>
|
}
|
||||||
<TbEdit />
|
>
|
||||||
</ActionIcon>
|
<TbEdit />
|
||||||
</Group>
|
</ActionIcon>
|
||||||
</td>
|
</Group>
|
||||||
</tr>
|
</td>
|
||||||
))}
|
</tr>
|
||||||
</tbody>
|
))}
|
||||||
</Table>
|
</tbody>
|
||||||
|
</Table>
|
||||||
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ const ManageUserTable = ({
|
|||||||
const modals = useModals();
|
const modals = useModals();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ display: "block", overflowX: "auto", whiteSpace: "nowrap" }}>
|
<Box sx={{ display: "block", overflowX: "auto" }}>
|
||||||
<Table verticalSpacing="sm" highlightOnHover>
|
<Table verticalSpacing="sm">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Username</th>
|
<th>Username</th>
|
||||||
|
|||||||
@@ -40,14 +40,16 @@ const Body = ({ share }: { share: Share }) => {
|
|||||||
variant="filled"
|
variant="filled"
|
||||||
value={link}
|
value={link}
|
||||||
rightSection={
|
rightSection={
|
||||||
<ActionIcon
|
window.isSecureContext && (
|
||||||
onClick={() => {
|
<ActionIcon
|
||||||
clipboard.copy(link);
|
onClick={() => {
|
||||||
toast.success("Your link was copied to the keyboard.");
|
clipboard.copy(link);
|
||||||
}}
|
toast.success("Your link was copied to the keyboard.");
|
||||||
>
|
}}
|
||||||
<TbCopy />
|
>
|
||||||
</ActionIcon>
|
<TbCopy />
|
||||||
|
</ActionIcon>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Text
|
<Text
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import Link from "next/link";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { TbLink, TbTrash } from "react-icons/tb";
|
import { TbLink, TbTrash } from "react-icons/tb";
|
||||||
|
import showShareLinkModal from "../../components/account/showShareLinkModal";
|
||||||
import Meta from "../../components/Meta";
|
import Meta from "../../components/Meta";
|
||||||
import useUser from "../../hooks/user.hook";
|
import useUser from "../../hooks/user.hook";
|
||||||
import shareService from "../../services/share.service";
|
import shareService from "../../services/share.service";
|
||||||
@@ -83,12 +84,16 @@ const MyShares = () => {
|
|||||||
variant="light"
|
variant="light"
|
||||||
size={25}
|
size={25}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
clipboard.copy(
|
if (window.isSecureContext) {
|
||||||
`${window.location.origin}/share/${share.id}`
|
clipboard.copy(
|
||||||
);
|
`${window.location.origin}/share/${share.id}`
|
||||||
toast.success(
|
);
|
||||||
"Your link was copied to the keyboard."
|
toast.success(
|
||||||
);
|
"Your link was copied to the keyboard."
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
showShareLinkModal(modals, share.id);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<TbLink />
|
<TbLink />
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const SignUp = () => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
if (user) {
|
if (user) {
|
||||||
router.replace("/");
|
router.replace("/");
|
||||||
} else if (config.get("ALLOW_REGISTRATION") == "false") {
|
} else if (!config.get("ALLOW_REGISTRATION")) {
|
||||||
router.replace("/auth/signIn");
|
router.replace("/auth/signIn");
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pingvin-share",
|
"name": "pingvin-share",
|
||||||
"version": "0.3.3",
|
"version": "0.3.4",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"format": "cd frontend && npm run format && cd ../backend && npm run format",
|
"format": "cd frontend && npm run format && cd ../backend && npm run format",
|
||||||
"lint": "cd frontend && npm run lint && cd ../backend && npm run lint",
|
"lint": "cd frontend && npm run lint && cd ../backend && npm run lint",
|
||||||
|
|||||||
Reference in New Issue
Block a user