Commit a002a2d0 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Add message for State/Stop

parent 4af007fa
......@@ -9,6 +9,8 @@
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updatePanel", "updatePanel")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect")
......@@ -26,7 +28,10 @@
.onEvent('submit', function () {
var gadget = this;
return gadget.getDeclaredGadget('form_view')
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.getContent();
})
......@@ -37,9 +42,13 @@
url + doc.relative_url + "/InstanceTree_requestPerson", {state: "started"});
});
})
.push(function () {
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": {"page": "slap_controller"}});
return gadget.redirect({"command": "change",
"options": {"page": "slap_controller"}});
});
});
})
......@@ -52,7 +61,9 @@
page_title_translation,
translation_list = [
"Parent Relative Url",
"Start Instance Tree:"
"Start Instance Tree:",
"Service is Started."
];
return new RSVP.Queue()
.push(function () {
......@@ -65,6 +76,7 @@
.push(function (result) {
options.doc = result[1];
page_title_translation = result[2][1];
gadget.message_translation = result[2][2];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
......
......@@ -279,7 +279,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>987.11753.9371.59426</string> </value>
<value> <string>1001.45009.50995.61354</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -297,7 +297,7 @@
</tuple>
<state>
<tuple>
<float>1602256083.33</float>
<float>1658181254.36</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -10,6 +10,8 @@
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updatePanel", "updatePanel")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_post", "jio_post")
......@@ -26,7 +28,10 @@
.onEvent('submit', function () {
var gadget = this;
return gadget.getDeclaredGadget('form_view')
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.getContent();
})
......@@ -37,9 +42,13 @@
url + doc.relative_url + "/InstanceTree_requestPerson", {state: "stopped"});
});
})
.push(function () {
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": {"page": "slap_controller"}});
return gadget.redirect({"command": "change",
"options": {"page": "slap_controller"}});
});
});
})
......@@ -52,7 +61,9 @@
page_title_translation,
translation_list = [
"Parent Relative Url",
"Stop Instance Tree:"
"Stop Instance Tree:",
"Service is Stopped."
];
return new RSVP.Queue()
.push(function () {
......@@ -65,6 +76,7 @@
.push(function (result) {
options.doc = result[1];
page_title_translation = result[2][1];
gadget.message_translation = result[2][2];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
......
......@@ -279,7 +279,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>987.11752.29554.51882</string> </value>
<value> <string>1001.45008.17324.2952</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -297,7 +297,7 @@
</tuple>
<state>
<tuple>
<float>1602255869.31</float>
<float>1658207423.89</float>
<string>UTC</string>
</tuple>
</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