MCPcopy Create free account
hub / github.com/apache/cloudstack / applyCustomGuiTheme

Function applyCustomGuiTheme

ui/src/utils/guiTheme.js:21–45  ·  view source on GitHub ↗
(accountid, domainid)

Source from the content-addressed store, hash-verified

19import { getAPI } from '@/api'
20
21export async function applyCustomGuiTheme (accountid, domainid) {
22 await fetch('config.json').then(response => response.json()).then(config => {
23 vueProps.$config = config
24 })
25
26 let guiTheme
27
28 if (accountid != null) {
29 guiTheme = await fetchGuiTheme({ accountid: accountid })
30 }
31
32 if (guiTheme === undefined && domainid != null) {
33 guiTheme = await fetchGuiTheme({ domainid: domainid })
34 }
35
36 if (guiTheme === undefined) {
37 guiTheme = await fetchGuiTheme({ commonname: window.location.hostname })
38 }
39
40 if (guiTheme === undefined) {
41 guiTheme = await fetchGuiTheme({ listonlydefaulttheme: true })
42 }
43
44 await applyDynamicCustomization(guiTheme)
45}
46
47async function fetchGuiTheme (params) {
48 return await getAPI('listGuiThemes', params).then(response => {

Callers 2

main.jsFile · 0.90
GetInfoFunction · 0.90

Calls 2

fetchGuiThemeFunction · 0.85

Tested by

no test coverage detected