fix: rules page && dns query for mobile

This commit is contained in:
Zephyruso 2023-09-02 18:04:57 +08:00
parent 0b50bcdf51
commit 86fd0d7d9d
2 changed files with 25 additions and 16 deletions

View File

@ -42,18 +42,21 @@ const DNSQueryForm = () => {
return ( return (
<div class="flex flex-col"> <div class="flex flex-col">
<form use:form={form} class="flex items-center gap-2"> <form use:form={form} class="flex flex-col gap-2 sm:flex-row">
<input name="name" class="input input-bordered flex-1" /> <input
name="name"
class="input input-bordered w-full max-w-xs sm:flex-1"
/>
<div class="flex items-center gap-2">
<select name="type" class="select select-bordered"> <select name="type" class="select select-bordered">
<option>A</option> <option>A</option>
<option>AAAA</option> <option>AAAA</option>
<option>MX</option> <option>MX</option>
</select> </select>
<button type="submit" class="btn btn-primary"> <button type="submit" class="btn btn-primary">
{t('dnsQuery')} {t('dnsQuery')}
</button> </button>
</div>
</form> </form>
<Show when={DNSQueryResult().length > 0}> <Show when={DNSQueryResult().length > 0}>

View File

@ -3,6 +3,7 @@ import { IconReload } from '@tabler/icons-solidjs'
import InfiniteScroll from 'solid-infinite-scroll' import InfiniteScroll from 'solid-infinite-scroll'
import { For, Show, createMemo, createSignal, onMount } from 'solid-js' import { For, Show, createMemo, createSignal, onMount } from 'solid-js'
import { useRules } from '~/signals/rules' import { useRules } from '~/signals/rules'
import { formatTimeFromNow } from '~/utils/proxies'
export default () => { export default () => {
const [t] = useI18n() const [t] = useI18n()
@ -50,7 +51,10 @@ export default () => {
> >
{(rule) => ( {(rule) => (
<div class="card card-bordered card-compact mb-2 bg-base-200 p-4"> <div class="card card-bordered card-compact mb-2 bg-base-200 p-4">
<div class="break-all">{rule.payload}</div> <div class="break-all">
{rule.payload}
{rule.size !== -1 && ` (${rule.size})`}
</div>
<div class="text-xs text-slate-500"> <div class="text-xs text-slate-500">
{rule.type} :: {rule.proxy} {rule.type} :: {rule.proxy}
</div> </div>
@ -75,7 +79,9 @@ export default () => {
{(rulesProvider) => ( {(rulesProvider) => (
<div class="card card-bordered card-compact mb-2 bg-base-200 p-4"> <div class="card card-bordered card-compact mb-2 bg-base-200 p-4">
<div class="flex h-6 items-center justify-between"> <div class="flex h-6 items-center justify-between">
<span>{rulesProvider.name}</span> <span>
{rulesProvider.name} ({rulesProvider.ruleCount})
</span>
<div> <div>
<button <button
class="btn btn-circle btn-sm mr-2" class="btn btn-circle btn-sm mr-2"
@ -88,8 +94,8 @@ export default () => {
</div> </div>
</div> </div>
<div class="text-xs text-slate-500"> <div class="text-xs text-slate-500">
{rulesProvider.vehicleType} :: {rulesProvider.behavior} ( {rulesProvider.vehicleType} / {rulesProvider.behavior} /
{rulesProvider.ruleCount}) Updated {formatTimeFromNow(rulesProvider.updatedAt)}
</div> </div>
</div> </div>
)} )}