Commit 33659245 authored by Rafael Monnerat's avatar Rafael Monnerat

Refactor status gadget (unify)

  This fixed badly merged slapos!394, that contained rebased commits
parent 69bb9229
...@@ -357,7 +357,7 @@ ...@@ -357,7 +357,7 @@
"description": "", "description": "",
"title": result[1][23], "title": result[1][23],
"default": {jio_key: gadget.state.jio_key, "default": {jio_key: gadget.state.jio_key,
result: gadget.state.doc}, result: gadget.state.doc.news},
"css_class": "", "css_class": "",
"required": 0, "required": 0,
"editable": 0, "editable": 0,
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>999.2068.62564.17</string> </value> <value> <string>1001.26171.19762.42854</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1655115718.45</float> <float>1658173330.65</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -153,7 +153,10 @@ ...@@ -153,7 +153,10 @@
"my_monitoring_status": { "my_monitoring_status": {
"description": "", "description": "",
"title": result[2][8], "title": result[2][8],
"default": {jio_key: gadget.state.jio_key}, "default": {
jio_key: gadget.state.jio_key,
result: gadget.state.doc.news
},
"css_class": "", "css_class": "",
"required": 1, "required": 1,
"editable": 0, "editable": 0,
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>999.2068.62564.17</string> </value> <value> <string>1001.26171.19762.42854</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1655115861.91</float> <float>1657906193.21</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -17,15 +17,11 @@ ...@@ -17,15 +17,11 @@
} }
.ui-block-50 { .ui-block-50 {
width: 50%; width: 50% !important;
}
.ui-btn-color-white {
color: white !important;
} }
.ui-btn-hide { .ui-btn-hide {
display: none; display: none !important;
} }
.ui-bar { .ui-bar {
...@@ -89,6 +85,18 @@ ...@@ -89,6 +85,18 @@
text-align: center; text-align: center;
} }
.ui-btn-color-white,
.ui-btn-color-white:active,
.ui-btn-color-white:hover,
.ui-btn-color-white a,
.ui-btn-color-white:active a,
.ui-btn-color-white:hover a {
color: white !important;
background: grey !important;
cursor: default;
text-align: center;
}
.ui-btn-white, .ui-btn-white,
.ui-btn-white:active, .ui-btn-white:active,
...@@ -101,6 +109,10 @@ ...@@ -101,6 +109,10 @@
text-align: center; text-align: center;
} }
a.ui-icon-desktop::before {
margin-left: 5px;
}
/* for Software Logo*/ /* for Software Logo*/
div.editable_div.logo img { div.editable_div.logo img {
object-fit: cover; object-fit: cover;
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1000.57958.38485.23927</string> </value> <value> <string>1001.40386.24679.24320</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1655110268.61</float> <float>1658172898.38</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<body> <body>
<div class="ui-block-a ui-block-50 main-status"> <div class="ui-block-a ui-block-50 main-status">
<div class="ui-bar ui-corner-all first-child ui-btn-no-data"> <div class="ui-bar ui-corner-all first-child ui-btn-no-data">
<a class="ui-btn ui-btn-icon-left ui-icon-spinner ui-btn-color-white"> Compute Node </a> <a class="ui-btn ui-btn-icon-left ui-icon-spinner ui-btn-color-white"> Node </a>
</div> </div>
</div> </div>
<div class="ui-block-c ui-block-50 sub-status"> <div class="ui-block-c ui-block-50 sub-status">
......
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1000.54034.1029.62310</string> </value> <value> <string>1001.26171.19762.42854</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -296,7 +296,7 @@ ...@@ -296,7 +296,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1656702663.09</float> <float>1657906237.75</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
function getInstanceTreeStatus(options) { function getInstanceTreeStatus(options) {
var instance; var instance;
if ((!options) || (options && !options.instance)) { if (!options) {
return 'ui-btn-no-data'; return 'ui-btn-no-data';
} }
...@@ -44,6 +44,10 @@ ...@@ -44,6 +44,10 @@
return 'ui-btn-is-destroyed'; return 'ui-btn-is-destroyed';
} }
if (!options.instance) {
return 'ui-btn-no-data';
}
for (instance in options.instance) { for (instance in options.instance) {
if (options.instance.hasOwnProperty(instance)) { if (options.instance.hasOwnProperty(instance)) {
if (options.instance[instance].text.startsWith("#error")) { if (options.instance[instance].text.startsWith("#error")) {
...@@ -213,29 +217,27 @@ ...@@ -213,29 +217,27 @@
if (result && result.portal_type && result.portal_type === "Compute Node") { if (result && result.portal_type && result.portal_type === "Compute Node") {
main_link_configuration_dict.href = monitor_url; main_link_configuration_dict.href = monitor_url;
main_link_configuration_dict.target = "_target"; main_link_configuration_dict.target = "_target";
main_link_configuration_dict.text = 'Compute Node'; main_link_configuration_dict.text = 'Node';
sub_link_configuration_dict.href = monitor_url; sub_link_configuration_dict.href = monitor_url;
sub_link_configuration_dict.target = "_target"; sub_link_configuration_dict.target = "_target";
sub_link_configuration_dict.text = 'Partitions'; sub_link_configuration_dict.text = 'Partitions';
if (result && result.news && result.news.compute_node) { if (result && result.compute_node) {
status_class = getComputeNodeStatus(result.news.compute_node); status_class = getComputeNodeStatus(result.compute_node);
} }
if ((status_class === 'ui-btn-error') || if ((status_class === 'ui-btn-error') ||
(status_class === 'ui-btn-no-data')) { (status_class === 'ui-btn-no-data')) {
right_class = status_class; right_class = status_class;
} else { } else {
if (result && result.news && result.news.partition) { if (result && result.partition) {
right_class = getComputePartitionStatus( right_class = getComputePartitionStatus(
{compute_partition_news: result.news.partition} {compute_partition_news: result.partition}
); );
} }
} }
} else if (result && result.portal_type && } else if (result && result.portal_type &&
result.portal_type === "Software Installation") { result.portal_type === "Software Installation") {
if (result && result.news) { status_class = getSoftwareInstallationStatus(result);
status_class = getSoftwareInstallationStatus(result.news);
}
main_link_configuration_dict.text = "Installation"; main_link_configuration_dict.text = "Installation";
right_class = "ui-btn-hide"; right_class = "ui-btn-hide";
if (status_class === "ui-btn-is-building") { if (status_class === "ui-btn-is-building") {
...@@ -246,6 +248,7 @@ ...@@ -246,6 +248,7 @@
} else if (status_class === "ui-btn-error") { } else if (status_class === "ui-btn-error") {
main_link_configuration_dict.text = "Error"; main_link_configuration_dict.text = "Error";
} }
main_link_configuration_dict.class = "ui-btn ui-btn-icon-left";
} else if (result && result.portal_type && ( } else if (result && result.portal_type && (
result.portal_type === "Software Instance" || result.portal_type === "Software Instance" ||
result.portal_type === "Slave Instance" result.portal_type === "Slave Instance"
...@@ -253,14 +256,17 @@ ...@@ -253,14 +256,17 @@
status_class = getInstanceStatus(result); status_class = getInstanceStatus(result);
right_class = "ui-btn-hide"; right_class = "ui-btn-hide";
if (status_class === 'ui-btn-is-slave') { if (status_class === 'ui-btn-is-slave') {
status_class = 'ui-btn-no-data ui-btn-color-white'; status_class = 'ui-btn-color-white';
main_link_configuration_dict.text = 'Slave'; main_link_configuration_dict.text = 'Slave';
main_link_configuration_dict.class = "ui-btn ui-btn-icon-left";
} else if (status_class === 'ui-btn-is-stopped') { } else if (status_class === 'ui-btn-is-stopped') {
status_class = 'ui-btn-no-data ui-btn-color-white'; status_class = 'ui-btn-color-white';
main_link_configuration_dict.text = 'Stopped'; main_link_configuration_dict.text = 'Stopped';
main_link_configuration_dict.class = "ui-btn ui-btn-icon-left";
} else if (status_class === 'ui-btn-is-destroyed') { } else if (status_class === 'ui-btn-is-destroyed') {
status_class = 'ui-btn-no-data ui-btn-color-white'; status_class = 'ui-btn-color-white';
main_link_configuration_dict.text = 'Destroyed'; main_link_configuration_dict.text = 'Destroyed';
main_link_configuration_dict.class = "ui-btn ui-btn-icon-left";
} else { } else {
main_link_configuration_dict.href = monitor_url; main_link_configuration_dict.href = monitor_url;
main_link_configuration_dict.target = "_target"; main_link_configuration_dict.target = "_target";
...@@ -268,20 +274,21 @@ ...@@ -268,20 +274,21 @@
} }
} else if (result && result.portal_type && } else if (result && result.portal_type &&
result.portal_type === "Instance Tree") { result.portal_type === "Instance Tree") {
if (result && result.news) { status_class = getInstanceTreeStatus(result);
status_class = getInstanceTreeStatus(result.news);
}
// it should verify if the monitor-base-url is ready. // it should verify if the monitor-base-url is ready.
right_class = "ui-btn-hide"; right_class = "ui-btn-hide";
if (status_class === 'ui-btn-is-slave') { if (status_class === 'ui-btn-is-slave') {
status_class = 'ui-btn-no-data ui-btn-color-white'; status_class = 'ui-btn-color-white';
main_link_configuration_dict.text = 'Slave Only'; main_link_configuration_dict.text = 'Slave Only';
main_link_configuration_dict.class = "ui-btn ui-btn-icon-left";
} else if (status_class === 'ui-btn-is-stopped') { } else if (status_class === 'ui-btn-is-stopped') {
status_class = 'ui-btn-no-data ui-btn-color-white'; status_class = 'ui-btn-color-white';
main_link_configuration_dict.text = 'Stopped'; main_link_configuration_dict.text = 'Stopped';
main_link_configuration_dict.class = "ui-btn ui-btn-icon-left";
} else if (status_class === 'ui-btn-is-destroyed') { } else if (status_class === 'ui-btn-is-destroyed') {
status_class = 'ui-btn-no-data ui-btn-color-white'; status_class = 'ui-btn-color-white';
main_link_configuration_dict.text = 'Destroyed'; main_link_configuration_dict.text = 'Destroyed';
main_link_configuration_dict.class = "ui-btn ui-btn-icon-left";
} else { } else {
main_link_configuration_dict.href = monitor_url; main_link_configuration_dict.href = monitor_url;
main_link_configuration_dict.target = "_target"; main_link_configuration_dict.target = "_target";
...@@ -290,20 +297,22 @@ ...@@ -290,20 +297,22 @@
} else { } else {
main_link_configuration_dict.href = monitor_url; main_link_configuration_dict.href = monitor_url;
main_link_configuration_dict.target = "_target"; main_link_configuration_dict.target = "_target";
main_link_configuration_dict.text = 'Compute Node'; main_link_configuration_dict.text = 'Node';
sub_link_configuration_dict.href = monitor_url; sub_link_configuration_dict.href = monitor_url;
sub_link_configuration_dict.target = "_target"; sub_link_configuration_dict.target = "_target";
sub_link_configuration_dict.text = 'Partitions'; sub_link_configuration_dict.text = 'Partitions';
status_class = getComputeNodeStatusList(result.news); status_class = getComputeNodeStatusList(result);
if ((status_class === 'ui-btn-error') || if ((status_class === 'ui-btn-error') ||
(status_class === 'ui-btn-no-data')) { (status_class === 'ui-btn-no-data')) {
right_class = status_class; right_class = status_class;
} else { } else {
right_class = getComputePartitionStatusList(result.news); right_class = getComputePartitionStatusList(result);
} }
} }
main_link_configuration_dict.text = ' ' + main_link_configuration_dict.text;
sub_link_configuration_dict.text = ' ' + sub_link_configuration_dict.text;
domsugar(main_status_div.querySelector('div'), domsugar(main_status_div.querySelector('div'),
{ {
class: "ui-bar ui-corner-all first-child " + status_class class: "ui-bar ui-corner-all first-child " + status_class
...@@ -316,6 +325,10 @@ ...@@ -316,6 +325,10 @@
}, [ }, [
domsugar("a", sub_link_configuration_dict) domsugar("a", sub_link_configuration_dict)
]); ]);
if (right_class === 'ui-btn-hide') {
// expand main button to use the space
main_status_div.className = "ui-block-a ui-block main-status";
}
return gadget; return gadget;
} }
...@@ -346,7 +359,6 @@ ...@@ -346,7 +359,6 @@
// result is empty. // result is empty.
var state_dict = options.value.result || {}; var state_dict = options.value.result || {};
state_dict.jio_key = options.value.jio_key; state_dict.jio_key = options.value.jio_key;
state_dict.portal_type = options.value.portal_type;
return this.changeState(state_dict); return this.changeState(state_dict);
}); });
......
news_dict = {"instance" : []}
news_dict = { news_dict = {
"portal_type": context.getPortalType(), "portal_type": context.getPortalType(),
"reference": context.getReference(), "reference": context.getReference(),
......
...@@ -5,6 +5,8 @@ if REQUEST is not None: ...@@ -5,6 +5,8 @@ if REQUEST is not None:
portal_type = context.getPortalType() portal_type = context.getPortalType()
if portal_type == "Slave Instance": if portal_type == "Slave Instance":
return { return {
"portal_type": context.getPortalType(),
"reference": context.getReference(),
"user": "SlapOS Master", "user": "SlapOS Master",
"text": "#nodata is a slave %s" % context.getReference(), "text": "#nodata is a slave %s" % context.getReference(),
"monitor_url": context.Base_getStatusMonitorUrl(), "monitor_url": context.Base_getStatusMonitorUrl(),
...@@ -14,6 +16,8 @@ if portal_type == "Slave Instance": ...@@ -14,6 +16,8 @@ if portal_type == "Slave Instance":
slap_state = context.getSlapState() slap_state = context.getSlapState()
if portal_type == "Software Instance" and slap_state == "stop_requested": if portal_type == "Software Instance" and slap_state == "stop_requested":
return { return {
"portal_type": context.getPortalType(),
"reference": context.getReference(),
"user": "SlapOS Master", "user": "SlapOS Master",
"text": "#nodata is an stopped instance %s" % context.getReference(), "text": "#nodata is an stopped instance %s" % context.getReference(),
"monitor_url": context.Base_getStatusMonitorUrl(), "monitor_url": context.Base_getStatusMonitorUrl(),
...@@ -22,6 +26,8 @@ if portal_type == "Software Instance" and slap_state == "stop_requested": ...@@ -22,6 +26,8 @@ if portal_type == "Software Instance" and slap_state == "stop_requested":
if portal_type == "Software Instance" and slap_state == "destroy_requested": if portal_type == "Software Instance" and slap_state == "destroy_requested":
return { return {
"portal_type": context.getPortalType(),
"reference": context.getReference(),
"user": "SlapOS Master", "user": "SlapOS Master",
"text": "#nodata is an destroyed instance %s" % context.getReference(), "text": "#nodata is an destroyed instance %s" % context.getReference(),
"monitor_url": context.Base_getStatusMonitorUrl(), "monitor_url": context.Base_getStatusMonitorUrl(),
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block> </tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_content_loaded" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_content_loaded" />
<tal:block tal:define="header python: 'Computer Network :${title}'; <tal:block tal:define="header python: 'Computer Network :${title}';
...@@ -43,6 +42,21 @@ ...@@ -43,6 +42,21 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block> </tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(0)', 'footer': 'No records'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//input[@id="title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@id="title"]</td>
<td></td>
</tr>
<tr> <tr>
<td>type</td> <td>type</td>
<td>//input[@id="title"]</td> <td>//input[@id="title"]</td>
...@@ -51,16 +65,71 @@ ...@@ -51,16 +65,71 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/save" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/save" />
<tal:block define="document_title python: 'TEST-SLAPOSJS-NETWORK-COMPUTER 0';">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/create_simple_compute_node" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
<!-- check site --> <tr>
<td rowspan="1" colspan="3">Add server into the site</td>
</tr>
<!-- Broken history to return <tal:block define="menu_item python: 'Servers'; header menu_item">
<tr> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<td>click</td> <td>click</td>
<td>//a[@data-i18n="Site : TEST-SLAPOSJS-SET 0"]</td> <td>//a[text()="TEST-SLAPOSJS-NETWORK-COMPUTER 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Compute Node: ${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-NETWORK-COMPUTER 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tr>
<td colspan="3"><b> Add Compute Node into Computer Network </b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="subordination"]</td>
<td></td> <td></td>
</tr> </tr>
--> <tr>
<td>assertElementPresent</td>
<td>//select[@name="subordination"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name="subordination"]</td>
<td>TEST-SLAPOSJS-NETWORK 1</td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/save" />
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_call_slapgrid" />
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
......
...@@ -226,10 +226,79 @@ ...@@ -226,10 +226,79 @@
<td>www.erp5.com</td> <td>www.erp5.com</td>
</tr> </tr>
<!-- Update Parameters -->
<!-- Update Add Ticket --> <tal:block define="menu_action python: 'Stop'">
<!-- Update Stop --> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
<!-- Update Start --> </tal:block>
<tal:block tal:define="header python: 'Stop Instance Tree:${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SERVICE-FRONTEND 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Service is Stopped.'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Stopped')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Stopped')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Stopped')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Stopped')]</td>
<td></td>
</tr>
<tal:block define="menu_action python: 'Start'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
</tal:block>
<tal:block tal:define="header python: 'Start Instance Tree:${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SERVICE-FRONTEND 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Service is Started.'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-error')]//a[contains(text(), 'Instance') and contains(@href, 'TEST-SLAPOSJS-SERVICE-FRONTEND 0')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-error')]//a[contains(text(), 'Instance') and contains(@href, 'TEST-SLAPOSJS-SERVICE-FRONTEND 0')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-no-data')]//a[contains(text(), 'Instance')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-no-data')]//a[contains(text(), 'Instance')]</td>
<td></td>
</tr>
<tal:block define="menu_action python: 'Destroy'"> <tal:block define="menu_action python: 'Destroy'">
...@@ -247,6 +316,29 @@ ...@@ -247,6 +316,29 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block> </tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" /> <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"> <tal:block define="menu_item python: 'Services'; header menu_item">
......
...@@ -142,6 +142,16 @@ ...@@ -142,6 +142,16 @@
<td>//a[text()="TEST-SLAPOSJS-SERVICE-FRONTEND 0"]</td> <td>//a[text()="TEST-SLAPOSJS-SERVICE-FRONTEND 0"]</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td></td>
</tr>
<tr> <tr>
<td>click</td> <td>click</td>
<td>//a[text()="TEST-SLAPOSJS-SERVICE-FRONTEND 0"]</td> <td>//a[text()="TEST-SLAPOSJS-SERVICE-FRONTEND 0"]</td>
...@@ -158,11 +168,102 @@ ...@@ -158,11 +168,102 @@
<td></td> <td></td>
</tr> </tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td></td>
</tr>
<!-- Update Parameters --> <!-- Update Parameters -->
<!-- Update Add Ticket --> <!-- Update Add Ticket -->
<!-- Update Stop -->
<!-- Update Start -->
<tal:block define="menu_action python: 'Stop'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
</tal:block>
<tal:block tal:define="header python: 'Stop Instance Tree:${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SERVICE-FRONTEND 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Service is Stopped.'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Stopped')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Stopped')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td></td>
</tr>
<tal:block define="menu_action python: 'Start'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
</tal:block>
<tal:block tal:define="header python: 'Start Instance Tree:${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SERVICE-FRONTEND 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Service is Started.'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td></td>
</tr>
<tal:block define="menu_action python: 'Destroy'"> <tal:block define="menu_action python: 'Destroy'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
...@@ -178,6 +279,26 @@ ...@@ -178,6 +279,26 @@
'text': 'Service is Destroyed.'}"> 'text': 'Service is Destroyed.'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block> </tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
......
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