Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
meshviewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
infrastruktur
meshviewer
Commits
18a2a17d
Commit
18a2a17d
authored
Nov 6, 2017
by
Xaver Maierhofer
Committed by
Xaver Maierhofer
Nov 6, 2017
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Define complete subst
parent
d0b6031d
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/infobox/link.js
+8
-7
8 additions, 7 deletions
lib/infobox/link.js
lib/infobox/node.js
+6
-6
6 additions, 6 deletions
lib/infobox/node.js
lib/proportions.js
+7
-1
7 additions, 1 deletion
lib/proportions.js
lib/utils/helper.js
+1
-4
1 addition, 4 deletions
lib/utils/helper.js
with
22 additions
and
18 deletions
lib/infobox/link.js
+
8
−
7
View file @
18a2a17d
...
@@ -3,13 +3,14 @@ define(['helper', 'snabbdom'], function (helper, V) {
...
@@ -3,13 +3,14 @@ define(['helper', 'snabbdom'], function (helper, V) {
V
=
V
.
default
;
V
=
V
.
default
;
function
showStatImg
(
o
,
d
,
time
)
{
function
showStatImg
(
o
,
d
,
time
)
{
var
subst
=
{};
var
subst
=
{
subst
[
'
{SOURCE_ID}
'
]
=
d
.
source
.
node_id
;
'
{SOURCE_ID}
'
:
d
.
source
.
node_id
,
subst
[
'
{SOURCE_NAME}
'
]
=
d
.
source
.
hostname
.
replace
(
/
[^
a-z0-9
\-]
/ig
,
'
_
'
);
'
{SOURCE_NAME}
'
:
d
.
source
.
hostname
.
replace
(
/
[^
a-z0-9
\-]
/ig
,
'
_
'
),
subst
[
'
{TARGET_ID}
'
]
=
d
.
target
.
node_id
;
'
{TARGET_ID}
'
:
d
.
target
.
node_id
,
subst
[
'
{TARGET_NAME}
'
]
=
d
.
target
.
hostname
.
replace
(
/
[^
a-z0-9
\-]
/ig
,
'
_
'
);
'
{TARGET_NAME}
'
:
d
.
target
.
hostname
.
replace
(
/
[^
a-z0-9
\-]
/ig
,
'
_
'
),
subst
[
'
{TIME}
'
]
=
time
;
'
{TIME}
'
:
time
,
subst
[
'
{LOCALE}
'
]
=
_
.
locale
();
'
{LOCALE}
'
:
_
.
locale
()
};
return
helper
.
showStat
(
V
,
o
,
subst
);
return
helper
.
showStat
(
V
,
o
,
subst
);
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/infobox/node.js
+
6
−
6
View file @
18a2a17d
...
@@ -4,11 +4,12 @@ define(['sorttable', 'snabbdom', 'd3-interpolate', 'moment', 'helper', 'utils/no
...
@@ -4,11 +4,12 @@ define(['sorttable', 'snabbdom', 'd3-interpolate', 'moment', 'helper', 'utils/no
V
=
V
.
default
;
V
=
V
.
default
;
function
showStatImg
(
o
,
d
)
{
function
showStatImg
(
o
,
d
)
{
var
subst
=
{};
var
subst
=
{
subst
[
'
{NODE_ID}
'
]
=
d
.
node_id
;
'
{NODE_ID}
'
:
d
.
node_id
,
subst
[
'
{NODE_NAME}
'
]
=
d
.
hostname
.
replace
(
/
[^
a-z0-9
\-]
/ig
,
'
_
'
);
'
{NODE_NAME}
'
:
d
.
hostname
.
replace
(
/
[^
a-z0-9
\-]
/ig
,
'
_
'
),
subst
[
'
{TIME}
'
]
=
d
.
lastseen
.
format
(
'
DDMMYYYYHmmss
'
);
'
{TIME}
'
:
d
.
lastseen
.
format
(
'
DDMMYYYYHmmss
'
),
subst
[
'
{LOCALE}
'
]
=
_
.
locale
();
'
{LOCALE}
'
:
_
.
locale
()
};
return
helper
.
showStat
(
V
,
o
,
subst
);
return
helper
.
showStat
(
V
,
o
,
subst
);
}
}
...
@@ -138,7 +139,6 @@ define(['sorttable', 'snabbdom', 'd3-interpolate', 'moment', 'helper', 'utils/no
...
@@ -138,7 +139,6 @@ define(['sorttable', 'snabbdom', 'd3-interpolate', 'moment', 'helper', 'utils/no
}
}
});
});
children
.
push
(
V
.
h
(
'
tr
'
,
[
children
.
push
(
V
.
h
(
'
tr
'
,
[
V
.
h
(
'
th
'
,
_
.
t
(
'
node.gateway
'
)),
V
.
h
(
'
th
'
,
_
.
t
(
'
node.gateway
'
)),
showGateway
(
d
)
showGateway
(
d
)
...
...
This diff is collapsed.
Click to expand it.
lib/proportions.js
+
7
−
1
View file @
18a2a17d
...
@@ -6,6 +6,7 @@ define(['d3-interpolate', 'snabbdom', 'filters/genericnode', 'helper'],
...
@@ -6,6 +6,7 @@ define(['d3-interpolate', 'snabbdom', 'filters/genericnode', 'helper'],
return
function
(
filterManager
)
{
return
function
(
filterManager
)
{
var
self
=
this
;
var
self
=
this
;
var
scale
=
d3Interpolate
.
interpolate
(
config
.
forceGraph
.
tqFrom
,
config
.
forceGraph
.
tqTo
);
var
scale
=
d3Interpolate
.
interpolate
(
config
.
forceGraph
.
tqFrom
,
config
.
forceGraph
.
tqTo
);
var
time
;
var
statusTable
;
var
statusTable
;
var
fwTable
;
var
fwTable
;
...
@@ -78,6 +79,7 @@ define(['d3-interpolate', 'snabbdom', 'filters/genericnode', 'helper'],
...
@@ -78,6 +79,7 @@ define(['d3-interpolate', 'snabbdom', 'filters/genericnode', 'helper'],
self
.
setData
=
function
setData
(
data
)
{
self
.
setData
=
function
setData
(
data
)
{
var
onlineNodes
=
data
.
nodes
.
online
;
var
onlineNodes
=
data
.
nodes
.
online
;
var
nodes
=
onlineNodes
.
concat
(
data
.
nodes
.
lost
);
var
nodes
=
onlineNodes
.
concat
(
data
.
nodes
.
lost
);
time
=
data
.
timestamp
;
function
hostnameOfNodeID
(
nodeid
)
{
function
hostnameOfNodeID
(
nodeid
)
{
var
gateway
=
data
.
nodeDict
[
nodeid
];
var
gateway
=
data
.
nodeDict
[
nodeid
];
...
@@ -163,9 +165,13 @@ define(['d3-interpolate', 'snabbdom', 'filters/genericnode', 'helper'],
...
@@ -163,9 +165,13 @@ define(['d3-interpolate', 'snabbdom', 'filters/genericnode', 'helper'],
var
images
=
document
.
createElement
(
'
div
'
);
var
images
=
document
.
createElement
(
'
div
'
);
el
.
appendChild
(
images
);
el
.
appendChild
(
images
);
var
img
=
[];
var
img
=
[];
var
subst
=
{
'
{TIME}
'
:
time
,
'
{LOCALE}
'
:
_
.
locale
()
};
config
.
globalInfos
.
forEach
(
function
(
globalInfo
)
{
config
.
globalInfos
.
forEach
(
function
(
globalInfo
)
{
img
.
push
(
V
.
h
(
'
h2
'
,
globalInfo
.
name
));
img
.
push
(
V
.
h
(
'
h2
'
,
globalInfo
.
name
));
img
.
push
(
helper
.
showStat
(
V
,
globalInfo
));
img
.
push
(
helper
.
showStat
(
V
,
globalInfo
,
subst
));
});
});
V
.
patch
(
images
,
V
.
h
(
'
div
'
,
img
));
V
.
patch
(
images
,
V
.
h
(
'
div
'
,
img
));
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/utils/helper.js
+
1
−
4
View file @
18a2a17d
...
@@ -117,10 +117,7 @@ define({
...
@@ -117,10 +117,7 @@ define({
}
}
},
},
showStat
:
function
showStat
(
V
,
o
,
subst
)
{
showStat
:
function
showStat
(
V
,
o
,
subst
)
{
var
content
;
var
content
=
V
.
h
(
'
img
'
,
{
attrs
:
{
src
:
require
(
'
helper
'
).
listReplace
(
o
.
image
,
subst
)
}
});
subst
=
typeof
subst
!==
'
undefined
'
?
subst
:
{};
content
=
V
.
h
(
'
img
'
,
{
attrs
:
{
src
:
require
(
'
helper
'
).
listReplace
(
o
.
image
,
subst
)
}
});
if
(
o
.
href
)
{
if
(
o
.
href
)
{
return
V
.
h
(
'
p
'
,
V
.
h
(
'
a
'
,
{
return
V
.
h
(
'
p
'
,
V
.
h
(
'
a
'
,
{
...
...
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