Compare commits

...

11 Commits

Author SHA1 Message Date
semantic-release-bot bb0a811432 🔖 chore(release): v1.4.7 [skip ci]
## [1.4.7](https://github.com/perfect-panel/ppanel-web/compare/v1.4.6...v1.4.7) (2025-09-23)

### 🐛 Bug Fixes

* Add unique key to ProTable for improved rendering with user ID filters ([2bff15f](https://github.com/perfect-panel/ppanel-web/commit/2bff15f))
* Adjust layout spacing and chart aspect ratio in ServerConfig component ([05a61d8](https://github.com/perfect-panel/ppanel-web/commit/05a61d8))
* Refactor server ID cell rendering for improved readability and consistency ([0345b7c](https://github.com/perfect-panel/ppanel-web/commit/0345b7c))
* Update announcement page to format creation date and enhance content display ([8445e30](https://github.com/perfect-panel/ppanel-web/commit/8445e30))
* Update OnlineUsersCell to display user count with icon instead of badge ([7a4ebdf](https://github.com/perfect-panel/ppanel-web/commit/7a4ebdf))
* Update subscribe name fallback to return '--' instead of 'Unknown' ([0a07d25](https://github.com/perfect-panel/ppanel-web/commit/0a07d25))
2025-09-23 12:16:40 +00:00
web 8445e302e6 🐛 fix: Update announcement page to format creation date and enhance content display 2025-09-23 05:12:36 -07:00
web 2bff15fd13 🐛 fix: Add unique key to ProTable for improved rendering with user ID filters 2025-09-23 05:04:33 -07:00
web 0345b7cced 🐛 fix: Refactor server ID cell rendering for improved readability and consistency 2025-09-23 05:01:17 -07:00
web 7a4ebdf985 🐛 fix: Update OnlineUsersCell to display user count with icon instead of badge 2025-09-23 04:46:33 -07:00
web 05a61d8bf2 🐛 fix: Adjust layout spacing and chart aspect ratio in ServerConfig component 2025-09-23 04:42:55 -07:00
web 0a07d2578e 🐛 fix: Update subscribe name fallback to return '--' instead of 'Unknown' 2025-09-23 04:40:35 -07:00
semantic-release-bot ee05a73834 🔖 chore(release): v1.4.6 [skip ci]
## [1.4.6](https://github.com/perfect-panel/ppanel-web/compare/v1.4.5...v1.4.6) (2025-09-17)

### 🎫 Chores

* Merge branch 'main' into develop ([41f06bf](https://github.com/perfect-panel/ppanel-web/commit/41f06bf))

### 🐛 Bug Fixes

* Add loaded state to node, server, and subscribe stores for better loading management ([13dce0c](https://github.com/perfect-panel/ppanel-web/commit/13dce0c))
* Removed node metadata fields in subscription schema to simplify structure ([0cadd83](https://github.com/perfect-panel/ppanel-web/commit/0cadd83))
2025-09-17 14:29:53 +00:00
web 13dce0c20b 🐛 fix: Add loaded state to node, server, and subscribe stores for better loading management 2025-09-17 07:26:56 -07:00
web 41f06bfe54 🔧 chore: Merge branch 'main' into develop 2025-09-17 03:21:49 -07:00
web 0cadd83e45 🐛 fix: Removed node metadata fields in subscription schema to simplify structure 2025-09-17 03:19:31 -07:00
13 changed files with 85 additions and 46 deletions
+25
View File
@@ -1,6 +1,31 @@
<a name="readme-top"></a>
# Changelog
## [1.4.7](https://github.com/perfect-panel/ppanel-web/compare/v1.4.6...v1.4.7) (2025-09-23)
### 🐛 Bug Fixes
* Add unique key to ProTable for improved rendering with user ID filters ([2bff15f](https://github.com/perfect-panel/ppanel-web/commit/2bff15f))
* Adjust layout spacing and chart aspect ratio in ServerConfig component ([05a61d8](https://github.com/perfect-panel/ppanel-web/commit/05a61d8))
* Refactor server ID cell rendering for improved readability and consistency ([0345b7c](https://github.com/perfect-panel/ppanel-web/commit/0345b7c))
* Update announcement page to format creation date and enhance content display ([8445e30](https://github.com/perfect-panel/ppanel-web/commit/8445e30))
* Update OnlineUsersCell to display user count with icon instead of badge ([7a4ebdf](https://github.com/perfect-panel/ppanel-web/commit/7a4ebdf))
* Update subscribe name fallback to return '--' instead of 'Unknown' ([0a07d25](https://github.com/perfect-panel/ppanel-web/commit/0a07d25))
## [1.4.6](https://github.com/perfect-panel/ppanel-web/compare/v1.4.5...v1.4.6) (2025-09-17)
### 🎫 Chores
* Merge branch 'main' into develop ([41f06bf](https://github.com/perfect-panel/ppanel-web/commit/41f06bf))
### 🐛 Bug Fixes
* Add loaded state to node, server, and subscribe stores for better loading management ([13dce0c](https://github.com/perfect-panel/ppanel-web/commit/13dce0c))
* Removed node metadata fields in subscription schema to simplify structure ([0cadd83](https://github.com/perfect-panel/ppanel-web/commit/0cadd83))
## [1.4.5](https://github.com/perfect-panel/ppanel-web/compare/v1.4.4...v1.4.5) (2025-09-17)
+9 -13
View File
@@ -88,24 +88,20 @@ export default function NodesPage() {
{
id: 'address_port',
header: `${t('address')}:${t('port')}`,
cell: ({ row }) => (row.original.address || '—') + ':' + (row.original.port ?? '—'),
cell: ({ row }) => `${row.original.address || '—'}:${row.original.port || '—'}`,
},
{
id: 'server_id',
header: t('server'),
cell: ({ row }) => (
<div className='space-y-1'>
<Badge variant='outline'>
{getServerName(row.original.server_id)} : {getServerAddress(row.original.server_id)}
</Badge>
<br />
<Badge variant='outline'>
{row.original.protocol || '—'} :{' '}
{getProtocolPort(row.original.server_id, row.original.protocol)}
</Badge>
</div>
),
cell: ({ row }) =>
`${getServerName(row.original.server_id)}:${getServerAddress(row.original.server_id)}`,
},
{
id: 'server_id',
header: ` ${t('protocol')}:${t('port')}`,
cell: ({ row }) =>
`${row.original.protocol}:${getProtocolPort(row.original.server_id, row.original.protocol)}`,
},
{
accessorKey: 'tags',
+3
View File
@@ -58,6 +58,9 @@ export default function Page() {
accessorKey: 'subscribe_id',
header: t('subscribe'),
cell: ({ row }) => {
if (row.original.type === 4) {
return t(`type.${row.getValue('type')}`);
}
const name = getSubscribeName(row.getValue('subscribe_id'));
const quantity = row.original.quantity;
return name ? `${name} × ${quantity}` : '';
@@ -15,6 +15,7 @@ import {
SheetTrigger,
} from '@workspace/ui/components/sheet';
import { formatBytes } from '@workspace/ui/utils';
import { Users } from 'lucide-react';
import { useTranslations } from 'next-intl';
import { useState } from 'react';
@@ -92,8 +93,7 @@ export default function OnlineUsersCell({ status }: { status?: API.ServerStatus
<Sheet open={open} onOpenChange={setOpen}>
<SheetTrigger asChild>
<button className='hover:text-foreground text-muted-foreground flex items-center gap-2 bg-transparent p-0 text-sm'>
<Badge variant='secondary'>{status?.online.length}</Badge>
<span>{t('onlineUsers')}</span>
<Users className='h-4 w-4' /> {status?.online.length}
</button>
</SheetTrigger>
<SheetContent className='h-screen w-screen max-w-none sm:h-auto sm:w-[900px] sm:max-w-[90vw]'>
@@ -293,7 +293,7 @@ export default function ServerConfig() {
{t('config.dynamicMultiplierDescription')}
</p>
<div className='flex flex-col-reverse gap-8 md:flex-row md:items-start'>
<div className='flex flex-col-reverse gap-2 md:flex-row md:items-start'>
<div className='w-full md:w-1/2'>
<ArrayInput<API.TimePeriod>
fields={[
@@ -324,10 +324,7 @@ export default function ServerConfig() {
</div>
<div className='w-full md:w-1/2'>
<ChartContainer
config={chartConfig}
className='mx-auto aspect-[4/3] max-w-[400px]'
>
<ChartContainer config={chartConfig} className='mx-auto aspect-[5/3] w-full'>
<PieChart>
<Pie
data={chartTimeSlots}
@@ -189,19 +189,6 @@ export const subscribeSchema = {
type: 'boolean',
description: 'Whether this protocol is enabled',
},
// Node metadata
Country: {
type: 'string',
description: 'Node country',
},
City: {
type: 'string',
description: 'Node city',
},
Ratio: {
type: 'number',
description: 'Traffic ratio multiplier',
},
// UUID for vmess/vless
UUID: {
type: 'string',
+1
View File
@@ -60,6 +60,7 @@ export default function Page() {
return (
<ProTable<API.User, API.GetUserListParams>
key={initialFilters.user_id}
action={ref}
initialFilters={initialFilters}
header={{
+18 -4
View File
@@ -9,6 +9,8 @@ interface NodeState {
// Loading states
loading: boolean;
loadingTags: boolean;
loaded: boolean;
loadedTags: boolean;
// Actions
fetchNodes: () => Promise<void>;
@@ -30,6 +32,8 @@ export const useNodeStore = create<NodeState>((set, get) => ({
tags: [],
loading: false,
loadingTags: false,
loaded: false,
loadedTags: false,
// Actions
fetchNodes: async () => {
@@ -38,9 +42,13 @@ export const useNodeStore = create<NodeState>((set, get) => ({
set({ loading: true });
try {
const { data } = await filterNodeList({ page: 1, size: 999999999 });
set({ nodes: data?.data?.list || [] });
set({
nodes: data?.data?.list || [],
loaded: true,
});
} catch (error) {
// Handle error silently
set({ loaded: true });
} finally {
set({ loading: false });
}
@@ -52,9 +60,13 @@ export const useNodeStore = create<NodeState>((set, get) => ({
set({ loadingTags: true });
try {
const { data } = await queryNodeTag();
set({ tags: data?.data?.tags || [] });
set({
tags: data?.data?.tags || [],
loadedTags: true,
});
} catch (error) {
// Handle error silently
set({ loadedTags: true });
} finally {
set({ loadingTags: false });
}
@@ -104,10 +116,10 @@ export const useNode = () => {
const store = useNodeStore();
// Auto-fetch nodes and tags
if (store.nodes.length === 0 && !store.loading) {
if (!store.loaded && !store.loading) {
store.fetchNodes();
}
if (store.tags.length === 0 && !store.loadingTags) {
if (!store.loadedTags && !store.loadingTags) {
store.fetchTags();
}
@@ -116,6 +128,8 @@ export const useNode = () => {
tags: store.tags,
loading: store.loading,
loadingTags: store.loadingTags,
loaded: store.loaded,
loadedTags: store.loadedTags,
fetchNodes: store.fetchNodes,
fetchTags: store.fetchTags,
getNodeById: store.getNodeById,
+9 -2
View File
@@ -7,6 +7,7 @@ interface ServerState {
// Loading states
loading: boolean;
loaded: boolean;
// Actions
fetchServers: () => Promise<void>;
@@ -24,6 +25,7 @@ export const useServerStore = create<ServerState>((set, get) => ({
// Initial state
servers: [],
loading: false,
loaded: false,
// Actions
fetchServers: async () => {
@@ -32,9 +34,13 @@ export const useServerStore = create<ServerState>((set, get) => ({
set({ loading: true });
try {
const { data } = await filterServerList({ page: 1, size: 999999999 });
set({ servers: data?.data?.list || [] });
set({
servers: data?.data?.list || [],
loaded: true,
});
} catch (error) {
// Handle error silently
set({ loaded: true });
} finally {
set({ loading: false });
}
@@ -84,13 +90,14 @@ export const useServer = () => {
const store = useServerStore();
// Auto-fetch servers
if (store.servers.length === 0 && !store.loading) {
if (!store.loaded && !store.loading) {
store.fetchServers();
}
return {
servers: store.servers,
loading: store.loading,
loaded: store.loaded,
fetchServers: store.fetchServers,
getServerById: store.getServerById,
getServerName: store.getServerName,
+10 -3
View File
@@ -7,6 +7,7 @@ interface SubscribeState {
// Loading states
loading: boolean;
loaded: boolean;
// Actions
fetchSubscribes: () => Promise<void>;
@@ -20,6 +21,7 @@ export const useSubscribeStore = create<SubscribeState>((set, get) => ({
// Initial state
subscribes: [],
loading: false,
loaded: false,
// Actions
fetchSubscribes: async () => {
@@ -28,9 +30,13 @@ export const useSubscribeStore = create<SubscribeState>((set, get) => ({
set({ loading: true });
try {
const { data } = await getSubscribeList({ page: 1, size: 999999999 });
set({ subscribes: data?.data?.list || [] });
set({
subscribes: data?.data?.list || [],
loaded: true,
});
} catch (error) {
// Handle error silently
set({ loaded: true });
} finally {
set({ loading: false });
}
@@ -38,7 +44,7 @@ export const useSubscribeStore = create<SubscribeState>((set, get) => ({
// Getters
getSubscribeName: (subscribeId?: number) => {
if (!subscribeId) return 'Unknown';
if (!subscribeId) return '--';
const subscribe = get().subscribes.find((s) => s.id === subscribeId);
return subscribe?.name ?? `Subscribe ${subscribeId}`;
},
@@ -52,13 +58,14 @@ export const useSubscribe = () => {
const store = useSubscribeStore();
// Auto-fetch subscribes
if (store.subscribes.length === 0 && !store.loading) {
if (!store.loaded && !store.loading) {
store.fetchSubscribes();
}
return {
subscribes: store.subscribes,
loading: store.loading,
loaded: store.loaded,
fetchSubscribes: store.fetchSubscribes,
getSubscribeName: store.getSubscribeName,
getSubscribeById: store.getSubscribeById,
@@ -5,6 +5,7 @@ import { queryAnnouncement } from '@/services/user/announcement';
import { useQuery } from '@tanstack/react-query';
import { Timeline } from '@workspace/ui/components/timeline';
import { Markdown } from '@workspace/ui/custom-components/markdown';
import { formatDate } from '@workspace/ui/utils';
export default function Page() {
const { data } = useQuery({
@@ -23,8 +24,8 @@ export default function Page() {
<Timeline
data={
data.map((item) => ({
title: item.title,
content: <Markdown>{item.content}</Markdown>,
title: String(formatDate(item.created_at, false)),
content: <Markdown>{`### ${item.title}\n${item.content}`}</Markdown>,
})) || []
}
/>
@@ -1,5 +1,6 @@
'use client';
import { Empty } from '@/components/empty';
import { NEXT_PUBLIC_HIDDEN_TUTORIAL_DOCUMENT } from '@/config/constants';
import { queryDocumentList } from '@/services/user/document';
import { getTutorialList } from '@/utils/tutorial';
@@ -34,7 +35,7 @@ export default function Page() {
},
enabled: NEXT_PUBLIC_HIDDEN_TUTORIAL_DOCUMENT !== 'true',
});
if (!DocumentList && !TutorialList) return <Empty />;
return (
<div className='space-y-4'>
{DocumentList?.length > 0 && (
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ppanel-web",
"version": "1.4.5",
"version": "1.4.7",
"private": true,
"homepage": "https://github.com/perfect-panel/ppanel-web",
"bugs": {