File tree 6 files changed +17
-19
lines changed
bundles/org.openhab.ui/web/src/components
6 files changed +17
-19
lines changed Original file line number Diff line number Diff line change 83
83
</f7-list-item >
84
84
</f7-list >
85
85
86
- <div class =" account" v-if =" ready" >
86
+ <div slot = " fixed " class =" account" v-if =" ready" >
87
87
<div class =" display-flex justify-content-center" >
88
88
<div class =" hint-signin" v-if =" !$store.getters.user && !$store.getters.pages.length" >
89
89
<em >Sign in as an administrator to access settings<br /><f7-icon f7 =" arrow_down" size =" 20" ></f7-icon ></em >
Original file line number Diff line number Diff line change @@ -27,21 +27,6 @@ export default {
27
27
... SystemWidgets,
28
28
... StandardWidgets,
29
29
... LayoutWidgets
30
- },
31
- computed: {
32
- visible () {
33
- if (this .context .editmode ) return true
34
- if (this .config .visible === undefined ) return true
35
- if (this .config .visible === false ) return false
36
- if (this .config .visibleTo ) {
37
- const user = this .$store .getters .user
38
- if (! user) return false
39
- if (user .roles && user .roles .some (r => this .config .visibleTo .indexOf (' role:' + r) >= 0 )) return true
40
- if (this .config .visibleTo .indexOf (' user:' + user .name ) >= 0 ) return true
41
- return false
42
- }
43
- return true
44
- }
45
30
}
46
31
}
47
32
</script >
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div >
3
3
<hr v-if =" context.editmode" />
4
- <f7-block class =" oh-block" :style =" { 'z-index': 100 - context.parent.component.slots.default.indexOf(context.component) }" >
4
+ <f7-block v-if = " visible " class =" oh-block" :style =" { 'z-index': 100 - context.parent.component.slots.default.indexOf(context.component) }" >
5
5
<f7-block-title v-if =" context.component.config.title" >{{context.component.config.title}}</f7-block-title >
6
6
<f7-menu v-if =" context.editmode" class =" configure-layout-menu padding-bottom" >
7
7
<f7-menu-item @click =" context.editmode.addWidget(context.component, 'oh-grid-row')" icon-f7 =" plus" text =" Add Row" />
Original file line number Diff line number Diff line change 1
1
<template >
2
- <f7-col v-bind =" config" >
2
+ <f7-col v-bind =" config" v-if = " visible " >
3
3
<div width =" 100%" >
4
4
<f7-menu v-if =" context.editmode" class =" configure-layout-menu padding-horizontal" >
5
5
<f7-menu-item style =" margin-left : auto " icon-f7 =" rectangle_split_3x1" dropdown >
Original file line number Diff line number Diff line change 20
20
</f7-menu-item >
21
21
</f7-menu >
22
22
</div >
23
- <f7-row no-gap >
23
+ <f7-row no-gap v-if = " visible " >
24
24
<oh-grid-col v-for =" (component, idx) in context.component.slots.default"
25
25
:key =" idx"
26
26
:context =" childContext(component)"
Original file line number Diff line number Diff line change @@ -52,6 +52,19 @@ export default {
52
52
}
53
53
this . $emit ( 'component-ready' , this . context . component )
54
54
return evalConfig
55
+ } ,
56
+ visible ( ) {
57
+ if ( this . context . editmode ) return true
58
+ if ( this . config . visible === undefined && this . config . visibleTo === undefined ) return true
59
+ if ( this . config . visible === false ) return false
60
+ if ( this . config . visibleTo ) {
61
+ const user = this . $store . getters . user
62
+ if ( ! user ) return false
63
+ if ( user . roles && user . roles . some ( r => this . config . visibleTo . indexOf ( 'role:' + r ) >= 0 ) ) return true
64
+ if ( this . config . visibleTo . indexOf ( 'user:' + user . name ) >= 0 ) return true
65
+ return false
66
+ }
67
+ return true
55
68
}
56
69
} ,
57
70
methods : {
You can’t perform that action at this time.
0 commit comments