Skip to content

Commit

Permalink
fix: global for sing-box
Browse files Browse the repository at this point in the history
  • Loading branch information
Zephyruso committed Feb 19, 2025
1 parent 5cc577f commit 14027c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
8 changes: 7 additions & 1 deletion src/components/sidebar/LogsCtrl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ export default defineComponent({
const { t } = useI18n()
const settingsModel = ref(false)
const insertLogSearchHistory = debounce((log: string) => {
if (!log || logSearchHistory.value.includes(log)) {
if (!log) {
return
}

const idx = logSearchHistory.value.indexOf(log)

if (idx !== -1) {
logSearchHistory.value.splice(idx, 1)
}

logSearchHistory.value.unshift(log)
if (logSearchHistory.value.length > 5) {
logSearchHistory.value.pop()
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/ProxiesCtrl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default defineComponent({
key={mode}
value={mode}
>
{t(mode.toLowerCase()) || mode}
{t(mode.toLowerCase())}
</option>
)
})}
Expand Down
13 changes: 3 additions & 10 deletions src/composables/proxies.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isSingBox } from '@/api'
import { PROXY_TAB_TYPE } from '@/constant'
import { configs } from '@/store/config'
import {
Expand All @@ -24,19 +23,13 @@ const renderGroups = computed(() => {
return proxyProviederList.value.map((group) => group.name)
}

if (!isSingBox.value && configs.value?.mode.toUpperCase() === GLOBAL) {
if (configs.value?.mode.toUpperCase() === GLOBAL) {
return [GLOBAL]
}

const proxyGroups = [...proxyGroupList.value]

if (isSingBox.value) {
proxyGroups.push(GLOBAL)
}

return manageHiddenGroup.value
? proxyGroups
: proxyGroups.filter((name) => !hiddenGroupMap.value[name])
? proxyGroupList.value
: proxyGroupList.value.filter((name) => !hiddenGroupMap.value[name])
})

export const useProxies = () => {
Expand Down

0 comments on commit 14027c9

Please sign in to comment.