Skip to content

Commit

Permalink
Improved interface and help for admin servers page
Browse files Browse the repository at this point in the history
  • Loading branch information
mullen2 committed Jun 4, 2024
1 parent fcc96f8 commit fd51afb
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 15 deletions.
6 changes: 4 additions & 2 deletions classes/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,10 @@ class Help
'etl-servers' =>
"<p>"
. "The REDCap-ETL external module uses ETL servers to process users' ETL configurations and workflows."
. " The external module"
. " includes a built-in ETL server, called the \"embedded server\", which runs within REDCap."
. " REDCap-ETL includes a built-in ETL server, called the \"embedded server\", which runs within REDCap,"
. " and which cannot be copied, renamed or deleted."
. "<p>"
. "</p>"
. " You can also add configurations here for any remote ETL servers you have set up."
. " Remote ETL servers run outside of your REDCap server, and they can"
. " be used to reduce the ETL processing load on your REDCap server and to get around"
Expand Down
10 changes: 10 additions & 0 deletions resources/redcap-etl.css
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,13 @@ a.etl-help {
padding: 1em;
}

/* ETL Form */
input.etl-submit, button.etl-submit {
padding-left: 1em;
padding-right: 1em;
font-size: 110%;
font-weight: bold;
color: #000080;
}


8 changes: 4 additions & 4 deletions tests/web/src/EtlServersPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static function followServer($session, $serverName)

# Find the table row where the first element matches the server name, and then get the
# 4th column element and click it
$element = $page->find("xpath", "//tr/td[text()='".$serverName."']/following-sibling::td[3]/a");
$element = $page->find("xpath", "//tr/td[text()='".$serverName."']/following-sibling::td[5]/a");
# print("SERVER LINK: " . $element->getHtml());
$element->click();
}
Expand All @@ -43,7 +43,7 @@ public static function copyServer($session, $serverName, $copyToServerName)

# Find the table row where the first element matches the server name, and then get the
# 5th column element and click it
$element = $page->find("xpath", "//tr/td[text()='".$serverName."']/following-sibling::td[4]/input");
$element = $page->find("xpath", "//tr/td[text()='".$serverName."']/following-sibling::td[6]/input");
$element->click();

sleep(3);
Expand All @@ -59,7 +59,7 @@ public static function renameServer($session, $serverName, $renameNewServerName)

# Find the table row where the first element matches the server name, and then get the
# 6th column element and click it
$element = $page->find("xpath", "//tr/td[text()='".$serverName."']/following-sibling::td[5]/input");
$element = $page->find("xpath", "//tr/td[text()='".$serverName."']/following-sibling::td[7]/input");
$element->click();

sleep(3);
Expand All @@ -81,7 +81,7 @@ public static function deleteServer($session, $serverName)

# Find the table row where the first element matches the server name, and then get the
# 7th column element and click it
$element = $page->find("xpath", "//tr/td[text()='".$serverName."']/following-sibling::td[6]/input");
$element = $page->find("xpath", "//tr/td[text()='".$serverName."']/following-sibling::td[8]/input");

# print "SERVER NAME: {$serverName}\n";
if (isset($element)) {
Expand Down
4 changes: 2 additions & 2 deletions web/admin/server_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,10 @@

<div style="margin-top: 20px;">
<div style="width: 50%; float: left;">
<input type="submit" name="submitValue" value="Save" style="margin: auto; display: block;">
<input type="submit" name="submitValue" value="Save" class="etl-submit" style="margin: auto; display: block;">
</div>
<div style="width: 50%; float: right;">
<input type="submit" name="submitValue" value="Cancel" style="margin: auto; display: block;">
<input type="submit" name="submitValue" value="Cancel" class="etl-submit" style="margin: auto; display: block;">
</div>
<div style="clear: both;">
</div>
Expand Down
36 changes: 29 additions & 7 deletions web/admin/servers.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@

<table class="dataTable">
<thead>
<tr> <th>ETL Server Name</th> <th>Active</th> </th><th>Access</th><th>Configure</th>
<th>Copy</th> <th>Rename</th> </th><th>Delete</th> </th></tr>
<tr> <th>ETL Server Name</th> <th>Active</th> </th> <th>Access</th> <th>Run</th> <th>Schedule</th>
<th>Configure</th> <th>Copy</th> <th>Rename</th> </th><th>Delete</th> </th></tr>
</thead>
<tbody>
<?php
Expand All @@ -143,7 +143,7 @@
#-------------------------------
# Active
#-------------------------------
echo '<td style="text-align:center;">';
echo '<td style="text-align:center; border-left: 1px solid rgba(0, 0, 0, 0.3);">';
if ($serverConfig->getIsActive()) {
echo '<img src="' . APP_PATH_IMAGES . 'tick.png" alt="Yes">';
} else {
Expand All @@ -158,14 +158,36 @@
if (empty($accessLevel)) {
$accessLevel = 'public';
}
echo '<td style="text-align:center;">';
echo '<td style="text-align: center;">';
echo $accessLevel;
echo "</td>\n";

#-------------------------------
# Run
#-------------------------------
echo '<td style="text-align: center;">';
if ($serverConfig->getAllowOnDemandRun()) {
echo '<img src="' . APP_PATH_IMAGES . 'tick.png" alt="Yes">';
} else {
echo '<img src="' . APP_PATH_IMAGES . 'cross.png" alt="No">';
}
echo '</td>';

#-------------------------------
# Schedule
#-------------------------------
echo '<td style="text-align: center;">';
if ($serverConfig->getAllowCronRun()) {
echo '<img src="' . APP_PATH_IMAGES . 'tick.png" alt="Yes">';
} else {
echo '<img src="' . APP_PATH_IMAGES . 'cross.png" alt="No">';
}
echo ' </td>';

#-------------------------------
# Configure
#-------------------------------
echo '<td style="text-align:center;">'
echo '<td style="text-align:center; border-left: 1px solid rgba(0, 0, 0, 0.3);">'
. '<a href="' . $serverConfigureUrl . '">'
. '<img src="' . APP_PATH_IMAGES . 'gear.png" alt="CONFIG"></a>'
. "</td>\n";
Expand Down Expand Up @@ -303,8 +325,8 @@
$(document).ready(function() {
$( function() {
$('#etl-servers-help-link').click(function () {
$('#etl-servers-help').dialog({dialogClass: 'redcap-etl-help', width: 440, maxHeight: 440})
.dialog('widget').position({my: 'left top', at: 'right-184 top+144', of: $(this)})
$('#etl-servers-help').dialog({dialogClass: 'redcap-etl-help', width: 540, maxHeight: 440})
.dialog('widget').position({my: 'left top', at: 'right-194 top+124', of: $(this)})
;
return false;
});
Expand Down

0 comments on commit fd51afb

Please sign in to comment.