Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iobserve-ui-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
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
iobserve-ui
iobserve-ui-frontend
Commits
9dc90ebd
Commit
9dc90ebd
authored
8 years ago
by
Mathis Neumann
Browse files
Options
Downloads
Patches
Plain Diff
also render changes via UPDATE operations
parent
d94d2e34
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/deployments/single.js
+3
-2
3 additions, 2 deletions
app/controllers/deployments/single.js
app/services/changelog-parser.js
+3
-1
3 additions, 1 deletion
app/services/changelog-parser.js
with
6 additions
and
3 deletions
app/controllers/deployments/single.js
+
3
−
2
View file @
9dc90ebd
...
...
@@ -14,8 +14,9 @@ export default Ember.Controller.extend({
init
()
{
this
.
debug
(
'
initializing controller
'
);
},
// gets automatically updated when any of the instances changes (updated from changelog stream)
graphModel
:
Ember
.
computed
(
`model.instances.{
${
observables
.
join
(
'
,
'
)}
}.[]`
,
function
()
{
// gets automatically updated when any of the instances changes, changes are notified via a pseudo property 'updated'
// using @each will also listen if the array itself changes. Can be quite expensive.
graphModel
:
Ember
.
computed
(
`model.instances.{
${
observables
.
join
(
'
,
'
)}
}.@each._updated`
,
function
()
{
const
systemId
=
this
.
get
(
'
model.systemId
'
);
const
instances
=
this
.
get
(
'
model.instances
'
);
/*
...
...
This diff is collapsed.
Click to expand it.
app/services/changelog-parser.js
+
3
−
1
View file @
9dc90ebd
import
Ember
from
'
ember
'
;
// TODO: update cytoscape instead of complete rerender
export
default
Ember
.
Service
.
extend
({
store
:
Ember
.
inject
.
service
(),
parse
(
changelogs
)
{
...
...
@@ -21,7 +22,7 @@ export default Ember.Service.extend({
const
normalized
=
store
.
normalize
(
data
.
type
,
data
);
// using application serializer
store
.
push
(
normalized
);
},
UPDATE
(
changelog
)
{
// FIXME: does not update view!
UPDATE
(
changelog
)
{
const
data
=
changelog
.
data
;
const
oldRecord
=
this
.
get
(
'
store
'
).
peekRecord
(
data
.
type
,
data
.
id
);
this
.
debug
(
'
oldRecord
'
,
oldRecord
);
...
...
@@ -29,6 +30,7 @@ export default Ember.Service.extend({
throw
new
Error
(
`old record for update operation not found! Id:
${
data
.
id
}
`
);
}
oldRecord
.
setProperties
(
data
);
oldRecord
.
notifyPropertyChange
(
'
_updated
'
);
// notify about pseudo property, can be listened on (see deployments/single controller)
},
DELETE
(
changelog
)
{
const
data
=
changelog
.
data
;
...
...
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