Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HUB Terra
SMS
Frontend
Commits
cda1744c
Unverified
Commit
cda1744c
authored
4 years ago
by
Marc Hanisch
Browse files
Options
Downloads
Patches
Plain Diff
WIP: adds expansion panels per device property
parent
294e37d2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!90
Draft: restructure frontend properties 2
,
!82
Restructure frontend
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pages/devices/_deviceId/properties.vue
+14
-8
14 additions, 8 deletions
pages/devices/_deviceId/properties.vue
pages/devices/_deviceId/properties/index.vue
+113
-0
113 additions, 0 deletions
pages/devices/_deviceId/properties/index.vue
with
127 additions
and
8 deletions
pages/devices/_deviceId/properties.vue
+
14
−
8
View file @
cda1744c
...
@@ -16,15 +16,20 @@
...
@@ -16,15 +16,20 @@
Add Property
Add Property
</v-btn>
</v-btn>
</v-card-actions>
</v-card-actions>
<template
<v-expansion-panels
v-for=
"(field, index) in properties"
v-model=
"openedPanels"
multiple
>
>
<NuxtChild
<template
:key=
"'property-' + index"
v-for=
"(field, index) in properties"
v-model=
"properties[index]"
>
@
delete=
"deleteProperty"
<NuxtChild
/>
:key=
"'property-' + index"
</
template
>
v-model=
"properties[index]"
@
delete=
"deleteProperty"
/>
</
template
>
</v-expansion-panels>
<v-card-actions
<v-card-actions
v-if=
"properties.length > 3"
v-if=
"properties.length > 3"
>
>
...
@@ -54,6 +59,7 @@ import ProgressIndicator from '@/components/ProgressIndicator.vue'
...
@@ -54,6 +59,7 @@ import ProgressIndicator from '@/components/ProgressIndicator.vue'
}
}
})
})
export
default
class
DevicePropertiesPage
extends
Vue
{
export
default
class
DevicePropertiesPage
extends
Vue
{
private
openedPanels
:
number
[]
=
[]
private
properties
:
DeviceProperty
[]
=
[]
private
properties
:
DeviceProperty
[]
=
[]
private
isLoading
=
false
private
isLoading
=
false
private
isSaving
=
false
private
isSaving
=
false
...
...
This diff is collapsed.
Click to expand it.
pages/devices/_deviceId/properties/index.vue
0 → 100644
+
113
−
0
View file @
cda1744c
<
template
>
<DevicePropertyExpansionPanel
v-model=
"value"
>
<template
#actions
>
<v-btn
v-if=
"isLoggedIn"
color=
"primary"
text
small
nuxt
:to=
"'/devices/' + deviceId + '/properties/' + value.id + '/edit'"
>
Edit
</v-btn>
<v-menu
v-if=
"isLoggedIn"
close-on-click
close-on-content-click
offset-x
left
z-index=
"999"
>
<template
v-slot:activator=
"
{ on }">
<v-btn
data-role=
"property-menu"
icon
small
v-on=
"on"
>
<v-icon
dense
small
>
mdi-dots-vertical
</v-icon>
</v-btn>
</
template
>
<v-list>
<v-list-item
dense
@
click=
"deleteProperty"
>
<v-list-item-content>
<v-list-item-title
class=
"red--text"
>
<v-icon
left
small
color=
"red"
>
mdi-delete
</v-icon>
Remove Property
</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
</v-menu>
</template>
<
template
>
<em>
TODO:
</em>
<tt>
DeviceProperty
</tt>
component for view mode,
<tt>
DevicePropertyForm
</tt>
for edit mode
</
template
>
</DevicePropertyExpansionPanel>
</template>
<
script
lang=
"ts"
>
import
{
Component
,
Vue
,
Prop
}
from
'
nuxt-property-decorator
'
import
{
DeviceProperty
}
from
'
@/models/DeviceProperty
'
import
ProgressIndicator
from
'
@/components/ProgressIndicator.vue
'
import
DevicePropertyExpansionPanel
from
'
@/components/DevicePropertyExpansionPanel.vue
'
@
Component
({
components
:
{
DevicePropertyExpansionPanel
,
ProgressIndicator
}
})
export
default
class
DevicePropertiesShowPage
extends
Vue
{
private
isLoading
=
false
private
isSaving
=
false
/**
* a DeviceProperty
*/
@
Prop
({
required
:
true
,
type
:
Object
})
// @ts-ignore
readonly
value
!
:
DeviceProperty
mounted
()
{
}
get
isInProgress
():
boolean
{
return
this
.
isLoading
||
this
.
isSaving
}
get
deviceId
():
string
{
return
this
.
$route
.
params
.
deviceId
}
get
isLoggedIn
():
boolean
{
return
this
.
$store
.
getters
[
'
oidc/isAuthenticated
'
]
}
deleteProperty
()
{
}
}
</
script
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment