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
bfe38391
Commit
bfe38391
authored
Apr 08, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make a "widget" for debug json
parent
a9f7ce10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
dream/platform/static/src/dream.js
dream/platform/static/src/dream.js
+7
-0
dream/platform/static/src/dream_launcher.js
dream/platform/static/src/dream_launcher.js
+1
-9
No files found.
dream/platform/static/src/dream.js
View file @
bfe38391
...
@@ -516,6 +516,10 @@
...
@@ -516,6 +516,10 @@
});
});
}
}
function
debug_json_widget
(
input_data
,
output_data
)
{
$
(
"
#json_output
"
).
val
(
JSON
.
stringify
(
input_data
,
undefined
,
"
"
));
$
(
"
#json_result
"
).
val
(
JSON
.
stringify
(
output_data
,
undefined
,
"
"
));
}
scope
.
Dream
=
function
(
configuration
)
{
scope
.
Dream
=
function
(
configuration
)
{
var
that
=
jsonPlumb
(),
var
that
=
jsonPlumb
(),
...
@@ -851,6 +855,9 @@
...
@@ -851,6 +855,9 @@
if
(
configuration
[
'
Dream-Configuration
'
].
gui
.
job_gantt
){
if
(
configuration
[
'
Dream-Configuration
'
].
gui
.
job_gantt
){
job_gantt_widget
(
input
,
result
);
job_gantt_widget
(
input
,
result
);
}
}
if
(
configuration
[
'
Dream-Configuration
'
].
gui
.
debug_json
){
debug_json_widget
(
input
,
result
);
}
// hack: make the tabs full width
// hack: make the tabs full width
$
(
"
#reports li
"
).
width
((
100
/
$
(
"
#reports li:visible
"
).
length
)
-
1
+
'
%
'
);
$
(
"
#reports li
"
).
width
((
100
/
$
(
"
#reports li:visible
"
).
length
)
-
1
+
'
%
'
);
...
...
dream/platform/static/src/dream_launcher.js
View file @
bfe38391
...
@@ -69,7 +69,6 @@
...
@@ -69,7 +69,6 @@
$
(
'
#result_zone
'
).
hide
();
$
(
'
#result_zone
'
).
hide
();
$
(
'
#shift_spreadsheet
'
).
hide
();
$
(
'
#shift_spreadsheet
'
).
hide
();
$
(
"
#debug_json
"
).
hide
();
$
(
"
#wip_part_spreadsheet
"
).
hide
();
$
(
"
#wip_part_spreadsheet
"
).
hide
();
if
(
configuration
[
'
Dream-Configuration
'
].
gui
.
wip_part_spreadsheet
){
if
(
configuration
[
'
Dream-Configuration
'
].
gui
.
wip_part_spreadsheet
){
...
@@ -78,9 +77,6 @@
...
@@ -78,9 +77,6 @@
if
(
configuration
[
'
Dream-Configuration
'
].
gui
.
shift_spreadsheet
){
if
(
configuration
[
'
Dream-Configuration
'
].
gui
.
shift_spreadsheet
){
$
(
"
#shift_spreadsheet
"
).
show
();
$
(
"
#shift_spreadsheet
"
).
show
();
}
}
if
(
configuration
[
'
Dream-Configuration
'
].
gui
.
debug_json
){
$
(
"
#debug_json
"
).
show
();
}
try
{
try
{
// spreadsheets
// spreadsheets
...
@@ -124,8 +120,7 @@
...
@@ -124,8 +120,7 @@
dream_instance
.
updateGeneralProperties
(
data
.
general
);
dream_instance
.
updateGeneralProperties
(
data
.
general
);
dream_instance
.
prepareDialogForGeneralProperties
();
dream_instance
.
prepareDialogForGeneralProperties
();
$
(
"
#json_output
"
).
val
(
JSON
.
stringify
(
dream_instance
.
getData
(),
undefined
,
"
"
));
if
(
$
.
isEmptyObject
(
coordinates
))
{
if
(
$
.
isEmptyObject
(
coordinates
))
{
dream_instance
.
positionGraph
();
dream_instance
.
positionGraph
();
}
else
{
}
else
{
...
@@ -145,7 +140,6 @@
...
@@ -145,7 +140,6 @@
}
}
// once the data is read, we can subscribe to every changes
// once the data is read, we can subscribe to every changes
$
.
subscribe
(
"
Dream.Gui.onDataChange
"
,
function
(
event
,
data
)
{
$
.
subscribe
(
"
Dream.Gui.onDataChange
"
,
function
(
event
,
data
)
{
$
(
"
#json_output
"
).
val
(
JSON
.
stringify
(
data
,
undefined
,
"
"
));
jio
.
put
({
jio
.
put
({
_id
:
"
dream_demo
"
,
_id
:
"
dream_demo
"
,
data
:
data
data
:
data
...
@@ -186,7 +180,6 @@
...
@@ -186,7 +180,6 @@
$
(
'
#result_list
'
).
empty
();
$
(
'
#result_list
'
).
empty
();
$
(
'
#error
'
).
empty
();
$
(
'
#error
'
).
empty
();
if
(
data
[
'
success
'
])
{
if
(
data
[
'
success
'
])
{
$
(
"
#json_result
"
).
val
(
JSON
.
stringify
(
data
.
data
,
undefined
,
"
"
));
$
.
each
(
data
.
data
,
function
(
idx
,
result
)
{
$
.
each
(
data
.
data
,
function
(
idx
,
result
)
{
$
(
'
#result_list
'
).
append
(
'
<li class="result"></li>
'
);
$
(
'
#result_list
'
).
append
(
'
<li class="result"></li>
'
);
...
@@ -263,7 +256,6 @@
...
@@ -263,7 +256,6 @@
},
},
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
form
.
reset
();
form
.
reset
();
$
(
"
#json_output
"
).
val
(
JSON
.
stringify
(
data
));
loadData
(
data
);
loadData
(
data
);
}
}
});
});
...
...
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