28.12.2022, 11:38
You can use .lp server-side script and iframe element to display a table. Upload via FTP using apps login to user directory as objects.lp
Then use /user/objects.lp as iframe source.
Then use /user/objects.lp as iframe source.
Code:
<?
require('apps')
objs = grp.tag('tag_name_here')
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Objects</title>
<link rel="stylesheet" href="/apps/css/bootstrap.css">
<link rel="stylesheet" href="/apps/css/font-awesome.css">
<link rel="stylesheet" href="/apps/css/style.css">
<script src="/apps/js/jquery.js.gz"></script>
</head>
<body>
<table class="table table-hover" style="margin-bottom:0">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
<th>Date</th>
</tr>
</thead>
<tbody></tbody>
</table>
<script>
var data = <?=json.encode(objs)?>;
// sort data by name
data.sort(function(a, b) {
var na = a.name.toLowerCase()
, nb = b.name.toLowerCase();
if (na > nb) {
return 1;
}
else if (na < nb) {
return -1;
}
else {
return 0;
}
});
// show each object name/value/update time
$.each(data, function(index, item) {
var trs = $('<tr><td></td><td></td><td></td></tr>').appendTo('tbody')
, tds = trs.find('td')
, d = new Date(item.updatetime * 1000);
$(tds[ 0 ]).text(item.name);
$(tds[ 1 ]).text(item.value);
$(tds[ 2 ]).text(d.toString().split(' GMT')[0]);
});
</script>
</body>
</html>