Skip to content

Commit

Permalink
Merge pull request #130 from besscroft/dev
Browse files Browse the repository at this point in the history
v1.1.0
  • Loading branch information
besscroft authored Oct 15, 2024
2 parents c6a9233 + 150e2a3 commit 8452cde
Show file tree
Hide file tree
Showing 99 changed files with 926 additions and 754 deletions.
4 changes: 0 additions & 4 deletions .env

This file was deleted.

6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 数据库 url
DATABASE_URL="postgres://postgres:postgres@localhost:5432/postgres"
# AUTH_SECRET npx auth secret
AUTH_SECRET=your-secret-key
# 禁用 Vercel node.js 帮助程序
NODEJS_HELPERS=0
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ dist
/build

# local env files
.env*.local
.env
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs

ENV AUTH_TRUST_HOST true
ENV NODEJS_HELPERS 0

EXPOSE 3000

Expand Down
2 changes: 1 addition & 1 deletion app/(default)/[...tag]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Masonry from '~/components/Masonry'
import { fetchClientImagesListByTag, fetchClientImagesPageTotalByTag } from '~/server/lib/query'
import { fetchClientImagesListByTag, fetchClientImagesPageTotalByTag } from '~/server/db/query'
import { ImageHandleProps } from '~/types'

export default function Page({ params }: { params: { tag: string } }) {
Expand Down
2 changes: 1 addition & 1 deletion app/(default)/label/[...tag]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Masonry from '~/components/Masonry'
import { fetchClientImagesListByLabel, fetchClientImagesPageTotalByLabel } from '~/server/lib/query'
import { fetchClientImagesListByLabel, fetchClientImagesPageTotalByLabel } from '~/server/db/query'
import { ImageHandleProps } from '~/types'

export default function Label({ params }: { params: { tag: string } }) {
Expand Down
2 changes: 1 addition & 1 deletion app/(default)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Masonry from '~/components/Masonry'
import { fetchClientImagesListByTag, fetchClientImagesPageTotalByTag } from '~/server/lib/query'
import { fetchClientImagesListByTag, fetchClientImagesPageTotalByTag } from '~/server/db/query'
import { ImageHandleProps } from '~/types'

export default async function Home() {
Expand Down
2 changes: 1 addition & 1 deletion app/admin/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function About() {
width={64}
height={64}
/>
<Chip color="success" variant="bordered">v1.0.0</Chip>
<Chip color="success" variant="bordered">v1.1.0</Chip>
<span>PicImpact 是一个摄影师专用的摄影作品展示网站,基于 Next.js 开发。</span>
<Divider className="my-4" />
<div className="flex flex-col w-full">
Expand Down
2 changes: 1 addition & 1 deletion app/admin/copyright/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fetchCopyrightList } from '~/server/lib/query'
import { fetchCopyrightList } from '~/server/db/query'
import { HandleProps } from '~/types'
import { Card, CardHeader } from '@nextui-org/react'
import React from 'react'
Expand Down
2 changes: 1 addition & 1 deletion app/admin/list/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
fetchServerImagesListByTag,
fetchServerImagesPageTotalByTag
} from '~/server/lib/query'
} from '~/server/db/query'
import { ImageServerHandleProps } from '~/types'
import ListProps from '~/components/admin/list/ListProps'

Expand Down
2 changes: 1 addition & 1 deletion app/admin/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fetchImagesAnalysis } from '~/server/lib/query'
import { fetchImagesAnalysis } from '~/server/db/query'
import CardList from '~/components/admin/dashboard/CardList'
import { DataProps } from '~/types'

Expand Down
6 changes: 3 additions & 3 deletions app/admin/settings/authenticator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function Authenticator() {

async function getQRCode() {
try {
const res = await fetch('/api/v1/get-seed-secret', {
const res = await fetch('/api/v1/auth/get-seed-secret', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Expand All @@ -60,7 +60,7 @@ export default function Authenticator() {

async function saveAuthTemplateToken() {
try {
const res = await fetch('/api/v1/auth-validate', {
const res = await fetch('/api/v1/auth/validate', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand All @@ -82,7 +82,7 @@ export default function Authenticator() {
async function removeAuth() {
try {
setDeleteLoading(true)
const res = await fetch('/api/v1/remove-auth', {
const res = await fetch('/api/v1/auth/remove', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
Expand Down
2 changes: 1 addition & 1 deletion app/admin/settings/password/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function PassWord() {
}
try {
setLoading(true)
await fetch('/api/v1/update-password', {
await fetch('/api/v1/settings/update-password', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
Expand Down
6 changes: 3 additions & 3 deletions app/admin/settings/preferences/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { Button, Card, CardBody, Input } from '@nextui-org/react'
import React, {useEffect, useState} from 'react'
import React, { useEffect, useState } from 'react'
import useSWR from 'swr'
import { fetcher } from '~/utils/fetcher'
import { toast } from 'sonner'
Expand All @@ -10,12 +10,12 @@ export default function Preferences() {
const [title, setTitle] = useState('')
const [loading, setLoading] = useState(false)

const { data, isValidating, isLoading } = useSWR('/api/v1/get-custom-title', fetcher)
const { data, isValidating, isLoading } = useSWR('/api/v1/settings/get-custom-title', fetcher)

async function updateTitle() {
try {
setLoading(true)
await fetch('/api/v1/update-custom-title', {
await fetch('/api/v1/settings/update-custom-title', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion app/admin/tag/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fetchTagsList } from '~/server/lib/query'
import { fetchTagsList } from '~/server/db/query'
import TagList from '~/components/admin/tag/TagList'
import { Card, CardHeader } from '@nextui-org/react'
import RefreshButton from '~/components/RefreshButton'
Expand Down
22 changes: 22 additions & 0 deletions app/api/[[...route]]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'server-only'
import { handle } from 'hono/vercel'
import { Hono } from 'hono'
import route from '~/hono'
import open from '~/hono/open/open'

const app = new Hono().basePath('/api')

app.route('/v1', route)
app.route('/open', open)
app.notFound((c) => {
return c.text('not found', 404)
})

export const GET = handle(app)
export const POST = handle(app)
export const PUT = handle(app)
export const DELETE = handle(app)
export const dynamic = 'force-dynamic'
export const runtime = 'nodejs'

export default app
21 changes: 0 additions & 21 deletions app/api/open/get-auth-status/route.ts

This file was deleted.

12 changes: 0 additions & 12 deletions app/api/open/get-image-blob/route.ts

This file was deleted.

16 changes: 0 additions & 16 deletions app/api/open/get-image-by-id/route.ts

This file was deleted.

5 changes: 0 additions & 5 deletions app/api/route.ts

This file was deleted.

9 changes: 0 additions & 9 deletions app/api/v1/alist-info/route.ts

This file was deleted.

28 changes: 0 additions & 28 deletions app/api/v1/auth-login-validate/route.ts

This file was deleted.

31 changes: 0 additions & 31 deletions app/api/v1/auth-validate/route.ts

This file was deleted.

14 changes: 0 additions & 14 deletions app/api/v1/copyright-add/route.ts

This file was deleted.

11 changes: 0 additions & 11 deletions app/api/v1/copyright-delete/[id]/route.ts

This file was deleted.

14 changes: 0 additions & 14 deletions app/api/v1/copyright-update/route.ts

This file was deleted.

9 changes: 0 additions & 9 deletions app/api/v1/get-copyrights/route.ts

This file was deleted.

9 changes: 0 additions & 9 deletions app/api/v1/get-custom-title/route.ts

This file was deleted.

Loading

0 comments on commit 8452cde

Please sign in to comment.