This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Log on html widget
#1
Hi everybody,
Is it possible move the log schedule in a html widget in mosaic?
My will it is to see the log() function inside a script in mosaic.
I need it for a diagnostic reason.
Br Cristian
Reply
#2
You can place it via an iframe similar to this example: https://forum.logicmachine.net/showthread.php?tid=3331
Keep in mind that this will work only locally, not via cloud.
Code for logs.lp:
Code:
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" href="/apps/css/bootstrap.css">
</head>
<body>
<table class="table table-striped">
<tr>
  <th>Date/time</th>
  <th>Script name</th>
  <th>Log</th>
</tr>
<?
require('apps')

items = db:getall([[
  SELECT * FROM logs
  ORDER BY logtime DESC
  LIMIT 50
]])

for _, item in ipairs(items) do
  datetime = os.date('%Y.%m.%d %H:%M:%S', item.logtime)
?>
<tr>
  <td><?=datetime?></td>
  <td><?=escape(item.scriptname)?></td>
  <td><?=escape(item.log)?></td>
</tr>
<? end ?>
</table>
</body>
</html>
Reply


Forum Jump: