Compare commits

...

2 Commits

Author SHA1 Message Date
semantic-release-bot ec1e402419 🔖 chore(release): v1.5.1 [skip ci]
## [1.5.1](https://github.com/perfect-panel/ppanel-web/compare/v1.5.0...v1.5.1) (2025-09-28)

### 🐛 Bug Fixes

* Simplify protocol enable checks by removing unnecessary false comparisons ([4828700](https://github.com/perfect-panel/ppanel-web/commit/4828700))
2025-09-28 16:24:12 +00:00
web 4828700776 🐛 fix: Simplify protocol enable checks by removing unnecessary false comparisons 2025-09-28 09:19:54 -07:00
5 changed files with 13 additions and 7 deletions
+7
View File
@@ -1,6 +1,13 @@
<a name="readme-top"></a>
# Changelog
## [1.5.1](https://github.com/perfect-panel/ppanel-web/compare/v1.5.0...v1.5.1) (2025-09-28)
### 🐛 Bug Fixes
* Simplify protocol enable checks by removing unnecessary false comparisons ([4828700](https://github.com/perfect-panel/ppanel-web/commit/4828700))
# [1.5.0](https://github.com/perfect-panel/ppanel-web/compare/v1.4.8...v1.5.0) (2025-09-28)
+1 -3
View File
@@ -155,9 +155,7 @@ export default function ServersPage() {
accessorKey: 'protocols',
header: t('protocols'),
cell: ({ row }) => {
const list = row.original.protocols.filter(
(p) => p.enable !== false,
) as API.Protocol[];
const list = row.original.protocols.filter((p) => p.enable) as API.Protocol[];
if (!list.length) return '—';
return (
<div className='flex flex-col gap-1'>
@@ -492,7 +492,7 @@ export default function ServerForm(props: {
PROTOCOLS.findIndex((t) => t === type),
);
const current = (protocolsValues[i] || {}) as Record<string, any>;
const isEnabled = current?.enable !== false;
const isEnabled = current?.enable;
const fields = PROTOCOL_FIELDS[type] || [];
return (
<AccordionItem key={type} value={type} className='mb-2 rounded-lg border'>
@@ -529,7 +529,8 @@ export default function ServerForm(props: {
checked={!!isEnabled}
disabled={Boolean(
initialValues?.id &&
isProtocolUsedInNodes(initialValues?.id || 0, type),
isProtocolUsedInNodes(initialValues?.id || 0, type) &&
isEnabled,
)}
onCheckedChange={(checked) => {
form.setValue(`protocols.${i}.enable`, checked);
+1 -1
View File
@@ -65,7 +65,7 @@ export const useServerStore = create<ServerState>((set, get) => ({
getServerEnabledProtocols: (serverId: number) => {
const server = get().servers.find((s) => s.id === serverId);
return server?.protocols?.filter((p) => p.enable !== false) || [];
return server?.protocols?.filter((p) => p.enable) || [];
},
getProtocolPort: (serverId?: number, protocol?: string) => {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ppanel-web",
"version": "1.5.0",
"version": "1.5.1",
"private": true,
"homepage": "https://github.com/perfect-panel/ppanel-web",
"bugs": {