Skip to content

Commit

Permalink
feat: add allow-lan (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
Y4er authored Dec 3, 2023
1 parent 1e736e7 commit aa4d1d9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default {
version: 'Version',
expire: 'Expire',
noExpire: 'Null',
allowLan: 'Allow Lan',
enableTunDevice: 'Enable TUN Device',
tunModeStack: 'TUN Mode Stack',
tunDeviceName: 'TUN Device Name',
Expand Down
1 change: 1 addition & 0 deletions src/i18n/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export default {
version: '版本',
expire: '到期时间',
noExpire: '不限时',
allowLan: '允许局域网访问',
enableTunDevice: '开启 TUN 转发',
tunModeStack: 'TUN 模式堆栈',
tunDeviceName: 'TUN 设备名称',
Expand Down
20 changes: 20 additions & 0 deletions src/pages/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,26 @@ const ConfigForm: Component<{ backendVersion: Accessor<string> }> = ({
</form>

<div class="grid grid-cols-2 gap-2 sm:grid-cols-4">
<div class="form-control">
<label for="enable-allow-lan" class="label gap-2">
<span class="label-text">{t('allowLan')}</span>
</label>

<input
id="enable-allow-lan"
type="checkbox"
class="toggle"
checked={configsData()?.['allow-lan']}
onChange={(e) =>
void updateBackendConfigAPI(
'allow-lan',
e.target.checked,
refetch,
)
}
/>
</div>

<div class="form-control">
<label for="enable-tun-device" class="label gap-2">
<span class="label-text">{t('enableTunDevice')}</span>
Expand Down

0 comments on commit aa4d1d9

Please sign in to comment.