|
| 1 | +--- |
| 2 | +i18nReady: true |
| 3 | +title: Configuración del Panel de Control |
| 4 | +description: Página de referencia para dashboardConfig de StudioCMSOptions |
| 5 | +sidebar: |
| 6 | + order: 6 |
| 7 | +--- |
| 8 | + |
| 9 | +import ReadMore from '~/components/ReadMore.astro'; |
| 10 | + |
| 11 | +La configuración del esquema de opciones de la integración de StudioCMS |
| 12 | + |
| 13 | +```ts twoslash title="studiocms.config.mjs" |
| 14 | +import { defineStudioCMSConfig } from 'studiocms/config'; |
| 15 | +// ---cut--- |
| 16 | +export default defineStudioCMSConfig({ |
| 17 | + dashboardConfig: { |
| 18 | + dashboardEnabled: true, |
| 19 | + dashboardRouteOverride: 'dashboard', |
| 20 | + developerConfig: {}, |
| 21 | + faviconURL: '/favicon.svg', |
| 22 | + inject404Route: true, |
| 23 | + versionCheck: true, |
| 24 | + AuthConfig: {}, |
| 25 | + }, |
| 26 | +}); |
| 27 | +``` |
| 28 | + |
| 29 | +## `dashboardEnabled` |
| 30 | + |
| 31 | +`dashboardEnabled` es un booleano que se utiliza para determinar si el panel de control está habilitado. |
| 32 | + |
| 33 | +- **Tipo:** `boolean` |
| 34 | +- **Por defecto:** `true` |
| 35 | + |
| 36 | +### Uso |
| 37 | + |
| 38 | +```ts twoslash {3} title="studiocms.config.mjs" |
| 39 | +import { defineStudioCMSConfig } from 'studiocms/config'; |
| 40 | +// ---cut--- |
| 41 | +export default defineStudioCMSConfig({ |
| 42 | + dashboardConfig: { |
| 43 | + dashboardEnabled: true, // PREDETERMINADO - Esto habilita el panel de control. |
| 44 | + } |
| 45 | +}) |
| 46 | +``` |
| 47 | + |
| 48 | +## `DashboardRouteOverride` |
| 49 | + |
| 50 | +`DashboardRouteOverride` es un string que se utiliza para determinar la ruta para el panel de control. |
| 51 | + |
| 52 | +- **Tipo:** `string` |
| 53 | +- **Por defecto:** `'dashboard'` |
| 54 | + |
| 55 | +### Uso |
| 56 | + |
| 57 | +```ts twoslash {3} title="studiocms.config.mjs" |
| 58 | +import { defineStudioCMSConfig } from 'studiocms/config'; |
| 59 | +// ---cut--- |
| 60 | +export default defineStudioCMSConfig({ |
| 61 | + dashboardConfig: { |
| 62 | + dashboardRouteOverride: 'dashboard', // PREDETERMINADO - Esto establece la ruta del panel de control en /dashboard. |
| 63 | + } |
| 64 | +}) |
| 65 | +``` |
| 66 | + |
| 67 | +## `developerConfig` |
| 68 | + |
| 69 | +`developerConfig` es un objeto que se utiliza para configurar la configuración del desarrollador para el dashboard. |
| 70 | + |
| 71 | +### Uso |
| 72 | + |
| 73 | +```ts twoslash {3-5} title="studiocms.config.mjs" |
| 74 | +import { defineStudioCMSConfig } from 'studiocms/config'; |
| 75 | +// ---cut--- |
| 76 | +export default defineStudioCMSConfig({ |
| 77 | + dashboardConfig: { |
| 78 | + developerConfig: { |
| 79 | + testingAndDemoMode: false, // PREDETERMINADO - Esto deshabilita el modo de prueba y demostración. |
| 80 | + }, |
| 81 | + } |
| 82 | +}) |
| 83 | +``` |
| 84 | + |
| 85 | +## `faviconURL` |
| 86 | + |
| 87 | +`faviconURL` es un string que se utiliza para determinar la ruta al favicon para el panel de control. |
| 88 | + |
| 89 | +- **Tipo:** `string` |
| 90 | +- **Por defecto:** `'/favicon.svg'` |
| 91 | + |
| 92 | +### Uso |
| 93 | + |
| 94 | +```ts twoslash {3} title="studiocms.config.mjs" |
| 95 | +import { defineStudioCMSConfig } from 'studiocms/config'; |
| 96 | +// ---cut--- |
| 97 | +export default defineStudioCMSConfig({ |
| 98 | + dashboardConfig: { |
| 99 | + faviconURL: '/favicon.svg', // Predeterminado - Esto establece el favicon para el panel de control. |
| 100 | + } |
| 101 | +}) |
| 102 | +``` |
| 103 | + |
| 104 | +## `inject404Route` |
| 105 | + |
| 106 | +`inject404Route` es un booleano que se utiliza para determinar si se debe inyectar la ruta 404. |
| 107 | + |
| 108 | +- **Tipo:** `boolean` |
| 109 | +- **Por defecto:** `true` |
| 110 | + |
| 111 | +### Uso |
| 112 | + |
| 113 | +```ts twoslash {3} title="studiocms.config.mjs" |
| 114 | +import { defineStudioCMSConfig } from 'studiocms/config'; |
| 115 | +// ---cut--- |
| 116 | +export default defineStudioCMSConfig({ |
| 117 | + dashboardConfig: { |
| 118 | + inject404Route: true, // PREDETERMINADO - Esto inyecta la ruta 404. |
| 119 | + } |
| 120 | +}) |
| 121 | +``` |
| 122 | + |
| 123 | +## `versionCheck` |
| 124 | + |
| 125 | +`versionCheck` es un booleano que se utiliza para determinar si se debe habilitar la comprobación de versiones. |
| 126 | + |
| 127 | +- **Tipo:** `boolean` |
| 128 | +- **Por defecto:** `true` |
| 129 | + |
| 130 | +### Uso |
| 131 | + |
| 132 | +```ts twoslash {3} title="studiocms.config.mjs" |
| 133 | +import { defineStudioCMSConfig } from 'studiocms/config'; |
| 134 | +// ---cut--- |
| 135 | +export default defineStudioCMSConfig({ |
| 136 | + dashboardConfig: { |
| 137 | + versionCheck: true, // PREDETERMINADO - Esto habilita la comprobación de versiones. |
| 138 | + } |
| 139 | +}) |
| 140 | +``` |
| 141 | + |
| 142 | +## `AuthConfig` |
| 143 | + |
| 144 | +`AuthConfig` es un objeto que se utiliza para configurar la configuración de autenticación para el panel de control. |
| 145 | + |
| 146 | +### Uso |
| 147 | + |
| 148 | +```ts twoslash {3-5} title="studiocms.config.mjs" |
| 149 | +import { defineStudioCMSConfig } from 'studiocms/config'; |
| 150 | +// ---cut--- |
| 151 | +export default defineStudioCMSConfig({ |
| 152 | + dashboardConfig: { |
| 153 | + AuthConfig: { |
| 154 | + enabled: true, // PREDETERMINADO - Esto habilita la autenticación. |
| 155 | + }, |
| 156 | + } |
| 157 | +}) |
| 158 | +``` |
| 159 | + |
| 160 | +### `providers` |
| 161 | + |
| 162 | +`providers` es un objeto que se utiliza para configurar los proveedores de autenticación para el panel de control. |
| 163 | + |
| 164 | +- **Tipo:** [`AuthProviders`](#authprovider) |
| 165 | +- **Default:** `{}` |
| 166 | + |
| 167 | +#### Usage |
| 168 | + |
| 169 | +```ts twoslash {4-11} title="studiocms.config.mjs" |
| 170 | +import { defineStudioCMSConfig } from 'studiocms/config'; |
| 171 | +// ---cut--- |
| 172 | +export default defineStudioCMSConfig({ |
| 173 | + dashboardConfig: { |
| 174 | + AuthConfig: { |
| 175 | + providers: { |
| 176 | + google: true, |
| 177 | + github: true, |
| 178 | + discord: true, |
| 179 | + auth0: true, |
| 180 | + usernameAndPassword: true, |
| 181 | + usernameAndPasswordConfig: {}, |
| 182 | + }, |
| 183 | + }, |
| 184 | + }, |
| 185 | +}) |
| 186 | +``` |
| 187 | + |
| 188 | +#### `usernameAndPasswordConfig` |
| 189 | + |
| 190 | +`usernameAndPasswordConfig` es un objeto que se utiliza para configurar la configuración de nombre de usuario y contraseña para el panel de control. |
| 191 | + |
| 192 | +- **Tipo:** `{ allowUserRegistration?: boolean }` |
| 193 | +- **Por defecto:** `{}` |
| 194 | + |
| 195 | +##### Usage |
| 196 | + |
| 197 | +```ts twoslash {5-8} title="studiocms.config.mjs" |
| 198 | +import { defineStudioCMSConfig } from 'studiocms/config'; |
| 199 | +// ---cut--- |
| 200 | +export default defineStudioCMSConfig({ |
| 201 | + dashboardConfig: { |
| 202 | + AuthConfig: { |
| 203 | + providers: { |
| 204 | + usernameAndPassword: true, |
| 205 | + usernameAndPasswordConfig: { |
| 206 | + allowUserRegistration: true, // PREDETERMINADO - Esto permite el registro de usuarios. |
| 207 | + }, |
| 208 | + }, |
| 209 | + }, |
| 210 | + }, |
| 211 | +}) |
| 212 | +``` |
| 213 | + |
| 214 | +###### `AuthProvider` |
| 215 | + |
| 216 | +```ts |
| 217 | +type AuthProviders: { |
| 218 | + github?: boolean | undefined; |
| 219 | + discord?: boolean | undefined; |
| 220 | + google?: boolean | undefined; |
| 221 | + auth0?: boolean | undefined; |
| 222 | + usernameAndPassword?: boolean | undefined; |
| 223 | + usernameAndPasswordConfig?: { |
| 224 | + allowUserRegistration?: boolean | undefined; |
| 225 | + } | undefined; |
| 226 | +} | undefined |
| 227 | +``` |
0 commit comments