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

Function applyDynamicCustomization

ui/src/utils/guiTheme.js:58–89  ·  view source on GitHub ↗
(response)

Source from the content-addressed store, hash-verified

56}
57
58async function applyDynamicCustomization (response) {
59 let jsonConfig
60
61 if (response?.jsonconfiguration) {
62 jsonConfig = JSON.parse(response?.jsonconfiguration)
63 }
64
65 // Sets custom GUI fields only if is not nullish.
66 vueProps.$config.appTitle = jsonConfig?.appTitle ?? vueProps.$config.appTitle
67 vueProps.$config.footer = jsonConfig?.footer ?? vueProps.$config.footer
68 vueProps.$config.loginFooter = jsonConfig?.loginFooter ?? vueProps.$config.loginFooter
69 vueProps.$config.logo = jsonConfig?.logo ?? vueProps.$config.logo
70 vueProps.$config.minilogo = jsonConfig?.minilogo ?? vueProps.$config.minilogo
71 vueProps.$config.banner = jsonConfig?.banner ?? vueProps.$config.banner
72
73 if (jsonConfig?.error) {
74 vueProps.$config.error[403] = jsonConfig?.error[403] ?? vueProps.$config.error[403]
75 vueProps.$config.error[404] = jsonConfig?.error[404] ?? vueProps.$config.error[404]
76 vueProps.$config.error[500] = jsonConfig?.error[500] ?? vueProps.$config.error[500]
77 }
78
79 if (jsonConfig?.plugins) {
80 jsonConfig.plugins.forEach(plugin => {
81 vueProps.$config.plugins.push(plugin)
82 })
83 }
84
85 vueProps.$config.favicon = jsonConfig?.favicon ?? vueProps.$config.favicon
86 vueProps.$config.css = response?.css ?? null
87
88 await applyStaticCustomization(vueProps.$config.favicon, vueProps.$config.css)
89}
90
91async function applyStaticCustomization (favicon, css) {
92 document.getElementById('favicon').href = favicon

Callers 1

applyCustomGuiThemeFunction · 0.85

Calls 2

applyStaticCustomizationFunction · 0.85
parseMethod · 0.65

Tested by

no test coverage detected