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 dda297a commit 1abcbfd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
17 changes: 13 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ watch(
)
const backgroundImage = computed(() => {
if (!customBackgroundURL.value) {
return ''
}
if (customBackgroundURL.value.includes(LOCAL_IMAGE)) {
return backgroundInDB.value
return `background-image: url('${backgroundInDB.value}');`
}
return customBackgroundURL.value + `?v=${date}`
return `background-image: url('${customBackgroundURL.value}?v=${date}');`
})
const isPreferredDark = useMediaQuery('(prefers-color-scheme: dark)')
Expand Down Expand Up @@ -74,8 +78,13 @@ onMounted(() => {
<div
ref="app"
id="app-content"
:class="`flex h-dvh w-screen overflow-x-hidden bg-base-100 ${fontClassName} custom-background-${dashboardTransparent} ${customBackgroundURL && 'custom-background bg-cover bg-center'}`"
:style="`background-image: url('${backgroundImage}');`"
:class="[
'flex h-dvh w-screen overflow-x-hidden bg-base-100',
fontClassName,
backgroundImage &&
`custom-background-${dashboardTransparent} custom-background bg-cover bg-center`,
]"
:style="backgroundImage"
>
<RouterView />
<div
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 1abcbfd

Please sign in to comment.