Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
295154cb
Commit
295154cb
authored
May 12, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
Fixup redirection after request an instance
See merge request
nexedi/slapos.core!529
parents
94999b09
53ee9096
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
41 deletions
+56
-41
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_instance_tree_js.js
..._module/rjs_gadget_erp5_page_slap_add_instance_tree_js.js
+18
-8
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_instance_tree_js.xml
...module/rjs_gadget_erp5_page_slap_add_instance_tree_js.xml
+2
-2
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_intent_js.js
...em/web_page_module/rjs_gadget_erp5_page_slap_intent_js.js
+24
-28
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_intent_js.xml
...m/web_page_module/rjs_gadget_erp5_page_slap_intent_js.xml
+2
-2
master/bt5/slapos_jio_ui_test/PathTemplateItem/portal_tests/slaposjs_zuite/testSlapOSJSService.zpt
...eItem/portal_tests/slaposjs_zuite/testSlapOSJSService.zpt
+10
-1
No files found.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_instance_tree_js.js
View file @
295154cb
/*global window, rJS, RSVP, btoa */
/*global window, rJS, RSVP, btoa
, jIO, JSON
*/
/*jslint nomen: true, indent: 2, maxerr: 3, sub:true */
(
function
(
window
,
rJS
,
RSVP
)
{
(
function
(
window
,
rJS
,
RSVP
,
btoa
,
jIO
,
JSON
)
{
"
use strict
"
;
rJS
(
window
)
...
...
@@ -50,12 +50,22 @@
return
gadget
.
jio_putAttachment
(
doc
.
relative_url
,
url
+
doc
.
relative_url
+
"
/SoftwareRelease_requestInstanceTree
"
,
doc
);
})
.
push
(
function
(
attachment
)
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
jIO
.
util
.
readBlobAsText
(
attachment
.
target
.
response
);
})
.
push
(
function
(
response
)
{
return
JSON
.
parse
(
response
.
target
.
result
);
})
.
push
(
function
(
relative_url
)
{
return
gadget
.
notifySubmitted
({
message
:
gadget
.
message2_translation
,
status
:
'
success
'
})
.
push
(
function
()
{
// Workaround, find a way to open document without break gadget.
return
gadget
.
redirect
({
"
command
"
:
"
change
"
,
"
options
"
:
{
"
jio_key
"
:
"
/
"
,
"
page
"
:
"
slap_service_list
"
}});
"
options
"
:
{
"
jio_key
"
:
relative_url
,
"
page
"
:
"
slap_controller
"
}});
});
});
},
function
(
error
)
{
if
(
error
.
target
.
status
===
409
)
{
...
...
@@ -224,4 +234,4 @@
});
});
});
}(
window
,
rJS
,
RSVP
));
\ No newline at end of file
}(
window
,
rJS
,
RSVP
,
btoa
,
jIO
,
JSON
));
\ No newline at end of file
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_instance_tree_js.xml
View file @
295154cb
...
...
@@ -283,7 +283,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
100
0.31175.43828.12919
</string>
</value>
<value>
<string>
100
8.22803.51783.61098
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -303,7 +303,7 @@
</tuple>
<state>
<tuple>
<float>
16
69310140.1
3
</float>
<float>
16
83853456.4
3
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_intent_js.js
View file @
295154cb
/*global window, rJS, RSVP */
/*global window, rJS, RSVP
, JSON , jIO
*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
)
{
(
function
(
window
,
rJS
,
RSVP
,
JSON
,
jIO
)
{
"
use strict
"
;
rJS
(
window
)
...
...
@@ -42,7 +42,8 @@
"
New service created.
"
,
"
Intent not supported
"
,
"
Requesting a service…
"
,
"
Instance
"
"
Instance
"
,
];
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
...
...
@@ -135,33 +136,28 @@
}
return
gadget
.
notifySubmitting
()
.
push
(
function
()
{
var
query
=
[];
query
.
push
(
"
title=
"
+
encodeURIComponent
(
doc
.
title
));
return
gadget
.
getSetting
(
"
hateoas_url
"
)
.
push
(
function
(
url
)
{
return
gadget
.
jio_putAttachment
(
doc
.
relative_url
,
url
+
doc
.
relative_url
+
"
/SoftwareRelease_requestInstanceTree
"
,
doc
);
})
if
(
doc
.
software_type
)
{
query
.
push
(
"
software_type=
"
+
encodeURIComponent
(
doc
.
software_type
));
}
if
(
doc
.
shared
)
{
query
.
push
(
"
shared:int=
"
+
encodeURIComponent
(
doc
.
shared
));
}
if
(
doc
.
text_content
)
{
query
.
push
(
"
text_content=
"
+
encodeURIComponent
(
doc
.
text_content
));
}
if
(
doc
.
sla_xml
)
{
query
.
push
(
"
sla_xml=
"
+
encodeURIComponent
(
doc
.
sla_xml
));
}
return
gadget
.
jio_getAttachment
(
doc
.
relative_url
,
url
+
doc
.
relative_url
+
"
/SoftwareRelease_requestInstanceTree?
"
+
query
.
join
(
"
&
"
));
.
push
(
function
(
attachment
)
{
return
jIO
.
util
.
readBlobAsText
(
attachment
.
target
.
response
);
})
.
push
(
function
(
key
)
{
return
gadget
.
notifySubmitted
({
message
:
gadget
.
message_tranlation
,
status
:
'
success
'
})
.
push
(
function
(
response
)
{
return
JSON
.
parse
(
response
.
target
.
result
);
})
.
push
(
function
(
relative_url
)
{
return
gadget
.
notifySubmitted
({
message
:
gadget
.
message_translation
,
status
:
'
success
'
})
.
push
(
function
()
{
// Workaround, find a way to open document without break gadget.
return
gadget
.
redirect
({
"
command
"
:
"
change
"
,
"
options
"
:
{
"
jio_key
"
:
key
,
"
page
"
:
"
slap_controller
"
}});
"
options
"
:
{
"
jio_key
"
:
relative_url
,
"
page
"
:
"
slap_controller
"
}});
});
});
});
});
});
});
}(
window
,
rJS
,
RSVP
));
}(
window
,
rJS
,
RSVP
,
JSON
,
jIO
));
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_intent_js.xml
View file @
295154cb
...
...
@@ -283,7 +283,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1008.
12332.26729.18090
</string>
</value>
<value>
<string>
1008.
22835.52422.8345
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -303,7 +303,7 @@
</tuple>
<state>
<tuple>
<float>
1683
224657.13
</float>
<float>
1683
854663.4
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio_ui_test/PathTemplateItem/portal_tests/slaposjs_zuite/testSlapOSJSService.zpt
View file @
295154cb
...
...
@@ -126,7 +126,16 @@
'text': 'New service created.'}"
>
<tal:block
metal:use-macro=
"here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification"
/>
</tal:block>
<tr
tal:define=
"dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SERVICE-FRONTEND 0'})"
>
<td>
waitForElementPresent
</td>
<td
tal:content=
"python: '//a[@data-i18n= \'%s\']' % (here.Base_translateString('Instance Tree: ${title}', mapping=context.REQUEST.get('mapping', {}), lang=lang))"
></td>
<td></td>
</tr>
<tr
tal:define=
"dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SERVICE-FRONTEND 0'})"
>
<td>
assertElementPresent
</td>
<td
tal:content=
"python: '//a[@data-i18n= \'%s\']' % (here.Base_translateString('Instance Tree: ${title}', mapping=context.REQUEST.get('mapping', {}), lang=lang))"
></td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page"
/>
<tal:block
define=
"menu_item python: 'Services'; header menu_item"
>
...
...
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