diff --git a/src/stores/views.ts b/src/stores/views.ts index 8568dbef..3139042f 100644 --- a/src/stores/views.ts +++ b/src/stores/views.ts @@ -1,5 +1,6 @@ import { defineStore } from 'pinia'; import { useSettingsStore } from './settings'; +import { useBucketsStore } from './buckets'; interface IElement { type: string; @@ -54,7 +55,7 @@ const desktopViews: View[] = [ }, ]; -const androidViews = [ +export const androidViews: View[] = [ { id: 'summary', name: 'Summary', @@ -68,7 +69,6 @@ const androidViews = [ }, ]; -// FIXME: Decide depending on what kind of device is being viewed, not from which device it is being viewed from. export const defaultViews = !process.env.VUE_APP_ON_ANDROID ? desktopViews : androidViews; interface State { @@ -107,6 +107,14 @@ export const useViewsStore = defineStore('views', { restoreDefaults(this: State) { this.views = defaultViews; }, + viewsForHost(host: string): View[] { + const bucketsStore = useBucketsStore(); + const available = bucketsStore.available(host); + if (available.android && !available.window) { + return androidViews; + } + return this.views; + }, addView(this: State, view: View) { this.views.push({ ...view, elements: [] }); }, diff --git a/src/views/Buckets.vue b/src/views/Buckets.vue index 45609575..da8202d2 100644 --- a/src/views/Buckets.vue +++ b/src/views/Buckets.vue @@ -262,18 +262,13 @@ export default { key: 'id', label: this.$t('buckets.bucketId'), sortable: true, - thStyle: { width: '45%' }, - }, - { - key: 'hostname', - sortable: true, - thStyle: { width: '25%' }, + thStyle: { width: '65%' }, }, { key: 'last_updated', label: this.$t('buckets.updated'), sortable: true, - thStyle: { width: '15%' }, + thStyle: { width: '20%' }, }, { key: 'actions', diff --git a/src/views/activity/Activity.vue b/src/views/activity/Activity.vue index c3b60a63..557b8a23 100644 --- a/src/views/activity/Activity.vue +++ b/src/views/activity/Activity.vue @@ -275,7 +275,9 @@ export default { }; }, computed: { - ...mapState(useViewsStore, ['views']), + views(): import('~/stores/views').View[] { + return this.viewsStore.viewsForHost(this.host); + }, ...mapState(useSettingsStore, ['devmode']), ...mapState(useSettingsStore, ['always_active_pattern']), diff --git a/src/views/activity/ActivityView.vue b/src/views/activity/ActivityView.vue index c5c3fa52..33cb49ba 100644 --- a/src/views/activity/ActivityView.vue +++ b/src/views/activity/ActivityView.vue @@ -59,7 +59,6 @@ import 'vue-awesome/icons/times'; import 'vue-awesome/icons/trash'; import 'vue-awesome/icons/undo'; -import { mapState } from 'pinia'; import draggable from 'vuedraggable'; import { useViewsStore } from '~/stores/views'; @@ -76,7 +75,9 @@ export default { return { editing: false }; }, computed: { - ...mapState(useViewsStore, ['views']), + views: function () { + return useViewsStore().viewsForHost(this.$route.params.host || ''); + }, view: function () { if (this.view_id == 'default') { return this.views[0];