mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Imported libraries, removed next-basics.
This commit is contained in:
parent
31266cb1ac
commit
113022ed17
44 changed files with 361 additions and 180 deletions
|
|
@ -1,4 +1,5 @@
|
|||
'use client';
|
||||
import { useEffect } from 'react';
|
||||
import { Icon, Text } from 'react-basics';
|
||||
import Link from 'next/link';
|
||||
import classNames from 'classnames';
|
||||
|
|
@ -9,9 +10,8 @@ import ProfileButton from 'components/input/ProfileButton';
|
|||
import TeamsButton from 'components/input/TeamsButton';
|
||||
import Icons from 'components/icons';
|
||||
import { useMessages, useNavigation, useTeamUrl } from 'components/hooks';
|
||||
import { getItem, setItem } from 'lib/storage';
|
||||
import styles from './NavBar.module.css';
|
||||
import { useEffect } from 'react';
|
||||
import { getItem, setItem } from 'next-basics';
|
||||
|
||||
export function NavBar() {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useEffect, useCallback, useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { Button } from 'react-basics';
|
||||
import { setItem } from 'next-basics';
|
||||
import { setItem } from 'lib/storage';
|
||||
import useStore, { checkVersion } from 'store/version';
|
||||
import { REPO_URL, VERSION_CHECK } from 'lib/constants';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
LoadingButton,
|
||||
} from 'react-basics';
|
||||
import { useContext, useState } from 'react';
|
||||
import { getRandomChars } from 'next-basics';
|
||||
import { getRandomChars } from 'lib/crypto';
|
||||
import { useApi, useMessages, useModified } from 'components/hooks';
|
||||
import { WebsiteContext } from 'app/(main)/websites/[websiteId]/WebsiteProvider';
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
Flexbox,
|
||||
useToasts,
|
||||
} from 'react-basics';
|
||||
import { getRandomChars } from 'next-basics';
|
||||
import { getRandomChars } from 'lib/crypto';
|
||||
import { useContext, useRef, useState } from 'react';
|
||||
import { useApi, useMessages, useModified } from 'components/hooks';
|
||||
import { TeamContext } from 'app/(main)/teams/[teamId]/TeamProvider';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import Icons from 'components/icons';
|
|||
import { BROWSERS, OS_NAMES } from 'lib/constants';
|
||||
import { stringToColor } from 'lib/format';
|
||||
import { RealtimeData } from 'lib/types';
|
||||
import { safeDecodeURI } from 'next-basics';
|
||||
import { useContext, useMemo, useState } from 'react';
|
||||
import { Icon, SearchField, StatusLight, Text } from 'react-basics';
|
||||
import { FixedSizeList } from 'react-window';
|
||||
|
|
@ -99,7 +98,7 @@ export function RealtimeLog({ data }: { data: RealtimeData }) {
|
|||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
{safeDecodeURI(url)}
|
||||
{url}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { z } from 'zod';
|
||||
import { checkPassword, createSecureToken } from 'next-basics';
|
||||
import { checkPassword } from 'lib/auth';
|
||||
import { createSecureToken } from 'lib/jwt';
|
||||
import { redisEnabled } from '@umami/redis-client';
|
||||
import { getUserByUsername } from 'queries';
|
||||
import { json, unauthorized } from 'lib/response';
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { z } from 'zod';
|
||||
import { checkPassword, hashPassword } from 'lib/auth';
|
||||
import { parseRequest } from 'lib/request';
|
||||
import { json, badRequest } from 'lib/response';
|
||||
import { getUser, updateUser } from 'queries/prisma/user';
|
||||
import { checkPassword, hashPassword } from 'next-basics';
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const schema = z.object({
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
import { z } from 'zod';
|
||||
import { isbot } from 'isbot';
|
||||
import { createToken, parseToken, safeDecodeURI } from 'next-basics';
|
||||
import { createToken, parseToken } from 'lib/jwt';
|
||||
import { safeDecodeURI } from 'lib/url';
|
||||
import clickhouse from 'lib/clickhouse';
|
||||
import { parseRequest } from 'lib/request';
|
||||
import { badRequest, json, forbidden, serverError } from 'lib/response';
|
||||
import { fetchSession, fetchWebsite } from 'lib/load';
|
||||
import { getClientInfo, hasBlockedIp } from 'lib/detect';
|
||||
import { secret, uuid, visitSalt } from 'lib/crypto';
|
||||
import { createSession, saveEvent, saveSessionData } from 'queries';
|
||||
import { COLLECTION_TYPE } from 'lib/constants';
|
||||
import { createSession, saveEvent, saveSessionData } from 'queries';
|
||||
|
||||
export async function POST(request: Request) {
|
||||
// Bot check
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { json, notFound } from 'lib/response';
|
||||
import { getSharedWebsite } from 'queries';
|
||||
import { createToken } from 'next-basics';
|
||||
import { createToken } from 'lib/jwt';
|
||||
import { secret } from 'lib/crypto';
|
||||
import { getSharedWebsite } from 'queries';
|
||||
|
||||
export async function GET(request: Request, { params }: { params: Promise<{ shareId: string }> }) {
|
||||
const { shareId } = await params;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { z } from 'zod';
|
||||
import { getRandomChars } from 'next-basics';
|
||||
import { getRandomChars } from 'lib/crypto';
|
||||
import { unauthorized, json } from 'lib/response';
|
||||
import { canCreateTeam } from 'lib/auth';
|
||||
import { uuid } from 'lib/crypto';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { z } from 'zod';
|
|||
import { canUpdateUser, canViewUser, canDeleteUser } from 'lib/auth';
|
||||
import { getUser, getUserByUsername, updateUser, deleteUser } from 'queries';
|
||||
import { json, unauthorized, badRequest, ok } from 'lib/response';
|
||||
import { hashPassword } from 'next-basics';
|
||||
import { hashPassword } from 'lib/auth';
|
||||
import { parseRequest } from 'lib/request';
|
||||
|
||||
export async function GET(request: Request, { params }: { params: Promise<{ userId: string }> }) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { z } from 'zod';
|
||||
import { hashPassword } from 'next-basics';
|
||||
import { canCreateUser } from 'lib/auth';
|
||||
import { hashPassword, canCreateUser } from 'lib/auth';
|
||||
import { ROLES } from 'lib/constants';
|
||||
import { uuid } from 'lib/crypto';
|
||||
import { parseRequest } from 'lib/request';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue