Skip to content

Commit

Permalink
wip: Provide additional information about the browser capabilities #1005
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Dec 7, 2024
1 parent ed9fedb commit f7b8b05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions core/client/components/app/KPlatform.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>
</div>
<div class="q-px-md q-py-sm full-width text-caption">{{ Platform.getData().userAgent }}</div>
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions core/client/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -38,5 +38,7 @@ export const Platform = {
touch: this.is.touch || false
}
}
if (_.isEmpty(scope)) return data
return _.get(data, scope)
}
}

0 comments on commit f7b8b05

Please sign in to comment.