(accountid, domainid)
| 19 | import { getAPI } from '@/api' |
| 20 | |
| 21 | export 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 | |
| 47 | async function fetchGuiTheme (params) { |
| 48 | return await getAPI('listGuiThemes', params).then(response => { |
no test coverage detected