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
69c45e44
Commit
69c45e44
authored
Feb 05, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update static version
parent
e435f12b
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
98 additions
and
33 deletions
+98
-33
dream/platform/static/dream/Input_viewResultList.js
dream/platform/static/dream/Input_viewResultList.js
+2
-2
dream/platform/static/dream/Input_viewSimulation.js
dream/platform/static/dream/Input_viewSimulation.js
+22
-6
dream/platform/static/dream/Input_viewSpreadsheet.js
dream/platform/static/dream/Input_viewSpreadsheet.js
+13
-14
dream/platform/static/dream/Output_viewCapacityUtilisationGraph.js
...tform/static/dream/Output_viewCapacityUtilisationGraph.js
+1
-1
dream/platform/static/dream/Output_viewDownloadExcelSpreadsheet.js
...tform/static/dream/Output_viewDownloadExcelSpreadsheet.js
+1
-1
dream/platform/static/dream/Output_viewExitStatistics.js
dream/platform/static/dream/Output_viewExitStatistics.js
+1
-1
dream/platform/static/dream/Output_viewGantt.js
dream/platform/static/dream/Output_viewGantt.js
+1
-1
dream/platform/static/dream/Output_viewGraph.js
dream/platform/static/dream/Output_viewGraph.js
+1
-1
dream/platform/static/dream/Output_viewJobGantt.js
dream/platform/static/dream/Output_viewJobGantt.js
+1
-1
dream/platform/static/dream/Output_viewJobScheduleSpreadsheet.js
...latform/static/dream/Output_viewJobScheduleSpreadsheet.js
+1
-1
dream/platform/static/dream/Output_viewQueueStatGraph.js
dream/platform/static/dream/Output_viewQueueStatGraph.js
+1
-1
dream/platform/static/dream/Output_viewSpreadsheet.html
dream/platform/static/dream/Output_viewSpreadsheet.html
+23
-0
dream/platform/static/dream/Output_viewSpreadsheet.js
dream/platform/static/dream/Output_viewSpreadsheet.js
+27
-0
dream/platform/static/dream/Output_viewStationUtilisationGraph.js
...atform/static/dream/Output_viewStationUtilisationGraph.js
+1
-1
dream/platform/static/dream/index.js
dream/platform/static/dream/index.js
+2
-2
No files found.
dream/platform/static/dream/Input_viewResultList.js
View file @
69c45e44
...
...
@@ -13,7 +13,7 @@
this
.
props
.
jio_key
=
options
.
id
;
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
simulation
.json
"
_attachment
:
"
body
.json
"
}).
push
(
undefined
,
function
(
error
)
{
if
(
error
.
status_code
===
404
)
{
// Simulation not yet generated
...
...
@@ -22,7 +22,7 @@
throw
error
;
}).
push
(
function
(
sim_json
)
{
var
result
=
JSON
.
parse
(
sim_json
).
result
,
result_list
=
[],
document_list
=
[],
i
;
if
(
result
)
{
if
(
result
&&
result
.
result_list
)
{
document_list
=
result
.
result_list
;
}
for
(
i
=
0
;
i
<
document_list
.
length
;
i
+=
1
)
{
...
...
dream/platform/static/dream/Input_viewSimulation.js
View file @
69c45e44
...
...
@@ -25,30 +25,46 @@
});
}
function
runSimulation
(
gadget
)
{
var
result_json
;
return
new
RSVP
.
Queue
().
push
(
function
()
{
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
body.json
"
});
}).
push
(
function
(
body_json
)
{
// do not send previous results to simulation engine
var
json_without_result
=
JSON
.
parse
(
body_json
);
json_without_result
.
result
.
result_list
=
[];
// XXX Hardcoded relative URL
return
gadget
.
aq_ajax
({
url
:
"
../../runSimulation
"
,
type
:
"
POST
"
,
data
:
body_json
,
data
:
JSON
.
stringify
(
json_without_result
)
,
headers
:
{
"
Content-Type
"
:
"
application/json
"
}
});
}).
push
(
function
(
evt
)
{
var
json_data
=
JSON
.
parse
(
evt
.
target
.
responseText
);
if
(
json_data
.
success
!==
true
)
{
throw
new
Error
(
json_data
.
error
);
result_json
=
JSON
.
parse
(
evt
.
target
.
responseText
);
if
(
result_json
.
success
!==
true
)
{
throw
new
Error
(
result_json
.
error
);
}
// get latest version
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
body.json
"
});
}).
push
(
function
(
data
)
{
data
=
JSON
.
parse
(
data
);
// XXX option to always add ?
if
(
data
.
general
.
reset_result_list
)
{
data
.
result
.
result_list
=
[];
}
data
.
result
.
result_list
=
data
.
result
.
result_list
.
concat
(
result_json
.
data
.
result
.
result_list
);
return
gadget
.
aq_putAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
simulation
.json
"
,
_data
:
JSON
.
stringify
(
json_data
.
data
,
null
,
2
),
_attachment
:
"
body
.json
"
,
_data
:
JSON
.
stringify
(
data
,
null
,
2
),
_mimetype
:
"
application/json
"
});
}).
push
(
function
()
{
...
...
dream/platform/static/dream/Input_viewSpreadsheet.js
View file @
69c45e44
/*global rJS, RSVP, initGadgetMixin, loopEventListener */
(
function
(
window
,
rJS
,
RSVP
,
initGadgetMixin
,
loopEventListener
)
{
/*global rJS, RSVP, initGadgetMixin, loopEventListener
, $
*/
(
function
(
window
,
rJS
,
RSVP
,
initGadgetMixin
,
loopEventListener
,
$
)
{
"
use strict
"
;
function
saveSpreadsheet
(
evt
)
{
var
gadget
=
this
,
editor_data
,
editor_gadget
;
...
...
@@ -50,22 +50,13 @@
if
(
options
.
action_definition
.
configuration
.
input_id
)
{
gadget
.
props
.
name
=
options
.
action_definition
.
configuration
.
input_id
;
}
gadget
.
props
.
configuration
=
options
.
action_definition
.
configuration
;
return
new
RSVP
.
Queue
().
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
aq_getAttachment
({
_id
:
jio_key
,
_attachment
:
"
body.json
"
}),
gadget
.
getDeclaredGadget
(
"
tableeditor
"
)
]);
}).
push
(
function
(
result_list
)
{
var
content
,
result
=
JSON
.
parse
(
result_list
[
0
]);
// if there are previously stored data in input for this sprSheet
if
(
result
.
input
[
gadget
.
props
.
name
])
{
content
=
result
.
input
[
gadget
.
props
.
name
];
}
else
{
content
=
options
.
action_definition
.
configuration
.
columns
;
}
// application_configuration.input.view_???_spreasheet.configuration
return
result_list
[
1
].
render
(
JSON
.
stringify
(
content
),
{
var
content
,
result
=
JSON
.
parse
(
result_list
[
0
]),
handsontable_options
=
{
minSpareRows
:
1
,
onChange
:
function
()
{
if
(
gadget
.
timeout
)
{
...
...
@@ -73,7 +64,15 @@
}
gadget
.
timeout
=
window
.
setTimeout
(
saveSpreadsheet
.
bind
(
gadget
),
100
);
}
});
};
// if there are previously stored data in input for this sprSheet
if
(
result
.
input
[
gadget
.
props
.
name
])
{
content
=
result
.
input
[
gadget
.
props
.
name
];
}
else
{
content
=
options
.
action_definition
.
configuration
.
columns
;
}
$
.
extend
(
handsontable_options
,
options
.
action_definition
.
configuration
.
handsontable_options
||
{});
return
result_list
[
1
].
render
(
JSON
.
stringify
(
content
),
handsontable_options
);
});
}).
declareMethod
(
"
startService
"
,
function
()
{
var
gadget
=
this
;
...
...
@@ -81,4 +80,4 @@
return
RSVP
.
all
([
tableeditor
.
startService
(),
waitForSave
(
gadget
)
]);
});
});
})(
window
,
rJS
,
RSVP
,
initGadgetMixin
,
loopEventListener
);
\ No newline at end of file
})(
window
,
rJS
,
RSVP
,
initGadgetMixin
,
loopEventListener
,
$
);
\ No newline at end of file
dream/platform/static/dream/Output_viewCapacityUtilisationGraph.js
View file @
69c45e44
...
...
@@ -69,7 +69,7 @@
gadget
.
props
.
result
=
options
.
result
;
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
simulation
.json
"
_attachment
:
"
body
.json
"
}).
push
(
function
(
simulation_json
)
{
gadget
.
props
.
result_list
=
capacity_utilisation_graph_widget
(
JSON
.
parse
(
simulation_json
),
gadget
.
props
.
result
);
});
...
...
dream/platform/static/dream/Output_viewDownloadExcelSpreadsheet.js
View file @
69c45e44
...
...
@@ -10,7 +10,7 @@
gadget
.
props
.
result
=
options
.
result
;
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
simulation
.json
"
_attachment
:
"
body
.json
"
}).
push
(
function
(
simulation_json
)
{
var
result
=
JSON
.
parse
(
simulation_json
)[
0
].
result
,
download_link
=
gadget
.
props
.
element
.
querySelector
(
"
.download_link
"
);
download_link
.
download
=
"
demandPlannerOutput.xls
"
;
...
...
dream/platform/static/dream/Output_viewExitStatistics.js
View file @
69c45e44
...
...
@@ -91,7 +91,7 @@
gadget
.
props
.
result
=
options
.
result
;
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
simulation
.json
"
_attachment
:
"
body
.json
"
}).
push
(
function
(
simulation_json
)
{
var
result
=
calculate_exit_stat
(
gadget
.
props
.
result
,
JSON
.
parse
(
simulation_json
));
gadget
.
props
.
element
.
innerHTML
=
result
;
...
...
dream/platform/static/dream/Output_viewGantt.js
View file @
69c45e44
...
...
@@ -160,7 +160,7 @@
gadget
.
props
.
action
=
options
.
action
;
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
simulation
.json
"
_attachment
:
"
body
.json
"
}).
push
(
function
(
simulation_json
)
{
var
json_data
=
JSON
.
parse
(
simulation_json
);
gadget
.
props
.
result
=
gantt_widget
(
json_data
,
gadget
);
...
...
dream/platform/static/dream/Output_viewGraph.js
View file @
69c45e44
...
...
@@ -90,7 +90,7 @@
gadget
.
props
.
result
=
options
.
result
;
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
simulation
.json
"
_attachment
:
"
body
.json
"
}).
push
(
function
(
simulation_json
)
{
console
.
log
(
"
rendering view graph
"
);
var
json_data
=
JSON
.
parse
(
simulation_json
),
config
=
json_data
.
application_configuration
.
output
[
options
.
action
].
configuration
;
...
...
dream/platform/static/dream/Output_viewJobGantt.js
View file @
69c45e44
...
...
@@ -171,7 +171,7 @@
gadget
.
props
.
result
=
options
.
result
;
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
simulation
.json
"
_attachment
:
"
body
.json
"
}).
push
(
function
(
simulation_json
)
{
gadget
.
props
.
result
=
job_gantt_widget
(
JSON
.
parse
(
simulation_json
),
gadget
.
props
.
result
);
});
...
...
dream/platform/static/dream/Output_viewJobScheduleSpreadsheet.js
View file @
69c45e44
...
...
@@ -117,7 +117,7 @@
return
new
RSVP
.
Queue
().
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
aq_getAttachment
({
_id
:
jio_key
,
_attachment
:
"
simulation
.json
"
_attachment
:
"
body
.json
"
}),
gadget
.
getDeclaredGadget
(
"
tableeditor
"
)
]);
}).
push
(
function
(
result_list
)
{
return
result_list
[
1
].
render
(
JSON
.
stringify
(
job_schedule_spreadsheet_widget
(
JSON
.
parse
(
result_list
[
0
]),
gadget
.
props
.
result
)));
...
...
dream/platform/static/dream/Output_viewQueueStatGraph.js
View file @
69c45e44
...
...
@@ -25,7 +25,7 @@
gadget
.
props
.
result
=
options
.
result
;
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
simulation
.json
"
_attachment
:
"
body
.json
"
}).
push
(
function
(
simulation_json
)
{
gadget
.
props
.
series
=
queue_stat_widget
(
JSON
.
parse
(
simulation_json
).
result
.
result_list
[
gadget
.
props
.
result
]);
});
...
...
dream/platform/static/dream/Output_viewSpreadsheet.html
0 → 100644
View file @
69c45e44
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Edit Shift Spreadsheet
</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.js"
type=
"text/javascript"
></script>
<script
src=
"../lib/jquerymobile.js"
type=
"text/javascript"
></script>
<script
src=
"mixin_gadget.js"
type=
"text/javascript"
></script>
<script
src=
"Output_viewSpreadsheet.js"
type=
"text/javascript"
></script>
</head>
<body>
<div
data-gadget-url=
"../handsontable/index.html"
data-gadget-scope=
"tableeditor"
></div>
<form
class=
"save_form"
>
<button
type=
"submit"
class=
"ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right"
>
Save
</button>
</form>
</body>
</html>
dream/platform/static/dream/Output_viewSpreadsheet.js
0 → 100644
View file @
69c45e44
/*global rJS, RSVP, initGadgetMixin, loopEventListener, $ */
(
function
(
window
,
rJS
,
RSVP
,
initGadgetMixin
,
loopEventListener
,
$
)
{
"
use strict
"
;
var
gadget_klass
=
rJS
(
window
);
initGadgetMixin
(
gadget_klass
);
gadget_klass
.
declareAcquiredMethod
(
"
aq_getAttachment
"
,
"
jio_getAttachment
"
).
declareMethod
(
"
render
"
,
function
(
options
)
{
var
jio_key
=
options
.
id
,
gadget
=
this
;
gadget
.
props
.
jio_key
=
jio_key
;
return
new
RSVP
.
Queue
().
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
aq_getAttachment
({
_id
:
jio_key
,
_attachment
:
"
body.json
"
}),
gadget
.
getDeclaredGadget
(
"
tableeditor
"
)
]);
}).
push
(
function
(
result_list
)
{
var
content
=
JSON
.
parse
(
result_list
[
0
]).
result
.
result_list
[
options
.
result
][
options
.
action_definition
.
configuration
.
output_id
],
handsontable_options
=
{
readOnly
:
true
};
$
.
extend
(
handsontable_options
,
options
.
action_definition
.
configuration
.
handsontable_options
||
{});
result_list
[
1
].
render
(
JSON
.
stringify
(
content
),
handsontable_options
);
});
}).
declareMethod
(
"
startService
"
,
function
()
{
var
gadget
=
this
;
return
this
.
getDeclaredGadget
(
"
tableeditor
"
).
push
(
function
(
tableeditor
)
{
return
tableeditor
.
startService
();
});
});
})(
window
,
rJS
,
RSVP
,
initGadgetMixin
,
loopEventListener
,
$
);
\ No newline at end of file
dream/platform/static/dream/Output_viewStationUtilisationGraph.js
View file @
69c45e44
...
...
@@ -104,7 +104,7 @@
gadget
.
props
.
result
=
options
.
result
;
return
gadget
.
aq_getAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
simulation
.json
"
_attachment
:
"
body
.json
"
}).
push
(
function
(
simulation_json
)
{
gadget
.
props
.
result_list
=
station_utilisation_graph_widget
(
JSON
.
parse
(
simulation_json
),
gadget
.
props
.
result
);
});
...
...
dream/platform/static/dream/index.js
View file @
69c45e44
...
...
@@ -61,7 +61,7 @@
}).
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
getAttachment
({
_id
:
options
.
id
,
_attachment
:
"
simulation
.json
"
_attachment
:
"
body
.json
"
});
}).
push
(
function
(
sim_json
)
{
var
document_list
=
JSON
.
parse
(
sim_json
),
current
=
parseInt
(
options
.
result
,
10
);
...
...
@@ -94,7 +94,7 @@
title
=
gadget
.
getDeclaredGadget
(
"
jio
"
).
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
getAttachment
({
_id
:
options
.
id
,
_attachment
:
"
simulation
.json
"
_attachment
:
"
body
.json
"
});
}).
push
(
function
(
sim_json
)
{
var
document_list
=
JSON
.
parse
(
sim_json
).
result
.
result_list
;
...
...
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