mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
fix: misc
This commit is contained in:
parent
837e92789a
commit
7f867e38e9
7 changed files with 12 additions and 62 deletions
|
@ -114,6 +114,7 @@ onMounted(() => {
|
|||
<HistoryConsole />
|
||||
|
||||
<!-- FOOTER -->
|
||||
<div class="mt-4" />
|
||||
<footer class="py-3 mt-auto">
|
||||
<nav>
|
||||
<BNav class="justify-content-center">
|
||||
|
@ -185,7 +186,6 @@ header {
|
|||
footer {
|
||||
border-top: $thin-border;
|
||||
font-size: $font-size-sm;
|
||||
margin-top: 2rem;
|
||||
|
||||
.nav-item {
|
||||
& + .nav-item a::before {
|
||||
|
|
|
@ -54,7 +54,7 @@ const class_ = computed(() => {
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.card-collapse {
|
||||
.card-header {
|
||||
:deep(.card-header) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,6 +92,5 @@ const root = () =>
|
|||
</script>
|
||||
|
||||
<template>
|
||||
{{ busy }}
|
||||
<root />
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { UnwrapRef } from 'vue'
|
||||
|
||||
import i18n from '@/i18n'
|
||||
import type { Obj } from '@/types/commons'
|
||||
|
||||
/**
|
||||
|
@ -26,7 +25,7 @@ export function timeout<T extends unknown>(
|
|||
*
|
||||
* @param value - Anything.
|
||||
*/
|
||||
export function isObjectLiteral(value: any): value is object {
|
||||
export function isObjectLiteral(value: any): value is Obj {
|
||||
return (
|
||||
value !== null &&
|
||||
value !== undefined &&
|
||||
|
@ -59,52 +58,6 @@ export function isEmptyValue(
|
|||
)
|
||||
}
|
||||
|
||||
type Flatten<T extends object> = object extends T
|
||||
? object
|
||||
: {
|
||||
[K in keyof T]-?: (
|
||||
x: NonNullable<T[K]> extends infer V
|
||||
? V extends object
|
||||
? V extends readonly any[]
|
||||
? Pick<T, K>
|
||||
: Flatten<V> extends infer FV
|
||||
? {
|
||||
[P in keyof FV as `${Extract<P, string | number>}`]: FV[P]
|
||||
}
|
||||
: never
|
||||
: Pick<T, K>
|
||||
: never,
|
||||
) => void
|
||||
} extends Record<keyof T, (y: infer O) => void>
|
||||
? O extends infer U
|
||||
? { [K in keyof O]: O[K] }
|
||||
: never
|
||||
: never
|
||||
|
||||
/**
|
||||
* Returns an flattened object literal, with all keys at first level and removing nested ones.
|
||||
*
|
||||
* @param obj - An object literal to flatten.
|
||||
* @param flattened - An object literal to add passed obj keys/values.
|
||||
*/
|
||||
export function flattenObjectLiteral<T extends object>(
|
||||
obj: T,
|
||||
flattened: Partial<Flatten<T>> = {},
|
||||
) {
|
||||
function flatten(objLit: Partial<Flatten<T>>) {
|
||||
for (const key in objLit) {
|
||||
const value = objLit[key]
|
||||
if (isObjectLiteral(value)) {
|
||||
flatten(value)
|
||||
} else {
|
||||
flattened[key] = value
|
||||
}
|
||||
}
|
||||
}
|
||||
flatten(obj)
|
||||
return flattened as Flatten<T>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an new Object filtered with passed filter function.
|
||||
* Each entry `[key, value]` will be forwarded to the `filter` function.
|
||||
|
@ -218,7 +171,3 @@ export function omit<T extends Obj, K extends (keyof T)[]>(
|
|||
.map((key) => [key, obj[key]]),
|
||||
) as Omit<T, K[number]>
|
||||
}
|
||||
|
||||
export function asUnreffed<T>(value: T): UnwrapRef<T> {
|
||||
return value as UnwrapRef<T>
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ const name = helpers.regex(
|
|||
new RegExp(`^(?:[A-Za-z${nonAsciiWordCharacters}]{1,30}[ ,.'-]{0,3})+$`),
|
||||
)
|
||||
|
||||
const unique = (items: MaybeRef<any[]>) =>
|
||||
const unique = (items: MaybeRef<any[] | null>) =>
|
||||
helpers.withParams({ type: 'unique', arg: toValue(items) }, (item) => {
|
||||
const items_ = toValue(items)
|
||||
return items_ ? !helpers.req(item) || !items_.includes(item) : true
|
||||
|
|
|
@ -51,10 +51,10 @@ router.beforeEach((to, from, next) => {
|
|||
}
|
||||
})
|
||||
|
||||
router.afterEach((to, from) => {
|
||||
router.afterEach((to) => {
|
||||
const { updateRouterKey, updateBreadcrumb } = useInfos()
|
||||
updateRouterKey({ to, from })
|
||||
updateBreadcrumb({ to, from })
|
||||
updateRouterKey(to)
|
||||
updateBreadcrumb(to)
|
||||
})
|
||||
|
||||
export default router
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import type { StateVariant } from '@/types/commons'
|
||||
|
||||
export type UserItem = {
|
||||
username: string
|
||||
fullname: string
|
||||
|
@ -31,9 +33,9 @@ export type DomainDetail = {
|
|||
certificate: {
|
||||
subject: string
|
||||
CA_name: string
|
||||
CA_type: string // enumlike
|
||||
CA_type: 'selfsigned' | 'letsencrypt' | 'other'
|
||||
validity: number
|
||||
style: string // enumlike
|
||||
style: Exclude<StateVariant, 'info'>
|
||||
summary: string // enum
|
||||
ACME_eligible: boolean
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue