Skip to content

Commit 41aea78

Browse files
committed
Updated performance (+2 squashed commits)
Squashed commits: [f3ea89d7a] Performance metrics [3e02a0f3c] WIP (+5 squashed commits) Squashed commits: [f07c59d] WIP [20ffc61] WIP [1638608] WIP [b42cfd0] WIP [7feb909] WIP (+3 squashed commits) Squashed commits: [63a4a18] working [408705a] WIP [7be6336] WIP Signed-off-by: Jeff James <[email protected]>
1 parent 5399594 commit 41aea78

File tree

96 files changed

+1136
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1136
-281
lines changed

bundles/org.openhab.ui/web/eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const rules = {
4141
'no-case-declarations': 'off',
4242
'no-console': 'off',
4343
'no-debugger': 'off',
44+
'no-unsed-vars': 'off',
4445
'no-irregular-whitespace': 'off',
4546
// 'es/no-regexp-lookbehind-assertions': 'error', // Supported in Safari >= 16.4, which breaks iOS 15.x.
4647
'no-trailing-spaces': 'error',
@@ -72,6 +73,7 @@ const rules = {
7273
'vue/singleline-html-element-content-newline': 'error',
7374
'vue/v-on-style': 'error',
7475
'vue/v-slot-style': 'error',
76+
'@typescript-eslint/no-unused-vars': 'warn',
7577

7678
// The following rules should be activated successively. Due to the large amount
7779
// of required changes, the activations should be clustered in several pull requests.

bundles/org.openhab.ui/web/package-lock.json

Lines changed: 29 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundles/org.openhab.ui/web/src/components/cards/card-mixin.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
1-
import mixin from '@/components/widgets/widget-mixin'
21
import { f7 } from 'framework7-vue'
2+
import { useWidgetContext } from '@/components/widgets/useWidgetContext'
33

44
// TODO: Restore functionality to close card with browser back.
55
// This has been removed as the history manipulation caused double-back navigation to the overview page from the analyzer
66
export default {
7-
mixins: [mixin],
8-
props: {
9-
type: String,
10-
element: Object
11-
},
127
data() {
138
return {
149
opened: false,
1510
cardId: this.title
1611
}
1712
},
18-
mounted() {
19-
// window.addEventListener('popstate', this.back)
20-
},
21-
beforeUnmount() {
22-
// window.removeEventListener('popstate', this.back)
23-
},
2413
computed: {
2514
title() {
2615
if (this.config.title) return this.config.title

bundles/org.openhab.ui/web/src/components/cards/equipment-card.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,31 @@
2828
</style>
2929

3030
<script>
31-
import mixin from '@/components/widgets/widget-mixin'
31+
import { useWidgetContext } from '@/components/widgets/useWidgetContext'
3232
import { equipmentListComponent } from '@/components/widgets/standard/list/default-list-item'
3333
import CardMixin from './card-mixin'
3434
import ModelCard from './model-card.vue'
3535
3636
import { useStatesStore } from '@/js/stores/useStatesStore'
3737
3838
export default {
39-
mixins: [mixin, CardMixin],
39+
mixins: [CardMixin],
4040
props: {
41-
tabContext: Object
41+
context: Object,
42+
tabContext: Object,
43+
type: String,
44+
element: Object
4245
},
4346
components: {
4447
ModelCard
4548
},
49+
setup (props) {
50+
const { config, childContext } = useWidgetContext(props.context)
51+
return {
52+
config,
53+
childContext
54+
}
55+
},
4656
computed: {
4757
listContext () {
4858
const contextLabelDefaults = { contextLabelSource: 'path' }

bundles/org.openhab.ui/web/src/components/cards/location-card.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
</style>
8484

8585
<script>
86-
import mixin from '@/components/widgets/widget-mixin'
86+
import { useWidgetContext } from '@/components/widgets/useWidgetContext'
8787
import itemDefaultListComponent, { equipmentListComponent } from '@/components/widgets/standard/list/default-list-item'
8888
import CardMixin from './card-mixin'
8989
import ModelCard from './model-card.vue'
@@ -93,16 +93,26 @@ import MeasurementBadge from './glance/location/measurement-badge.vue'
9393
import { useStatesStore } from '@/js/stores/useStatesStore'
9494
9595
export default {
96-
mixins: [mixin, CardMixin],
96+
mixins: [CardMixin],
9797
props: {
98+
context: Object,
9899
parentLocation: String,
99-
tabContext: Object
100+
tabContext: Object,
101+
type: String,
102+
element: Object
100103
},
101104
components: {
102105
ModelCard,
103106
StatusBadge,
104107
MeasurementBadge
105108
},
109+
setup (props) {
110+
const { config, childContext } = useWidgetContext(props.context)
111+
return {
112+
config,
113+
childContext
114+
}
115+
},
106116
data () {
107117
return {
108118
activeTab: (this.element.equipment.length === 0 && this.element.properties.length > 0) ? 'properties' : 'equipment'

bundles/org.openhab.ui/web/src/components/cards/model-card.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,25 @@
100100
<script>
101101
import { mapStores } from 'pinia'
102102
import CardMixin from './card-mixin'
103+
import { useWidgetContext } from '@/components/widgets/useWidgetContext'
103104
104105
import { useUIOptionsStore } from '@/js/stores/useUIOptionsStore'
105106
106107
export default {
107108
mixins: [CardMixin],
108109
props: {
109-
headerHeight: [String, Number]
110+
context: Object,
111+
headerHeight: [String, Number],
112+
type: String,
113+
element: Object
114+
},
115+
setup (props) {
116+
const { config, childContext, visible } = useWidgetContext(props.context)
117+
return {
118+
config,
119+
childContext,
120+
visible
121+
}
110122
},
111123
computed: {
112124
...mapStores(useUIOptionsStore)

0 commit comments

Comments
 (0)