Commit a002a2d0 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Add message for State/Stop

parent 4af007fa
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("updatePanel", "updatePanel")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
...@@ -26,7 +28,10 @@ ...@@ -26,7 +28,10 @@
.onEvent('submit', function () { .onEvent('submit', function () {
var gadget = this; var gadget = this;
return gadget.getDeclaredGadget('form_view') return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) { .push(function (form_gadget) {
return form_gadget.getContent(); return form_gadget.getContent();
}) })
...@@ -37,9 +42,13 @@ ...@@ -37,9 +42,13 @@
url + doc.relative_url + "/InstanceTree_requestPerson", {state: "started"}); url + doc.relative_url + "/InstanceTree_requestPerson", {state: "started"});
}); });
}) })
.push(function () {
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () { .push(function () {
// Workaround, find a way to open document without break gadget. // Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change", "options": {"page": "slap_controller"}}); return gadget.redirect({"command": "change",
"options": {"page": "slap_controller"}});
});
}); });
}) })
...@@ -52,7 +61,9 @@ ...@@ -52,7 +61,9 @@
page_title_translation, page_title_translation,
translation_list = [ translation_list = [
"Parent Relative Url", "Parent Relative Url",
"Start Instance Tree:" "Start Instance Tree:",
"Service is Started."
]; ];
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
...@@ -65,6 +76,7 @@ ...@@ -65,6 +76,7 @@
.push(function (result) { .push(function (result) {
options.doc = result[1]; options.doc = result[1];
page_title_translation = result[2][1]; page_title_translation = result[2][1];
gadget.message_translation = result[2][2];
return result[0].render({ return result[0].render({
erp5_document: { erp5_document: {
"_embedded": {"_view": { "_embedded": {"_view": {
......
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.11753.9371.59426</string> </value> <value> <string>1001.45009.50995.61354</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1602256083.33</float> <float>1658181254.36</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("updatePanel", "updatePanel")
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_post", "jio_post") .declareAcquiredMethod("jio_post", "jio_post")
...@@ -26,7 +28,10 @@ ...@@ -26,7 +28,10 @@
.onEvent('submit', function () { .onEvent('submit', function () {
var gadget = this; var gadget = this;
return gadget.getDeclaredGadget('form_view') return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) { .push(function (form_gadget) {
return form_gadget.getContent(); return form_gadget.getContent();
}) })
...@@ -37,9 +42,13 @@ ...@@ -37,9 +42,13 @@
url + doc.relative_url + "/InstanceTree_requestPerson", {state: "stopped"}); url + doc.relative_url + "/InstanceTree_requestPerson", {state: "stopped"});
}); });
}) })
.push(function () {
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
.push(function () { .push(function () {
// Workaround, find a way to open document without break gadget. // Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change", "options": {"page": "slap_controller"}}); return gadget.redirect({"command": "change",
"options": {"page": "slap_controller"}});
});
}); });
}) })
...@@ -52,7 +61,9 @@ ...@@ -52,7 +61,9 @@
page_title_translation, page_title_translation,
translation_list = [ translation_list = [
"Parent Relative Url", "Parent Relative Url",
"Stop Instance Tree:" "Stop Instance Tree:",
"Service is Stopped."
]; ];
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
...@@ -65,6 +76,7 @@ ...@@ -65,6 +76,7 @@
.push(function (result) { .push(function (result) {
options.doc = result[1]; options.doc = result[1];
page_title_translation = result[2][1]; page_title_translation = result[2][1];
gadget.message_translation = result[2][2];
return result[0].render({ return result[0].render({
erp5_document: { erp5_document: {
"_embedded": {"_view": { "_embedded": {"_view": {
......
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.11752.29554.51882</string> </value> <value> <string>1001.45008.17324.2952</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1602255869.31</float> <float>1658207423.89</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment