Commit a7e04db2 authored by jlopez's avatar jlopez

Merge branch 'develop' into 'master'

Add show container file in container page

See merge request !6
parents 2e1dc2d5 13c2fd8f
Pipeline #207 passed with stage
in 47 seconds
......@@ -140,6 +140,8 @@ if($action == "create") {
} else {
header("Location: ../container.php");
}
} else {
header("Location: ../container.php");
}
......@@ -9,12 +9,36 @@ $db = new DBquery();
$containers = $db->getContainers();
require_once "./inc/php/buildHeader.php";
?>
<div class="container-fluid">
<br/><br/>
<div class="row justify-content-md-center text-center">
<div class="col-sm-3">
<div class="card border-primary mb-3">
<div class="card-header font-weight-bold text-white bg-primary"><h2>Docker public</h2></div>
<div class="card-body text-primary">
<h3 class="card-title"><?php echo $db->getNumberDockerContainer() ?> Files</h3>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card border-success mb-3">
<div class="card-header font-weight-bold text-white bg-success"><h2>Singularity public</h2></div>
<div class="card-body text-success">
<h3 class="card-title"><?php echo $db->getNumberSingularityContainer() ?> Files</h3>
</div>
</div>
</div>
</div>
<br/><br/>
<div class="row">
......@@ -117,7 +141,7 @@ require_once "./inc/php/buildHeader.php";
echo '<td>';
//echo '<div class="btn-group" mr-3><a class="btn btn-success btn-sm" href="#" >show</a></div>';
echo '<div class="btn-group" mr-3><button class="btn btn-success btn-sm" onclick="showFileContainer(\''.$container->ID.'\')">show</button></div>';
echo '<div class="btn-group" mr-3><a class="btn btn-primary btn-sm" href="./action/action_container.php?action=download&containerid='.$container->ID.'">dowload</a></div>';
......@@ -135,23 +159,82 @@ require_once "./inc/php/buildHeader.php";
</table>
</div>
</div>
<!-- Start Modal Publish -->
<div class="modal" id="modalShowContainer">
<div class="modal-dialog modal-xl">
<div class="modal-content modal-xl">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Container file</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<!-- Modal body -->
<div class="modal-body">
<textarea type="text" class="form-control" id="valueContainerFile" name="value" value=""></textarea>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="submit" class="btn btn-success">Submit</button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div> <!-- End Modal Publish -->
<br/><br/><br/><br/><br/><br/>
</div>
<!-- jQuery Version 1.11.1 -->
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- local fallbacks -->
<!--script src="inc/js/jquery-latest.min.js" type="text/javascript"></script>
<script src="inc/js/bootstrap.min.js" type="text/javascript"></script-->
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js" crossorigin="anonymous"></script>
<script type="text/javascript">
function showFileContainer(id ) {
var value = FILE_CONTAINER[id];
document.getElementById('valueContainerFile').value = value;
var size = value.split(/\r\n|\r|\n/).length;
document.getElementById("valueContainerFile").rows = size;
$('#modalShowContainer').modal();
}
var FILE_CONTAINER = [];
$(function()
{
<?php
foreach ($containers as $container) {
echo 'FILE_CONTAINER["'.$container->ID.'"] = "'.$container->value.'";';
echo '';
}
?>
});
</script>
</body>
......
......@@ -413,6 +413,34 @@ class DBquery
}
}
public function getNumberDockerContainer() {
$sql = 'SELECT count(*) as docker FROM `Container` WHERE type = "Docker" AND visibility = 1;';
$result = mysqli_query($this->dbh, $sql);
if($result) {
while($row = mysqli_fetch_assoc($result)){
return $row['docker'];
}
}
return 0;
}
public function getNumberSingularityContainer() {
$sql = 'SELECT count(*) as singularity FROM `Container` WHERE type = "Singularity" AND visibility = 1';
$result = mysqli_query($this->dbh, $sql);
if($result) {
while($row = mysqli_fetch_assoc($result)){
return $row['singularity'];
}
}
return 0;
}
......
......@@ -75,4 +75,8 @@
.btn-group > .btn:first-child {
margin-left: 5px !important;
}
.modal-xl {
max-width: 1140px;
}
\ No newline at end of file
......@@ -398,10 +398,10 @@ require_once "./inc/php/buildHeader.php";
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js" crossorigin="anonymous"></script>
<!-- local fallbacks -->
<!--script src="./inc/js/jquery-3.2.1.slim.min.js"></script>
<script src="./inc/js/jquery-3.2.1.slim.min.js"></script>
<script src="./inc/js/popper.min.js"></script>
<script src="./inc/js/bootstrap.min.js"></script>
<script src="./inc/js/jquery.dataTables.min.js"></script-->
<script src="./inc/js/jquery.dataTables.min.js"></script>
<script src="./inc/js/wicopa.js"></script>
<script>
......
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