diff --git a/core/client/components/app/KPlatform.vue b/core/client/components/app/KPlatform.vue index c3a8cbaf3..8fc259d76 100644 --- a/core/client/components/app/KPlatform.vue +++ b/core/client/components/app/KPlatform.vue @@ -10,9 +10,9 @@ id="copy-clipboard" icon="las la-copy" :handler="copy" - tooltip="KPlatform.COPY_INFO" + label="KPlatform.COPY_INFO" renderer="fab" - color="primary" + color="grey-7" />
@@ -116,13 +116,13 @@ import KAction from '../action/KAction.vue' // Functions function applicationProperties () { - return _.pick(Platform.getData().application, ['mode', 'iframe']) + return _.pick(Platform.getData('application') ['mode', 'iframe']) } function browserProperties () { - return _.pick(Platform.getData().browser, ['name', 'version']) + return _.pick(Platform.getData('browser'), ['name', 'version']) } function systemProperties () { - return Platform.getData().system + return Platform.getData('system') } async function copy () { try { diff --git a/core/client/platform.js b/core/client/platform.js index f1ffa8a4d..25c59062f 100644 --- a/core/client/platform.js +++ b/core/client/platform.js @@ -18,8 +18,8 @@ export const Platform = { this.is.pwa = _.get(config, 'buildMode', 'spa') === 'pwa' logger.debug('[KDK] Platform initialized with:', this) }, - getData () { - return { + getData (scope) { + const data = { userAgent: this.userAgent, application: { mode: this.is.pwa ? 'PWA' : 'SPA', @@ -38,5 +38,7 @@ export const Platform = { touch: this.is.touch || false } } + if (_.isEmpty(scope)) return data + return _.get(data, scope) } }