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
079e2b0f
Verified
Commit
079e2b0f
authored
3 years ago
by
Marc Hanisch
Browse files
Options
Downloads
Patches
Plain Diff
moves color info of actions into the classes
parent
4317a99f
No related branches found
No related tags found
2 merge requests
!104
Load and save Generic Device Actions
,
!93
Actions UI for devices
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pages/devices/_deviceId/actions.vue
+33
-19
33 additions, 19 deletions
pages/devices/_deviceId/actions.vue
with
33 additions
and
19 deletions
pages/devices/_deviceId/actions.vue
+
33
−
19
View file @
079e2b0f
...
...
@@ -67,7 +67,7 @@ permissions and limitations under the Licence.
<v-timeline-item
v-for=
"(action, index) in actions"
:key=
"action.id"
:color=
"
getA
ctionColor(
action
)"
:color=
"
a
ction
.get
Color()"
class=
"mb-4"
small
>
...
...
@@ -395,7 +395,11 @@ const toUtcDate = (dt: DateTime) => {
return
dt
.
toUTC
().
toFormat
(
'
yyyy-MM-dd TT
'
)
}
class
DeviceSoftwareUpdateAction
implements
IAction
{
interface
IColoredAction
{
getColor
():
string
}
class
DeviceSoftwareUpdateAction
implements
IAction
,
IColoredAction
{
public
id
:
string
public
softwareTypeName
:
string
public
softwareTypeUri
:
string
...
...
@@ -431,9 +435,13 @@ class DeviceSoftwareUpdateAction implements IAction {
get
isDeviceSoftwareUpdateAction
():
boolean
{
return
true
}
getColor
():
string
{
return
'
yellow
'
}
}
class
DeviceCalibrationAction
implements
IAction
{
class
DeviceCalibrationAction
implements
IAction
,
IColoredAction
{
public
id
:
string
public
description
:
string
public
currentCalibrationDate
:
DateTime
...
...
@@ -469,6 +477,10 @@ class DeviceCalibrationAction implements IAction {
get
isDeviceCalibrationAction
():
boolean
{
return
true
}
getColor
():
string
{
return
'
brown
'
}
}
class
DeviceMountAction
{
...
...
@@ -510,9 +522,13 @@ class DeviceMountAction {
get
isDeviceMountAction
():
boolean
{
return
true
}
getColor
():
string
{
return
'
green
'
}
}
class
DeviceUnmountAction
implements
IAction
{
class
DeviceUnmountAction
implements
IAction
,
IColoredAction
{
public
id
:
string
public
configurationName
:
string
public
endDate
:
DateTime
...
...
@@ -539,7 +555,20 @@ class DeviceUnmountAction implements IAction {
get
isDeviceUnmountAction
():
boolean
{
return
true
}
getColor
():
string
{
return
'
red
'
}
}
/**
* extend the original interface by adding the getColor() method
*/
declare
module
'
@/models/GenericAction
'
{
export
interface
GenericAction
extends
IColoredAction
{
}
}
GenericAction
.
prototype
.
getColor
=
():
string
=>
'
blue
'
@
Component
({
components
:
{
...
...
@@ -687,21 +716,6 @@ export default class DeviceActionsPage extends Vue {
return
this
.
$route
.
params
.
actionId
}
getActionColor
(
action
:
GenericAction
|
DeviceSoftwareUpdateAction
|
DeviceCalibrationAction
|
DeviceMountAction
|
DeviceUnmountAction
)
{
switch
(
true
)
{
case
(
action
as
GenericAction
).
isGenericAction
:
return
'
blue
'
case
(
action
as
DeviceSoftwareUpdateAction
).
isDeviceSoftwareUpdateAction
:
return
'
yellow
'
case
(
action
as
DeviceCalibrationAction
).
isDeviceCalibrationAction
:
return
'
brown
'
case
(
action
as
DeviceMountAction
).
isDeviceMountAction
:
return
'
green
'
case
(
action
as
DeviceUnmountAction
).
isDeviceUnmountAction
:
return
'
red
'
}
}
get
editedAction
():
IAction
|
undefined
{
if
(
!
this
.
actionId
)
{
return
...
...
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