-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #473 from Sae126V/GT-141-Add-Support-to-Pre-select…
…-site,-services-and-endpoints [GT-141] Add support for pre selecting endpoints
- Loading branch information
Showing
4 changed files
with
164 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 43 additions & 12 deletions
55
htdocs/web_portal/views/downtime/view_nested_endpoints_list.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,57 @@ | ||
<?php | ||
$services = $params['services']; | ||
$specificServiceEndpoint = isset($params['se']) ? $params['se'] : ''; | ||
$configService = \Factory::getConfigService(); | ||
|
||
?> | ||
<!-- Dynamically create a select list from a sites services --> | ||
<label> Select Affected Services+Endpoints (Ctrl+click to select)</label> | ||
<select name="IMPACTED_IDS[]" id="Select_Services" size="10" class="form-control" onclick="" style="width:99%; margin-left:1%" onChange="selectServicesEndpoint()" multiple> | ||
<?php | ||
foreach($services as $service){ | ||
$count=0; | ||
echo "<option value=\"s" . $service->getId() . "\" id=\"" . $service->getId() . "\" SELECTED>" . '('.xssafe($service->getServiceType()->getName()).') '.xssafe($service->getHostName()) . "</option>"; | ||
foreach($service->getEndpointLocations() as $endpoint){ | ||
if($endpoint->getName() == ''){ | ||
$name = xssafe('myEndpoint'); | ||
}else{ | ||
$name = xssafe($endpoint->getName()); | ||
foreach ($services as $service) { | ||
$count = 0; | ||
|
||
if ($specificServiceEndpoint) { | ||
if ($service->getId() == $specificServiceEndpoint) { | ||
$selected = 'SELECTED'; | ||
} else { | ||
$selected = ''; | ||
} | ||
} else { | ||
$selected = 'SELECTED'; | ||
} | ||
|
||
echo "<option value=\"s" . $service->getId() . "\" id=\"" | ||
. $service->getId() . "\" " . $selected . ">" . '(' | ||
. xssafe($service->getServiceType()->getName()) . ') ' | ||
. xssafe($service->getHostName()) . "</option>"; | ||
|
||
foreach ($service->getEndpointLocations() as $endpoint) { | ||
if ($specificServiceEndpoint) { | ||
if ($service->getId() == $specificServiceEndpoint) { | ||
$selected = 'SELECTED'; | ||
} else { | ||
$selected = ''; | ||
} | ||
//Option styling doesn't work well cross browser so just use 4 spaces to indent the branch | ||
echo "<option id=\"".$service->getId()."\" value=\"e" . $endpoint->getId() . "\" SELECTED>    -" . $name . "</option>"; | ||
$count++; | ||
} else { | ||
$selected = 'SELECTED'; | ||
} | ||
|
||
if ($endpoint->getName() == '') { | ||
$name = xssafe('myEndpoint'); | ||
} else { | ||
$name = xssafe($endpoint->getName()); | ||
} | ||
|
||
/** | ||
* Option styling doesn't work well cross browser, | ||
* so just use 4 spaces to indent the branch. | ||
*/ | ||
echo "<option id=\"" . $service->getId() . "\" value=\"e" | ||
. $endpoint->getId() . "\" " . $selected | ||
. ">    -" . $name . "</option>"; | ||
|
||
$count++; | ||
} | ||
} | ||
?> | ||
</select> |