diff --git a/adminui/frontend/src/api/settings.ts b/adminui/frontend/src/api/settings.ts index dd86d063..3106bee0 100644 --- a/adminui/frontend/src/api/settings.ts +++ b/adminui/frontend/src/api/settings.ts @@ -1,4 +1,11 @@ -import type { GenericResponseDTO, MFAMethodDTO, LoginSettingsResponseDTO, GeneralSettingsResponseDTO } from './types' +import type { + GenericResponseDTO, + MFAMethodDTO, + LoginSettingsResponseDTO, + GeneralSettingsResponseDTO, + AcmeDetailsDTO, + WebServerConfigDTO +} from './types' import { client } from '.' @@ -21,3 +28,27 @@ export function updateLoginSettings(settings: LoginSettingsResponseDTO): Promise export function getMFAMethods(): Promise { return client.get('/api/settings/all_mfa_methods').then(res => res.data) } + +export function getWebservers(): Promise { + return client.get('/api/settings/webservers').then(res => res.data) +} + +export function editWebserver(webserver: WebServerConfigDTO): Promise { + return client.put('/api/settings/webserver', webserver).then(res => res.data) +} + +export function getAcmeDetails(): Promise { + return client.get('/api/settings/acme').then(res => res.data) +} + +export function setAcmeEmail(email: string): Promise { + return client.put('/api/settings/acme/email', { data: email }).then(res => res.data) +} + +export function setAcmeProvider(url: string): Promise { + return client.put('/api/settings/acme/provider_url', { data: url }).then(res => res.data) +} + +export function setAcmeCloudflareDNSKey(cloudflare_api_key: string): Promise { + return client.put('/api/settings/acme/cloudflare_api_key', { data: cloudflare_api_key }).then(res => res.data) +} diff --git a/adminui/frontend/src/api/types.ts b/adminui/frontend/src/api/types.ts index bc8358e4..f2439628 100644 --- a/adminui/frontend/src/api/types.ts +++ b/adminui/frontend/src/api/types.ts @@ -177,6 +177,12 @@ export interface LoginSettingsResponseDTO { pam: PamResponseDTO } +export interface AcmeDetailsDTO { + provider_url: string + email: string + api_token_set: boolean +} + export interface MFAMethodDTO { friendly_name: string method: string @@ -286,3 +292,10 @@ export enum NodeControlActions { Stepdown = 'stepdown', Remove = 'remove' } + +export interface WebServerConfigDTO { + server_name: string + listen_address: string + domain: string + tls: boolean +} diff --git a/adminui/frontend/src/layouts/default.vue b/adminui/frontend/src/layouts/default.vue index 963f34de..45c84f47 100644 --- a/adminui/frontend/src/layouts/default.vue +++ b/adminui/frontend/src/layouts/default.vue @@ -2,8 +2,6 @@ import { useRoute, useRouter } from 'vue-router' import { storeToRefs } from 'pinia' -import logo from '../../public/WagLogo.png' - import { useAuthStore } from '@/stores/auth' import { useInstanceDetailsStore } from '@/stores/serverInfo' @@ -70,7 +68,7 @@ async function logout() {