mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-13 18:10:53 +08:00
【新增】百度云DNS解析功能和宝塔waf部署功能
【新增】本机部署方式 【修复】已知问题
This commit is contained in:
BIN
frontend/packages/.DS_Store
vendored
BIN
frontend/packages/.DS_Store
vendored
Binary file not shown.
@@ -19,6 +19,8 @@ export default defineComponent({
|
||||
const { locale } = useI18n() // 国际化
|
||||
const { naiveLocale, naiveDateLocale } = useNaiveI18nSync(locale) // i18n 同步
|
||||
const { theme, themeOverrides } = useTheme() // 主题
|
||||
|
||||
console.log(theme.value, themeOverrides.value)
|
||||
// 国际化配置
|
||||
return () => (
|
||||
<NConfigProvider
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineComponent, PropType } from 'vue'
|
||||
import { computed, defineComponent, PropType } from 'vue'
|
||||
import { NDropdown, NIcon, NButton } from 'naive-ui'
|
||||
import { Sunny, Moon } from '@vicons/ionicons5'
|
||||
|
||||
@@ -6,6 +6,8 @@ import { useTheme } from '../theme/index'
|
||||
import type { DropdownOption } from 'naive-ui'
|
||||
interface Props {
|
||||
type?: 'button' | 'link'
|
||||
size?: 'small' | 'medium' | 'large'
|
||||
text?: boolean
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
@@ -14,6 +16,14 @@ export default defineComponent({
|
||||
type: String as PropType<'button' | 'link'>,
|
||||
default: 'button',
|
||||
},
|
||||
size: {
|
||||
type: String as PropType<'small' | 'medium' | 'large'>,
|
||||
default: 'medium',
|
||||
},
|
||||
text: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
setup(props: Props) {
|
||||
const { isDark, cutDarkMode, themeActive } = useTheme()
|
||||
@@ -29,16 +39,29 @@ export default defineComponent({
|
||||
},
|
||||
]
|
||||
|
||||
const iconSize = computed(() => {
|
||||
return props.size === 'small' ? 16 : props.size === 'large' ? 24 : 20
|
||||
})
|
||||
|
||||
const buttonSize = computed(() => {
|
||||
return props.size === 'small' ? 'tiny' : props.size === 'large' ? 'large' : 'medium'
|
||||
})
|
||||
|
||||
const text = computed(() => {
|
||||
return !isDark.value ? '亮色模式' : '暗色模式'
|
||||
})
|
||||
|
||||
return () => (
|
||||
<NDropdown options={dropdownOptions} onSelect={() => cutDarkMode(true, this)} value={themeActive.value}>
|
||||
<div style={{ cursor: 'pointer', display: 'flex', alignItems: 'center' }}>
|
||||
{props.type === 'button' ? (
|
||||
<NButton quaternary strong circle type="primary">
|
||||
<NIcon size={20}>{isDark.value ? <Moon /> : <Sunny />}</NIcon>
|
||||
<NButton quaternary strong circle type="primary" size={buttonSize.value}>
|
||||
<NIcon size={iconSize.value}>{isDark.value ? <Moon /> : <Sunny />}</NIcon>
|
||||
</NButton>
|
||||
) : (
|
||||
<NIcon size={20}>{isDark.value ? <Moon /> : <Sunny />}</NIcon>
|
||||
<NIcon size={iconSize.value}>{isDark.value ? <Moon /> : <Sunny />}</NIcon>
|
||||
)}
|
||||
<span class="ml-[0.6rem]">{props.text && text.value}</span>
|
||||
</div>
|
||||
</NDropdown>
|
||||
)
|
||||
|
||||
@@ -73,7 +73,7 @@ const mountApps = (app: App, resources: any) => {
|
||||
// 自定义Modal钩子函数
|
||||
const useModal = (options: CustomModalOptions) => {
|
||||
const { theme, themeOverrides } = useTheme()
|
||||
|
||||
console.log(themeOverrides.value, theme.value)
|
||||
// 创建discreteModal实例 - 这个可以在任何地方使用
|
||||
const { modal, message, unmount, app } = createDiscreteApi(['modal', 'message'], {
|
||||
configProviderProps: { theme: theme.value, themeOverrides: themeOverrides.value },
|
||||
|
||||
@@ -39,7 +39,7 @@ export const useTheme = (name?: ThemeName) => {
|
||||
const themeActiveOverrides = ref<ThemeTemplate | null>(null)
|
||||
|
||||
// 是否暗黑
|
||||
|
||||
|
||||
// const isDark = useDark()
|
||||
|
||||
// 禁用自动切换暗色模式避免错误
|
||||
@@ -52,9 +52,7 @@ export const useTheme = (name?: ThemeName) => {
|
||||
|
||||
// 主题继承修改
|
||||
const themeOverrides = computed(() => {
|
||||
// 如果没有激活的主题,则返回空对象
|
||||
if (!themeActiveOverrides.value) return {}
|
||||
return themeActiveOverrides.value.themeOverrides || {}
|
||||
return themeActiveOverrides.value || {}
|
||||
})
|
||||
|
||||
// 预设配置
|
||||
@@ -62,7 +60,7 @@ export const useTheme = (name?: ThemeName) => {
|
||||
// 如果没有激活的主题,则返回空对象
|
||||
console.log('presetsOverrides', themeActiveOverrides.value)
|
||||
if (!themeActiveOverrides.value) return {}
|
||||
return themeActiveOverrides.value.presetsOverrides || {}
|
||||
return themeActiveOverrides.value || {}
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user