Skip to content

Commit

Permalink
fix: style
Browse files Browse the repository at this point in the history
  • Loading branch information
Zephyruso committed Jan 24, 2025
1 parent e903d7b commit a0309d0
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 15 deletions.
3 changes: 3 additions & 0 deletions src/components/common/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
type="text"
class="input input-sm join-item input-bordered w-full"
:placeholder="placeholder || ''"
@touchstart.stop
@touchmove.stop
@touchend.stop
/>
<XMarkIcon
v-if="!beforeClose"
Expand Down
9 changes: 6 additions & 3 deletions src/components/proxies/ProxyNodeCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@

<div class="flex h-4 w-full items-center justify-between">
<span
:class="`whitespace-nowrap text-xs tracking-tight ${active ? 'text-primary-content' : 'text-base-content/60'}`"
:class="`truncate text-xs tracking-tight ${active ? 'text-primary-content' : 'text-base-content/60'}`"
@mouseenter="checkTruncation"
>
{{ typeDescription }}
</span>
<LatencyTag
:class="[isSmallCard && '!h-4 !w-8']"
:class="[isSmallCard && '!h-4 !w-8', 'shrink-0']"
:name="node.name"
:loading="isLatencyTesting"
:group-name="groupName"
Expand Down Expand Up @@ -65,7 +66,9 @@ const checkTruncation = (e: Event) => {
const { scrollWidth, clientWidth } = target
if (scrollWidth > clientWidth) {
showTip(e, target.innerText)
showTip(e, target.innerText, {
delay: [500, 0],
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/ConnectionCtrl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default defineComponent({
const sortForCards = (
<div class={['flex w-full items-center gap-1 text-sm', props.horizontal && 'md:w-auto']}>
<span class="shrink-0">{t('sortBy')}</span>
<div class="join flex-1">
<div class="join flex-1 max-md:w-0">
<select
class="join-item select select-bordered select-sm flex-1 max-md:w-0"
v-model={connectionSortType.value}
Expand Down
2 changes: 1 addition & 1 deletion src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export enum FONTS {
}

export enum CONNECTIONS_TABLE_ACCESSOR_KEY {
Details = 'details',
Close = 'close',
Type = 'type',
Process = 'process',
Expand All @@ -40,6 +39,7 @@ export enum CONNECTIONS_TABLE_ACCESSOR_KEY {
SourcePort = 'sourcePort',
SniffHost = 'sniffHost',
Destination = 'destination',
Details = 'details',
}

export enum TABLE_WIDTH_MODE {
Expand Down
2 changes: 1 addition & 1 deletion src/helper/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export const useTooltip = () => {
animation: 'scale',
appendTo: appContent,
allowHTML: true,
showOnCreate: true,
onHidden: () => {
tippyInstance?.destroy()
tippyInstance = null
},
...config,
})
tippyInstance.show()
}

return {
Expand Down
2 changes: 1 addition & 1 deletion src/store/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const speedtestUrl = useStorage<string>(
'http://www.gstatic.com/generate_204',
)
export const independentLatencyTest = useStorage('config/independent-latency-test', false)
export const speedtestTimeout = useStorage<number>('config/speedtest-timeout', 3000)
export const speedtestTimeout = useStorage<number>('config/speedtest-timeout', 5000)
export const proxySortType = useStorage<PROXY_SORT_TYPE>(
'config/proxy-sort-type',
PROXY_SORT_TYPE.DEFAULT,
Expand Down
5 changes: 4 additions & 1 deletion src/views/ConnectionsPage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<div class="size-full overflow-x-hidden">
<div
class="size-full overflow-x-hidden"
:class="{ 'pb-1': useConnectionCard }"
>
<ConnectionCardList
v-if="useConnectionCard"
class="overflow-x-hidden p-2"
Expand Down
8 changes: 5 additions & 3 deletions src/views/LogsPage.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<template>
<div class="size-full overflow-x-hidden">
<div class="size-full overflow-x-hidden pb-1">
<template v-if="!renderLogs.length">
<div class="card m-2 flex-row p-2 text-sm">
{{ $t('noContent') }}
</div>
</template>
<VirtualScroller
v-else
:data="renderLogs"
:size="64"
:size="isMiddleScreen ? 96 : 64"
class="p-2"
>
<template v-slot="{ item }: { item: LogWithSeq }">
<div class="card mb-1 block p-2 text-sm">
<div class="card mb-1 block break-all p-2 text-sm">
<span>{{ item.seq }}</span>
<span class="mx-2 text-primary">
{{ dayjs(item.time).locale(language).format('HH:mm:ss') }}
Expand All @@ -29,6 +30,7 @@
<script setup lang="ts">
import VirtualScroller from '@/components/common/VirtualScroller.vue'
import { LOG_LEVEL } from '@/config'
import { isMiddleScreen } from '@/helper/utils'
import { logFilter, logs } from '@/store/logs'
import { language } from '@/store/settings'
import type { LogWithSeq } from '@/types'
Expand Down
12 changes: 8 additions & 4 deletions src/views/SetupPage.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template>
<div
class="flex h-full w-full items-center justify-center bg-base-200/40"
class="h-full w-full items-center justify-center overflow-auto bg-base-200/40 sm:flex"
@keydown.enter="handleSubmit(form)"
>
<div class="absolute right-4 top-4">
<div class="absolute right-4 top-4 max-sm:hidden">
<ImportSettings />
</div>
<div class="absolute bottom-4 right-4">
<div class="absolute bottom-4 right-4 max-sm:hidden">
<LanguageSelect />
</div>
<div class="card w-96 max-w-[90%] gap-2 px-6 py-2">
<div class="card mx-auto w-96 max-w-[90%] gap-2 px-6 py-2 max-sm:my-4">
<h1 class="text-2xl font-semibold">{{ $t('setup') }}</h1>
<div class="form-control">
<label class="label">
Expand Down Expand Up @@ -117,6 +117,10 @@
</div>
</template>
</Draggable>
<LanguageSelect class="mt-4 sm:hidden" />
<div class="absolute right-2 top-2 sm:hidden">
<ImportSettings />
</div>
</div>
</div>
</template>
Expand Down

0 comments on commit a0309d0

Please sign in to comment.