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
08836331
Unverified
Commit
08836331
authored
4 years ago
by
Marc Hanisch
Browse files
Options
Downloads
Patches
Plain Diff
adds properties main page and loads the properties
parent
880cfcbb
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.vue
+4
-0
4 additions, 0 deletions
pages/devices/_deviceId.vue
pages/devices/_deviceId/properties.vue
+96
-0
96 additions, 0 deletions
pages/devices/_deviceId/properties.vue
with
100 additions
and
0 deletions
pages/devices/_deviceId.vue
+
4
−
0
View file @
08836331
...
...
@@ -60,6 +60,10 @@ export default class DevicePage extends Vue {
to
:
'
/devices/
'
+
this
.
deviceId
+
'
/contacts
'
,
name
:
'
Contacts
'
},
{
to
:
'
/devices/
'
+
this
.
deviceId
+
'
/properties
'
,
name
:
'
Properties
'
},
{
to
:
'
/devices/
'
+
this
.
deviceId
+
'
/customfields
'
,
name
:
'
Custom Fields
'
...
...
This diff is collapsed.
Click to expand it.
pages/devices/_deviceId/properties.vue
0 → 100644
+
96
−
0
View file @
08836331
<
template
>
<div>
<ProgressIndicator
v-model=
"isInProgress"
:dark=
"isSaving"
/>
<v-card-actions>
<v-spacer
/>
<v-btn
v-if=
"isLoggedIn"
:disabled=
"isEditPropertiesPage"
color=
"primary"
small
@
click=
"addProperty"
>
Add Property
</v-btn>
</v-card-actions>
<template
v-for=
"(field, index) in properties"
>
<NuxtChild
:key=
"'property-' + index"
v-model=
"properties[index]"
@
delete=
"deleteProperty"
/>
</
template
>
<v-card-actions
v-if=
"properties.length > 3"
>
<v-spacer
/>
<v-btn
v-if=
"isLoggedIn"
:disabled=
"isEditPropertiesPage"
color=
"primary"
small
@
click=
"addProperty"
>
Add Property
</v-btn>
</v-card-actions>
</div>
</template>
<
script
lang=
"ts"
>
import
{
Component
,
Vue
}
from
'
nuxt-property-decorator
'
import
{
DeviceProperty
}
from
'
@/models/DeviceProperty
'
import
ProgressIndicator
from
'
@/components/ProgressIndicator.vue
'
@
Component
({
components
:
{
ProgressIndicator
}
})
export
default
class
DevicePropertiesPage
extends
Vue
{
private
properties
:
DeviceProperty
[]
=
[]
private
isLoading
=
false
private
isSaving
=
false
mounted
()
{
this
.
isLoading
=
true
this
.
$api
.
devices
.
findRelatedDeviceProperties
(
this
.
deviceId
).
then
((
foundProperties
)
=>
{
this
.
properties
=
foundProperties
this
.
isLoading
=
false
}).
catch
(()
=>
{
this
.
$store
.
commit
(
'
snackbar/setError
'
,
'
Failed to fetch custom fields
'
)
this
.
isLoading
=
false
})
}
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
'
]
}
get
isEditPropertiesPage
():
boolean
{
// eslint-disable-next-line no-useless-escape
const
editUrl
=
'
^
\
/devices
\
/
'
+
this
.
deviceId
+
'
\
/properties
\
/([0-9]+)
\
/edit$
'
return
!!
this
.
$route
.
path
.
match
(
editUrl
)
}
addProperty
():
void
{
}
deleteProperty
(
property
:
DeviceProperty
)
{
}
}
</
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