Skip to content

Commit 820cc5f

Browse files
committed
feat: add option to hide custom remarks
1 parent 3a74f9a commit 820cc5f

File tree

7 files changed

+64
-8
lines changed

7 files changed

+64
-8
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@mantine/nprogress": "^7.17.3",
4747
"@monaco-editor/react": "^4.7.0",
4848
"@paralleldrive/cuid2": "2.2.2",
49-
"@remnawave/backend-contract": "0.3.64",
49+
"@remnawave/backend-contract": "0.3.66",
5050
"@stablelib/base64": "^2.0.1",
5151
"@stablelib/x25519": "^2.0.1",
5252
"@tabler/icons-react": "^3.31.0",

public/locales/en/remnawave.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,5 +892,12 @@
892892
"remove-button": "Remove button",
893893
"button-link": "Button Link",
894894
"button-text": "Button Text"
895+
},
896+
"subscription-tabs": {
897+
"widget": {
898+
"show-custom-remarks": "Show custom remarks",
899+
"show-custom-remark-description-line-1": "Only for EXPIRED, LIMITED, DISABLED users.",
900+
"show-custom-remark-description-line-2": "If this setting is disabled – EXPIRED, LIMITED, DISABLED users will recieve acutal host list, instead of custom remark below."
901+
}
895902
}
896903
}

public/locales/fa/remnawave.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,5 +892,12 @@
892892
"remove-button": "Remove button",
893893
"button-link": "Button Link",
894894
"button-text": "Button Text"
895+
},
896+
"subscription-tabs": {
897+
"widget": {
898+
"show-custom-remark-description-line-1": "Only for EXPIRED, LIMITED, DISABLED users.",
899+
"show-custom-remark-description-line-2": "If this setting is disabled – EXPIRED, LIMITED, DISABLED users will recieve acutal host list, instead of custom remark below.",
900+
"show-custom-remarks": "Show custom remarks"
901+
}
895902
}
896-
}
903+
}

public/locales/ru/remnawave.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,5 +892,12 @@
892892
"remove-button": "Remove button",
893893
"button-link": "Button Link",
894894
"button-text": "Button Text"
895+
},
896+
"subscription-tabs": {
897+
"widget": {
898+
"show-custom-remark-description-line-1": "Только для EXPIRED, LIMITED, DISABLED пользователей.",
899+
"show-custom-remark-description-line-2": "Если эта настройка отключена – EXPIRED, LIMITED, DISABLED пользователи получат актуальный список хостов, вместо кастомных примечаний ниже.",
900+
"show-custom-remarks": "Отображать кастомное примечание"
901+
}
895902
}
896-
}
903+
}

src/widgets/dashboard/subscription-settings/settings/subscription-settings.widget.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ export const SubscriptionSettingsWidget = (props: IProps) => {
8080
limitedUsersRemarks: subscriptionSettings.limitedUsersRemarks,
8181
disabledUsersRemarks: subscriptionSettings.disabledUsersRemarks,
8282
serveJsonAtBaseSubscription: subscriptionSettings.serveJsonAtBaseSubscription,
83-
addUsernameToBaseSubscription: subscriptionSettings.addUsernameToBaseSubscription
83+
addUsernameToBaseSubscription: subscriptionSettings.addUsernameToBaseSubscription,
84+
isShowCustomRemarks: subscriptionSettings.isShowCustomRemarks
8485
})
8586
}
8687
}, [subscriptionSettings])

src/widgets/dashboard/subscription-settings/settings/subscription-tabs.widget.tsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,40 @@ export const SubscriptionTabs = ({
386386
</Group>
387387
</Card.Section>
388388

389+
<Card.Section p="md" pt="xl" withBorder>
390+
<Grid>
391+
<Grid.Col span={{ xs: 12, sm: 6 }}>
392+
<Box mb="md">
393+
<Checkbox
394+
key={form.key('isShowCustomRemarks')}
395+
label={t(
396+
'subscription-tabs.widget.show-custom-remarks'
397+
)}
398+
size="md"
399+
{...form.getInputProps('isShowCustomRemarks', {
400+
type: 'checkbox'
401+
})}
402+
/>
403+
<Text
404+
c="dimmed"
405+
component="div"
406+
ml={30}
407+
pl={'0.4rem'}
408+
size="sm"
409+
>
410+
{t(
411+
'subscription-tabs.widget.show-custom-remark-description-line-1'
412+
)}
413+
<br />
414+
{t(
415+
'subscription-tabs.widget.show-custom-remark-description-line-2'
416+
)}
417+
</Text>
418+
</Box>
419+
</Grid.Col>
420+
</Grid>
421+
</Card.Section>
422+
389423
<Card.Section p="md" pt="xl">
390424
<Grid>
391425
<Grid.Col span={{ xs: 12, sm: 6, md: 4 }}>

0 commit comments

Comments
 (0)