Updated web table

This commit is contained in:
Igor Nurullaev
2019-08-27 21:48:43 +03:00
parent 53ee657620
commit 30ea2d6ab3
3 changed files with 41 additions and 7 deletions

View File

@@ -5,3 +5,32 @@ html, body, .container {
padding: 0;
}
body {
padding: 20px;
display: flex;
flex-direction: row;
}
.table-container {
height: 100%;
width: 70%;
}
.button {
margin: 10px;
}
.command-container {
height: 100%;
width: 30%;
}
.action-container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.action-container button {
margin: 10px;
}

View File

@@ -8,11 +8,11 @@ function updateData() {
tabledata = JSON.parse(req.response);
}
var table = new Tabulator("#example-table", {
var table = new Tabulator("#copters-table", {
data: tabledata,
reactiveData: true,
layout: "fitColumns",
columns: [ //Define Table Columns
columns: [
{title: "Name", field: "name"},
{title: "IP", field: "ip"},
{title: "Animation id", field: "anim_id"},
@@ -20,5 +20,5 @@ var table = new Tabulator("#example-table", {
{title: "Cell voltage", field: "cell_voltage"},
{title: "Selfcheck", field: "selfcheck"},
{title: "Time", field: "time"},
]
],
});

View File

@@ -9,11 +9,16 @@
<script lang="js" src="/static/js/tabulator.min.js"></script>
</head>
<body>
<div class="container">
<div class="table-container">
<div id="example-table"></div>
<div class="table-container">
<div id="copters-table"></div>
</div>
<div class="command-container col">
<div class="action-container">
<button type="button" class="btn btn-dark">Set animation</button>
<button type="button" class="btn btn-dark">Set configuration</button>
<button type="button" class="btn btn-dark">Set aruco map</button>
</div>
<div class="command-container"></div>
<div class="action-container"></div>
</div>
<script lang="js" src="/static/js/main.js"></script>
</body>