fix instance identity stuff
This commit is contained in:
parent
de13143e95
commit
3c45c223c7
2 changed files with 17 additions and 4 deletions
|
|
@ -42,6 +42,7 @@ import VBodyScrollLock from 'src/directives/body_scroll_lock'
|
||||||
import {
|
import {
|
||||||
INSTANCE_DEFAULT_CONFIG_DEFINITIONS,
|
INSTANCE_DEFAULT_CONFIG_DEFINITIONS,
|
||||||
INSTANCE_IDENTITY_DEFAULT_DEFINITIONS,
|
INSTANCE_IDENTITY_DEFAULT_DEFINITIONS,
|
||||||
|
INSTANCE_IDENTIY_EXTERNAL,
|
||||||
} from 'src/modules/default_config_state.js'
|
} from 'src/modules/default_config_state.js'
|
||||||
|
|
||||||
let staticInitialResults = null
|
let staticInitialResults = null
|
||||||
|
|
@ -170,12 +171,14 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
||||||
config = Object.assign({}, staticConfig, apiConfig)
|
config = Object.assign({}, staticConfig, apiConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.keys(INSTANCE_IDENTITY_DEFAULT_DEFINITIONS).forEach((source) =>
|
Object.keys(INSTANCE_IDENTITY_DEFAULT_DEFINITIONS).forEach((source) => {
|
||||||
|
if (source === 'name') return
|
||||||
|
if (INSTANCE_IDENTIY_EXTERNAL.has(source)) return
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
value: config[source],
|
value: config[source],
|
||||||
path: `instanceIdentity.${source}`,
|
path: `instanceIdentity.${source}`,
|
||||||
}),
|
})
|
||||||
)
|
})
|
||||||
|
|
||||||
Object.keys(INSTANCE_DEFAULT_CONFIG_DEFINITIONS).forEach((source) =>
|
Object.keys(INSTANCE_DEFAULT_CONFIG_DEFINITIONS).forEach((source) =>
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
|
|
@ -277,7 +280,7 @@ const getNodeInfo = async ({ store }) => {
|
||||||
const metadata = data.metadata
|
const metadata = data.metadata
|
||||||
const features = metadata.features
|
const features = metadata.features
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
path: 'name',
|
path: 'instanceIdentity.name',
|
||||||
value: metadata.nodeName,
|
value: metadata.nodeName,
|
||||||
})
|
})
|
||||||
useInstanceStore().set({
|
useInstanceStore().set({
|
||||||
|
|
@ -527,6 +530,7 @@ const afterStoreSetup = async ({ pinia, store, storageError, i18n }) => {
|
||||||
|
|
||||||
useInterfaceStore().setLayoutWidth(windowWidth())
|
useInterfaceStore().setLayoutWidth(windowWidth())
|
||||||
useInterfaceStore().setLayoutHeight(windowHeight())
|
useInterfaceStore().setLayoutHeight(windowHeight())
|
||||||
|
|
||||||
window.syncConfig = useSyncConfigStore()
|
window.syncConfig = useSyncConfigStore()
|
||||||
window.mergedConfig = useMergedConfigStore()
|
window.mergedConfig = useMergedConfigStore()
|
||||||
window.localConfig = useLocalConfigStore()
|
window.localConfig = useLocalConfigStore()
|
||||||
|
|
|
||||||
|
|
@ -112,10 +112,19 @@ export const INSTANCE_IDENTITY_DEFAULT_DEFINITIONS = {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
|
name: {
|
||||||
|
description: 'Instance Name',
|
||||||
|
type: 'string',
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
export const INSTANCE_IDENTITY_DEFAULT = convertDefinitions(
|
export const INSTANCE_IDENTITY_DEFAULT = convertDefinitions(
|
||||||
INSTANCE_IDENTITY_DEFAULT_DEFINITIONS,
|
INSTANCE_IDENTITY_DEFAULT_DEFINITIONS,
|
||||||
)
|
)
|
||||||
|
export const INSTANCE_IDENTIY_EXTERNAL = new Set([
|
||||||
|
'tos',
|
||||||
|
'instanceSpecificPanelContent',
|
||||||
|
])
|
||||||
|
|
||||||
/// This object contains setting entries that makes sense
|
/// This object contains setting entries that makes sense
|
||||||
/// at the user level. The defaults can also be overriden by
|
/// at the user level. The defaults can also be overriden by
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue