Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
f70ce67a
Commit
f70ce67a
authored
Jun 05, 2014
by
Romain Courteaud
Committed by
Jérome Perrin
Aug 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit built version.
parent
a1bc007a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
1 deletion
+63
-1
dream/platform/static/dream/document_page_mixin.js
dream/platform/static/dream/document_page_mixin.js
+4
-1
dream/platform/static/dream/queue_stat_graph.html
dream/platform/static/dream/queue_stat_graph.html
+17
-0
dream/platform/static/dream/queue_stat_graph.js
dream/platform/static/dream/queue_stat_graph.js
+42
-0
No files found.
dream/platform/static/dream/document_page_mixin.js
View file @
f70ce67a
...
...
@@ -6,7 +6,7 @@
var
key
=
this
.
props
.
jio_key
,
gadget
=
this
;
return
new
RSVP
.
Queue
().
push
(
function
()
{
// XXX Conditional simulation menu
return
RSVP
.
all
([
gadget
.
whoWantToDisplayThisDocumentPage
(
"
edit_table
"
,
key
),
gadget
.
whoWantToDisplayThisDocumentPage
(
"
run_simulation
"
,
key
),
gadget
.
whoWantToDisplayThisDocumentPage
(
"
manage_document
"
,
key
),
gadget
.
whoWantToDisplayThisDocumentPage
(
"
station_utilisation_graph
"
,
key
),
gadget
.
whoWantToDisplayThisDocumentPage
(
"
debug_json
"
,
key
)
]);
return
RSVP
.
all
([
gadget
.
whoWantToDisplayThisDocumentPage
(
"
edit_table
"
,
key
),
gadget
.
whoWantToDisplayThisDocumentPage
(
"
run_simulation
"
,
key
),
gadget
.
whoWantToDisplayThisDocumentPage
(
"
manage_document
"
,
key
),
gadget
.
whoWantToDisplayThisDocumentPage
(
"
station_utilisation_graph
"
,
key
),
gadget
.
whoWantToDisplayThisDocumentPage
(
"
queue_stat_graph
"
,
key
),
gadget
.
whoWantToDisplayThisDocumentPage
(
"
debug_json
"
,
key
)
]);
}).
push
(
function
(
result_list
)
{
return
[
{
link
:
result_list
[
0
],
...
...
@@ -22,6 +22,9 @@
title
:
"
Stations Utilization
"
},
{
link
:
result_list
[
4
],
title
:
"
Queues Statistics
"
},
{
link
:
result_list
[
5
],
title
:
"
Debug JSON
"
}
];
});
...
...
dream/platform/static/dream/queue_stat_graph.html
0 → 100644
View file @
f70ce67a
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Queues Statistics
</title>
<script
src=
"../lib/rsvp.min.js"
type=
"text/javascript"
></script>
<script
src=
"../lib/renderjs.min.js"
type=
"text/javascript"
></script>
<script
src=
"../lib/jquery.flot.js"
></script>
<script
src=
"../lib/jquery.flot.stack.js"
></script>
<script
src=
"document_page_mixin.js"
type=
"text/javascript"
></script>
<script
src=
"queue_stat_graph.js"
type=
"text/javascript"
></script>
</head>
<body>
<div
class=
"graph_container"
style=
"width: 100%;height:300px"
></div>
</body>
</html>
dream/platform/static/dream/queue_stat_graph.js
0 → 100644
View file @
f70ce67a
/*global console, rJS, RSVP, initDocumentPageMixin, jQuery */
/*jslint nomen: true */
(
function
(
window
,
rJS
,
RSVP
,
initDocumentPageMixin
,
$
)
{
"
use strict
"
;
function
queue_stat_widget
(
output_data
)
{
/* FIXME: does not support more than one replic.
* + see george email to integrate without the need of an EG
*/
var
series
=
[];
$
.
each
(
output_data
.
elementList
,
function
(
idx
,
el
)
{
if
(
el
.
_class
===
"
Dream.Queue
"
)
{
series
.
push
({
label
:
el
.
name
||
el
.
id
,
data
:
el
.
wip_stat_list
});
}
});
return
series
;
}
var
gadget_klass
=
rJS
(
window
);
initDocumentPageMixin
(
gadget_klass
);
gadget_klass
.
ready
(
function
(
g
)
{
g
.
props
=
{};
}).
ready
(
function
(
g
)
{
return
g
.
getElement
().
push
(
function
(
element
)
{
g
.
props
.
element
=
element
;
});
}).
declareAcquiredMethod
(
"
aq_getAttachment
"
,
"
jio_getAttachment
"
).
declareMethod
(
"
render
"
,
function
(
options
)
{
var
jio_key
=
options
.
id
,
gadget
=
this
;
gadget
.
props
.
jio_key
=
jio_key
;
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
simulation.json
"
}).
push
(
function
(
simulation_json
)
{
gadget
.
props
.
series
=
queue_stat_widget
(
// XXX Hardcoded result
JSON
.
parse
(
simulation_json
)[
0
].
result
);
});
}).
declareMethod
(
"
startService
"
,
function
()
{
// XXX Manually calculate width and height when resizing
$
.
plot
(
this
.
props
.
element
.
querySelector
(
"
.graph_container
"
),
this
.
props
.
series
);
});
})(
window
,
rJS
,
RSVP
,
initDocumentPageMixin
,
jQuery
);
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment