Skip to content

Commit

Permalink
Merge pull request #12 from grycap/devel
Browse files Browse the repository at this point in the history
Add the TOSCA outputs
  • Loading branch information
micafer committed Mar 4, 2016
2 parents aa600c8 + cd9d604 commit 618f081
Show file tree
Hide file tree
Showing 4 changed files with 185 additions and 2 deletions.
2 changes: 1 addition & 1 deletion getcontmsg.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<div id='cssmenutab'>
<ul>
<li><a href='list.php'><span>List</span></a></li>
<li class='active'><a><span>Inf id: 0</span></a></li>
<li class='active'><a><span>Inf id: <?php echo $id;?></span></a></li>
</ul>
</div>
</div>
Expand Down
151 changes: 151 additions & 0 deletions getoutputs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
<?php
/*
IM - Infrastructure Manager
Copyright (C) 2011 - GRyCAP - Universitat Politecnica de Valencia
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

if(!isset($_SESSION)) session_start();

include('user.php');
if (!check_session_user()) {
header('Location: index.php?error=Invalid User');
} else {
if (isset($_GET['id'])) {
include('im.php');
include('config.php');
$id = $_GET['id'];
$outputs = GetOutputs($im_host,$im_port,$id);
}

?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" >
<title>Infrastructure Manager | GRyCAP | UPV</title>
<link rel="shortcut icon" href="images/favicon.ico">
<link href="css/style.css" rel="stylesheet" type="text/css" media="all"/>
<link rel="stylesheet" href="css/style_login2.css">
<link rel="stylesheet" href="css/style_intro2.css">
<link rel="stylesheet" href="css/style_menu2.css">
<link rel="stylesheet" href="css/style_menutab.css">



</head>
<body>

<?php include('radl.php')?>



<div id="caja_total_blanca">





<?php include('header.php')?>
<?php $menu="Infrastructures";include('menu.php');?>
<?php include('footer.php')?>







<div id="caja_titulo">
<div id="texto_titulo">
Infrastructure Manager > Infrastructures&nbsp&nbsp&nbsp<img class="imagentitulo" src="images/icon_infra_gran.png">
</div>
</div>


<div id="caja_contenido_menutab">

<div id='cssmenutab'>
<ul>
<li><a href='list.php'><span>List</span></a></li>
<li class='active'><a><span>Inf id: <?php echo $id;?></span></a></li>
</ul>
</div>
</div>


<div id="caja_contenido_tab">


<div id="main">


<div class='h1'>:: TOSCA outputs::</div>
<br>
<div id='log'>

<table class="list" style="width:100%;margin-left: 0px;">
<tbody>
<tr>
<td style="width:10px;background:#a27c3b;"><img src="images/icon_info.png"></td>
<th style="width:90px;">Outputs</th>
<td style="text-align:left;background:#e9d6b5;">
<table>

<?php
foreach ($outputs as $key => $value) {
?>
<tr>
<td>
<?php echo $key;?>
</td>
<td>
<?php
if (preg_match("@^(?:[^.]://)?([^/]+)@i", $value)) {
echo "<a href='", $value, "' target='_blank'>", $value, "</a>";
} else {
echo $value;
}
?>
</td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
</tbody>
</table>

</div>


</div>

</form>


</div>

</body>
</html>
<?php
}
?>




5 changes: 5 additions & 0 deletions im-rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,9 @@ function Reconfigure($host, $port, $inf_id, $radl) {
$res = BasicRESTCall("PUT", $host, $port, '/infrastructures/' . $inf_id . '/reconfigure', $radl, $headers);
return $res->getOutput();
}

function GetOutputs($host, $port, $inf_id) {
$res = BasicRESTCall("GET", $host, $port, '/infrastructures/' . $inf_id . '/outputs');
return json_decode($res->getOutput());
}
?>
29 changes: 28 additions & 1 deletion list.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@


<div id="main">


<?php
if (count($res) > 0)
Expand All @@ -112,6 +111,14 @@ function confirm_delete(url, id) {
{ "bSortable": true },
{ "bSortable": false },
{ "bSortable": false },
<?php
if ($im_use_rest)
{
?>
{ "bSortable": false },
<?php
}
?>
{ "bSortable": true },
{ "bSortable": false },
{ "bSortable": false },
Expand All @@ -136,6 +143,16 @@ function confirm_delete(url, id) {
<th>
VM IDs
</th>
<?php
if ($im_use_rest)
{
?>
<th width="100px">
Outputs
</th>
<?php
}
?>
<th width="100px">
Cont. Message
</th>
Expand Down Expand Up @@ -179,6 +196,16 @@ function confirm_delete(url, id) {
}
?>
</td>
<?php
if ($im_use_rest)
{
?>
<td>
<a href="getoutputs.php?id=<?php echo $inf;?>">Show</a>
</td>
<?php
}
?>
<td>
<a href="getcontmsg.php?id=<?php echo $inf;?>">Show</a>
</td>
Expand Down

0 comments on commit 618f081

Please sign in to comment.