# Viability for this? Touch screen login/out project

**URL:** <https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966>\
**Category:** General\
**Created:** [26 June 2024 09:17 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966 "2024-06-26T09:17:19Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [4 July 2024 11:52 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/101 "2024-07-04T11:52:40Z")

</div>

(That was more to Steve.... But anyway.)

My eyes are yelling at me:

Enough for today and are really wanting to close for today.

☹

Got an interesting day tomorrow, helping someone make a wooden table to sub mm precision.

That's going to be fun.

Luckily I caught them today with +mm errors and _we_ pulled it apart before the glue set.  
That's going to be fun to deal with too. Non flat surfaces. :cringe:

Ah, all part of learning.

Thanks again Julian.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [9 July 2024 09:57 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/102 "2024-07-09T09:57:36Z")

</div>

I've only just installed it and am looking at it.

It may take some days as I've been away and need to catch up on stuff.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [30 July 2024 09:19 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/103 "2024-07-30T09:19:39Z")

</div>

Hi Julian.

Sorry it has been a long time. (Life, etc)

Um, yes, I have _CRAFT disease_, but when I'm looking at the `ui-builder` node, and open it:  
~~It is a shame there is no `expand` button (top right) as there is with `function` nodes to view the code in _full screen_ rather than in the smaller box/area.~~  
Ah! It is outside the area and in the bottom left.  
Of course. Sorry.

So, attempting to get back on the horse I'm looking at things.

I seem to have forgotten just about everything. 😢

A thought that comes to mind is that with the _search_ option in your example that the member list is presorted anyway.

I'm going to try to find where it is loaded and put a line in to sort it before displaying the list.

But - as said - I can't remember what the 3 files do.  
There is the `html` `css` and `js` ones.  
I kind of get it but also don't.

I have downloaded an 8 hour JS course but am only at the start of it.

P.S.

Loading the `js` window: why is there all these _errors_?

 ![Screenshot from 2024-07-30 19-20-27](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/1072dab47996e8380ac063a245562a77d34c61d5.png)

AFAIK, I haven't edited it and the stuff has been initialised. (There is a members list,etc)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [30 July 2024 09:50 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/104 "2024-07-30T09:50:50Z")

</div>

I'm thinking maybe 2 columns on your screen.  
1 - the full list of members.  
2 - a list of members who have signed in today

So it seems I am going to have to do a lot of studying how to have two columns.

This is what I did - badly - for now.

```auto
<!doctype html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="../uibuilder/images/node-blue.ico">

    <title>Members In/Out Register - Node-RED UIBUILDER</title>
    <meta name="description" content="Node-RED UIBUILDER - Members In/Out Register">

    <!-- Your own CSS (defaults to loading uibuilders css)-->
    <link type="text/css" rel="stylesheet" href="./index.css" media="all">

    <!-- #region Supporting Scripts. These MUST be in the right order. Note no leading / -->
    <script defer src="../uibuilder/uibuilder.iife.min.js"></script>
    <script defer src="./index.js"></script>
    <!-- #endregion -->

</head>

<body class="uib">

    <h1 class="with-subtitle">Members full list</h1>
    <div role="doc-subtitle">Using Node-RED and the UIBUILDER IIFE library.</div>

    <div>
        <label for="search">Search: </label>
        <input id="search" type="text" placeholder="Enter first characters of name to search for" style="width: 50%;" oninput="doSearch(event)">
    </div>

    <ul id="results"></ul>

</body>

<body class="uid">
    <h1 class="width-subtitle">Members signed in</h1>
    <div>
        <label "text" </label>
    </div>

</html>

```

But the _second list_ is at the bottom of the list of members, rather than in a different _window_ (area) on the screen.

## Update:

Putting the errors aside, I made SOME progress.

```auto
<!doctype html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="../uibuilder/images/node-blue.ico">

    <title>Members In/Out Register - Node-RED UIBUILDER</title>
    <meta name="description" content="Node-RED UIBUILDER - Members In/Out Register">

    <!-- Your own CSS (defaults to loading uibuilders css)-->
    <link type="text/css" rel="stylesheet" href="./index.css" media="all">

    <!-- #region Supporting Scripts. These MUST be in the right order. Note no leading / -->
    <script defer src="../uibuilder/uibuilder.iife.min.js"></script>
    <script defer src="./index.js"></script>
    <!-- #endregion -->

</head>

<body class="uib">
    <h1 class="with-subtitle">Members full list</h1>
    <div role="doc-subtitle">Using Node-RED and the UIBUILDER IIFE library.</div>

    <div style="width: 50%; height: 50%; background-color: green; float:left;"> Members full list</div>
        <label for="search">Search: </label>
        <input id="search" type="text" placeholder="Enter first characters of name to search for" style="width: 50%;" oninput="doSearch(event)">
    </div>

    <div style="width: 50%; height: 50%; background-color: blue; float:right;">Members signed in</div>
        <label> signedIn </label>
    </div>

    <ul id="results"></ul>

</body>

</html>

```

This gives me this screen:

 ![Screenshot from 2024-07-30 20-07-53](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/d/7dab84ffe3f3783889024de344fdf55cb0b7d55f.png)

(Believe me, I am _winging_ this.)

So as I click on the names, they turn green - fair enough.  
I want that new array/list/object (still not sure what it is called) `flow.today` to be displayed in the right column.

## Done more attempts

Alas I am really not able to work out how to display the `today` array/object/thing on the second part.  
I have looked at the `html` and `js` file.  
I am missing the key part to do what I want.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 July 2024 11:31 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/105 "2024-07-30T11:31:01Z")

</div>

> [@Trying\_to\_learn](#):
>
> But - as said - I can't remember what the 3 files do.  
> There is the `html` `css` and `js` ones.  
> I kind of get it but also don't.

No worries. I settled on the idea of having the 3 most common files as a default a long time back when HTML web programming was a little simpler and more restricted.

The basic idea is, that for any data-driven web app, you are likely to need 3 distinct things, each of which requires its own grammar.

1. HTML - to define the basic layout and metadata for your web page.
2. CSS - to define specific colour and other visual design aspects.
3. JavaScript (JS) - to define the dynamic parts of your web app that respond to new data and/or send data back to Node-RED.

Hence the 3 files. You absolutely don't have to use them. A UIBUILDER app is, after all, primarily defined by a combination of a uibuilder node (that defines all the servery bits) and an index.html file that defines the static front-end bits.

Indeed, the latest version of the "Blank" template does not even LOAD the index.js file because, with modern web features combined with the newer features of UIBUILDER, you often don't need it at all. 🙂

However, if you follow a "standard" web development path and as your app gets more complex, it is generally helpful to keep the 3 aspects separated, it makes it a LOT easier (IMO) for your brain to process the separate grammar's involved.

To recap:

- HTML - defines the static structure of your page. This is the one bit you cannot dispense with, _ **but** _ UIBUILDER creates the basic layout for you thanks to the Templates feature. So you don't have to even think about what is needed to get started.
- CSS - defines the fancy looks.
- JS - defines the actions.

> [@Trying\_to\_learn](#):
>
> Loading the `js` window: why is there all these _errors_?

I can't fully tell just looking at the image. But I could make some guesses.

`uibuilder` shows an "error" because the Monaco editor does not understand that `uibuilder` is a global definition - it is automatically created along with a few other things when you load the uibuilder script library. If you really want to get rid of the error, you could replace `uibuilder` with `window['uibuilder'] but who has the time or energy to keep typing that!

Not totally sure why your other variables are underlined but my guess would be that Monaco is telling you that you should use `const` instead of `let`. This is a minor thing really but it helps avoid mistakes in your code. It is also an oddity of JavaScript (there are many of those!) that, when defining a variable as an object or array, you can use `const` because js still lets you change the content of an object or array even though it is defined as a constant, you just can't replace the whole thing.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 July 2024 11:42 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/106 "2024-07-30T11:42:31Z")

</div>

> [@Trying\_to\_learn](#):
>
> So it seems I am going to have to do a lot of studying how to have two columns.

This might help:

> **[Multiple-column layout - Learn web development | MDN](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Multiple-column_Layout)**
>
> You now know how to use the basic features of multiple-column layout, another tool at your disposal when choosing a layout method for the designs you're building.

> [@Trying\_to\_learn](#):
>
> `<body class="uid">`

You need a quick refresher about HTML I think. There are some tags you can only have once in your page. `<html>`, `<head>`, and `<body>` are 3 of them. Similarly, best practice says that you should only ever have 1 `<h1>` - this is an accessibility thing. For accessibility, try to think of your `<hn>` tags as a strict hierarchy - 1 `h1` that may contain multiple `h2`s. Each `h2` can contain multiple `h3`s and so on. Try to avoid going below `h4`.

> [@Trying\_to\_learn](#):
>
> Putting the errors aside, I made SOME progress.

OK, you are using `float` which is OK but a bit dated. See the MDN link for a more up-to-date way of doing it.

> [@Trying\_to\_learn](#):
>
> I want that new array/list/object (still not sure what it is called) `flow.today` to be displayed in the right column.

You need 2 `ul` list containers and they need to be inside the `div`s that specify the float left/right.

To move between the full list and the signed in list, .... hang on, I need some lunch.

I'll add some more later but there are several ways you could do this. Basically you need to make a copy of the `li` entry from the full list and add it to the signed in list.

Similarly, for signing out, you will need to remove the entry from the `ul` that contains the signed in list.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [30 July 2024 20:44 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/107 "2024-07-30T20:44:55Z")

</div>

Weirdly - or otherwise - I did seem to remember the 3 _specifications_ of the files.

The errors: Ok, I shall put it down to `Monaco`. No worries.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [30 July 2024 20:56 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/108 "2024-07-30T20:56:29Z")

</div>

Ok, thanks.

I'll get into that link when I can.

WRT the _other list_ (`today`) I was more meaning the JS code to display it.

I'm guessing similar to how the `members` list is read/displayed.

What may not be helping is the 3 layers with `ui-builder`.  
I can live with it, but am still stuck with knowing where the stratification happens.

The stuff I did was just by asking how to make two vertically separated columns in html.  
So - yes - the result/answer will probably be very basic/weak in how it is done.

the `<h1>` stuff etc... That is still very much me _flying blind_.  
But maybe after reading the link, I will be more aware of what is happening and how to do it.

Oh, something else - in case you _missed it_.  
Only to make it look nicer, I discovered if I enter a space in the search bar, I get a full members list.  
So I left the list (the first part of it) visible for aesthetic reasons.  
_That shouldn't be hard to implement in the final version. Just inject a space to the search field as default._

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 July 2024 20:58 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/109 "2024-07-30T20:58:43Z")

</div>

> [@Trying\_to\_learn](#):
>
> The errors: Ok, I shall put it down to `Monaco`

Hover over the red squiggle and it will tell you why it doesn't like it.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [31 July 2024 04:55 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/110 "2024-07-31T04:55:07Z")

</div>

You asked.

 ![Screenshot from 2024-07-31 14-53-41](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/c/8c6b7d03d58d57c9f6fa55415dea564287ea2db0.png)

First line. Can not REDECLARE....... Errr.....????? Yeah. Above my pay grade.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [31 July 2024 05:26 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/111 "2024-07-31T05:26:08Z")

</div>

Ok, just to share.

I've read a bit of the link - not meaning I expect to understand it all after only reading 2 pages.

css

```auto
/* Load defaults from `<userDir>/node_modules/node-red-contrib-uibuilder/front-end/uib-brand.min.css`
 * This version auto-adjusts for light/dark browser settings but might not be as complete.
 */
@import url("../uibuilder/uib-brand.min.css");

/* OR, load the defaults from the older `<userDir>/node_modules/node-red-contrib-uibuilder/front-end/uib-styles.css` */
/* @import url("../uibuilder/uib-styles.css"); */

.container {
    column-width: 100px;
}

body {
    width: 70%;
    max-width: 900px;
    margin: 2em auto;
    font:
        0.9em/1.2 Arial,
        Helvetica,
        sans-serif;
}

.in {
    color: hsl(120, 100%, 50%);
}

.out {
    color: hsl(290, 100%, 80%);
}

```

html

```auto
<!doctype html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="../uibuilder/images/node-blue.ico">

    <title>Members In/Out Register - Node-RED UIBUILDER</title>
    <meta name="description" content="Node-RED UIBUILDER - Members In/Out Register">

    <!-- Your own CSS (defaults to loading uibuilders css)-->
    <link type="text/css" rel="stylesheet" href="./index.css" media="all">

    <!-- #region Supporting Scripts. These MUST be in the right order. Note no leading / -->
    <script defer src="../uibuilder/uibuilder.iife.min.js"></script>
    <script defer src="./index.js"></script>
    <!-- #endregion -->

</head>

<body class="uib">

    <h1 class="with-subtitle">Members In/Out Register</h1>
    <div role="doc-subtitle">Using Node-RED and the UIBUILDER IIFE library.</div>

    <div>
        <p>
        <label for="search">Search: </label>
        <input id="search" type="text" placeholder="Enter first characters of name to search for" style="width: 50%;" oninput="doSearch(event)">
        </p>
    </div>

    <ul id="results"></ul>

</body>

</html>

```

Forgetting the second column I wanted with `today` listed.

I get ONE column indented from the left.

 ![Screenshot from 2024-07-31 15-21-55](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/f/6f7185800845b82fcaa07937a6ba8715df3517f0.png)

This is taken a _working_ (from the example on _MULTI COLUMN LAYOUT_.  
I'm missing something.

Yes, I am not exactly clear on the structure/layering.  
I admit it.

But the example is not really explaining things.

It went from:

```auto
.container {
  column-count: 3;
}

```

to

```auto
.container {
  column-width: 200px;
}

```

And didn't mention this part:

```auto
body {
  width: 70%;
  max-width: 900px;
  margin: 2em auto;
  font:
    0.9em/1.2 Arial,
    Helvetica,
    sans-serif;
}

```

Which I only saw after doing the `play` button and looking at the code.

So I am kind of ....... reserved about believing their examples when they don't show all the code they use.

Could you please help/explain what is going on there?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [31 July 2024 08:04 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/112 "2024-07-31T08:04:47Z")

</div>

Search for fullMembersList and see if you have another declaration of it somewhere else (which will also be marked as an error). If you can't find it then post the full text here please.

---

<div class="post-metadata">

**Author:** ![kitori](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kitori](https://discourse.nodered.org/u/kitori)\
**Post date:** [31 July 2024 09:35 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/113 "2024-07-31T09:35:34Z")

</div>

Hi, just hacked something with the dashboard-2.  
You can ignore it, if it is not relevant for you. i just wanted to try it out 😉

Dashboard 2 and a sqlite db: a very simple login/logout app:

![Bildschirmaufnahme 2024-07-31 111522](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/7/77c7aa1a041a4ffbeca98f312dd65ff41515cce6.gif)

```auto
[{"id":"8e6b07d1688aac0d","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"b8ae4b7d1b7f9009","type":"ui-table","z":"8e6b07d1688aac0d","group":"3c68ea2ef8aaa739","name":"","label":"text","order":1,"width":"0","height":"0","maxrows":0,"passthru":false,"autocols":false,"showSearch":true,"selectionType":"click","columns":[{"title":"Name","key":"name","type":"text","width":"","align":"start"},{"title":"action","key":"action","type":"tickcross","width":"","align":"start"},{"title":"Last Action at","key":"datetime","type":"text","width":"","align":"start"}],"x":930,"y":700,"wires":[["f06bab117905eafe","42f2d5e780152b30","02543ea0037ac111","add0ee0fad25d2d6"]]},{"id":"4190fb92b50f9870","type":"sqlite","z":"8e6b07d1688aac0d","mydb":"f9551d91b22b1441","sqlquery":"msg.topic","sql":"","name":"","x":710,"y":700,"wires":[["b8ae4b7d1b7f9009"]]},{"id":"bb3f2d965caa8b65","type":"inject","z":"8e6b07d1688aac0d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":680,"wires":[["213c59fe7d209120"]]},{"id":"f06bab117905eafe","type":"debug","z":"8e6b07d1688aac0d","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1240,"y":700,"wires":[]},{"id":"aa9770ab985f1dff","type":"ui-control","z":"8e6b07d1688aac0d","name":"","ui":"174e44d306da2771","events":"all","x":200,"y":600,"wires":[["213c59fe7d209120"]]},{"id":"42f2d5e780152b30","type":"change","z":"8e6b07d1688aac0d","name":"","rules":[{"t":"set","p":"last_person","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":760,"wires":[[]]},{"id":"9c9d40060387fc8d","type":"ui-button","z":"8e6b07d1688aac0d","group":"3c68ea2ef8aaa739","name":"","label":"Log-In","order":3,"width":"3","height":"1","emulateClick":false,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","iconPosition":"left","payload":"last_person","payloadType":"flow","topic":"login","topicType":"str","buttonColor":"","textColor":"","iconColor":"","x":510,"y":1000,"wires":[["4310e1ba4a88d69a"]]},{"id":"7a6c36fe1c9ac3fa","type":"ui-button","z":"8e6b07d1688aac0d","group":"3c68ea2ef8aaa739","name":"","label":"Log-Out","order":4,"width":"3","height":"1","emulateClick":false,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","iconPosition":"left","payload":"last_person","payloadType":"flow","topic":"logout","topicType":"str","buttonColor":"","textColor":"","iconColor":"","x":500,"y":1040,"wires":[["4310e1ba4a88d69a"]]},{"id":"ab16c0872ee524e0","type":"inject","z":"8e6b07d1688aac0d","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"{}","payloadType":"json","x":210,"y":540,"wires":[["1b23cff4a27e596f"]]},{"id":"1b23cff4a27e596f","type":"change","z":"8e6b07d1688aac0d","name":"","rules":[{"t":"set","p":"last_person","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":540,"wires":[[]]},{"id":"df1531f868a360c1","type":"ui-notification","z":"8e6b07d1688aac0d","ui":"174e44d306da2771","position":"top right","colorDefault":true,"color":"#000000","displayTime":"3","showCountdown":true,"outputs":1,"allowDismiss":true,"dismissText":"Close","raw":false,"className":"","name":"","x":1280,"y":840,"wires":[[]]},{"id":"02543ea0037ac111","type":"template","z":"8e6b07d1688aac0d","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Person Selected: {{payload.name}}","output":"str","x":1040,"y":800,"wires":[["df1531f868a360c1"]]},{"id":"4310e1ba4a88d69a","type":"switch","z":"8e6b07d1688aac0d","name":"","property":"payload","propertyType":"msg","rules":[{"t":"hask","v":"id","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":690,"y":1020,"wires":[["3227b4d019775deb","b1446043b451b420"]]},{"id":"3227b4d019775deb","type":"function","z":"8e6b07d1688aac0d","name":"function 1","func":"const person_id = msg.payload.id\nconst action = msg.topic == 'login' ? 1 : 0\nconst now =Date.now().valueOf()\n\nmsg.topic = `\nINSERT INTO log (person_id,action,created_at) \nVALUES (${person_id},${action},${now})\n` \n\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":1020,"wires":[["30a364adebb032fc"]]},{"id":"cbfc517bba77e70e","type":"sqlite","z":"8e6b07d1688aac0d","mydb":"f9551d91b22b1441","sqlquery":"msg.topic","sql":"","name":"","x":710,"y":440,"wires":[["640a537e09dba98f"]]},{"id":"8db480c05a13dcae","type":"inject","z":"8e6b07d1688aac0d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":340,"y":440,"wires":[["d8d2c25af43d32c0"]]},{"id":"d8d2c25af43d32c0","type":"template","z":"8e6b07d1688aac0d","name":"Select Last","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":";with cte_last_status (person_id,action,created_at) AS\n(\n SELECT\n person_id,\n action,\n MAX(created_at) AS Last_created_at\n from log\n GROUP BY person_id\n)\nSelect * from cte_last_status\nINNER JOIN person\nON cte_last_status.person_id = person.id","output":"str","x":530,"y":440,"wires":[["cbfc517bba77e70e"]]},{"id":"640a537e09dba98f","type":"debug","z":"8e6b07d1688aac0d","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":900,"y":440,"wires":[]},{"id":"b1446043b451b420","type":"debug","z":"8e6b07d1688aac0d","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":820,"y":960,"wires":[]},{"id":"30a364adebb032fc","type":"sqlite","z":"8e6b07d1688aac0d","mydb":"f9551d91b22b1441","sqlquery":"msg.topic","sql":"","name":"","x":1030,"y":1020,"wires":[["213c59fe7d209120","2270a7a87ffda0e4"]]},{"id":"213c59fe7d209120","type":"template","z":"8e6b07d1688aac0d","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":";with cte_last_status (person_id,action,created_at) AS\n(\n SELECT\n person_id,\n action,\n MAX(created_at) AS Last_created_at\n from log\n GROUP BY person_id\n)\nSelect \n person.id,\n name,\n action,\n datetime(created_at / 1000, 'unixepoch') as [datetime]\n from cte_last_status\nINNER JOIN person\nON cte_last_status.person_id = person.id","output":"str","x":440,"y":700,"wires":[["4190fb92b50f9870"]]},{"id":"2270a7a87ffda0e4","type":"change","z":"8e6b07d1688aac0d","name":"","rules":[{"t":"set","p":"last_person","pt":"flow","to":"{}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1220,"y":1080,"wires":[[]]},{"id":"94c0836789d72aa0","type":"ui-text","z":"8e6b07d1688aac0d","group":"3c68ea2ef8aaa739","order":2,"width":0,"height":0,"name":"","label":"","format":"{{msg.payload}}","layout":"row-left","style":false,"font":"","fontSize":16,"color":"#717171","className":"","x":1230,"y":640,"wires":[]},{"id":"add0ee0fad25d2d6","type":"template","z":"8e6b07d1688aac0d","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.name}} :","output":"str","x":1060,"y":640,"wires":[["94c0836789d72aa0"]]},{"id":"d35bccc73d26891b","type":"inject","z":"8e6b07d1688aac0d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":380,"y":40,"wires":[["05332fd9affcc38e"]]},{"id":"05332fd9affcc38e","type":"template","z":"8e6b07d1688aac0d","name":"CREATE person","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"CREATE TABLE \"person\" (\n\t\"id\"\tINTEGER NOT NULL UNIQUE,\n\t\"name\"\tTEXT NOT NULL,\n\tPRIMARY KEY(\"id\" AUTOINCREMENT)\n)","output":"str","x":600,"y":40,"wires":[["18a05a5c4c48c4a4"]]},{"id":"ee8deb38daea8aec","type":"template","z":"8e6b07d1688aac0d","name":"CREATE log","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"CREATE TABLE \"log\" (\n\t\"id\"\tINTEGER NOT NULL UNIQUE,\n\t\"person_id\"\tINTEGER NOT NULL,\n\t\"action\"\tINTEGER NOT NULL,\n\t\"created_at\"\tINTEGER NOT NULL,\n\tPRIMARY KEY(\"id\" AUTOINCREMENT)\n)","output":"str","x":590,"y":80,"wires":[["809cf72ef5baf743"]]},{"id":"87bbeec09443b762","type":"inject","z":"8e6b07d1688aac0d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":380,"y":80,"wires":[["ee8deb38daea8aec"]]},{"id":"18a05a5c4c48c4a4","type":"sqlite","z":"8e6b07d1688aac0d","mydb":"f9551d91b22b1441","sqlquery":"msg.topic","sql":"","name":"","x":790,"y":40,"wires":[[]]},{"id":"809cf72ef5baf743","type":"sqlite","z":"8e6b07d1688aac0d","mydb":"f9551d91b22b1441","sqlquery":"msg.topic","sql":"","name":"","x":790,"y":80,"wires":[[]]},{"id":"a7dd2167ef4c059a","type":"sqlite","z":"8e6b07d1688aac0d","mydb":"f9551d91b22b1441","sqlquery":"msg.topic","sql":"","name":"","x":730,"y":300,"wires":[["78eed5cae61be6e0"]]},{"id":"68795d2c9536c9db","type":"inject","z":"8e6b07d1688aac0d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":360,"y":300,"wires":[["8d077a035546cb45","fcfdf1974398d2bb"]]},{"id":"8d077a035546cb45","type":"template","z":"8e6b07d1688aac0d","name":"Select person","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Select * from person","output":"str","x":560,"y":300,"wires":[["a7dd2167ef4c059a"]]},{"id":"78eed5cae61be6e0","type":"debug","z":"8e6b07d1688aac0d","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":920,"y":300,"wires":[]},{"id":"fcfdf1974398d2bb","type":"template","z":"8e6b07d1688aac0d","name":"Select log","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Select * from log","output":"str","x":540,"y":340,"wires":[["a7dd2167ef4c059a"]]},{"id":"c920e9f315c0be84","type":"sqlite","z":"8e6b07d1688aac0d","mydb":"f9551d91b22b1441","sqlquery":"msg.topic","sql":"","name":"","x":730,"y":180,"wires":[["e74d253b284f8252"]]},{"id":"c2726e1c29d87303","type":"inject","z":"8e6b07d1688aac0d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":360,"y":180,"wires":[["817821d3c68d3388"]]},{"id":"817821d3c68d3388","type":"template","z":"8e6b07d1688aac0d","name":"INSERT person","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO person (name)\nVALUES ('Mr. T'),('Superman'),('Neo')","output":"str","x":560,"y":180,"wires":[["c920e9f315c0be84"]]},{"id":"e74d253b284f8252","type":"debug","z":"8e6b07d1688aac0d","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":900,"y":180,"wires":[]},{"id":"3c68ea2ef8aaa739","type":"ui-group","name":"My Group","page":"7eacc83e5964c751","width":6,"height":1,"order":1,"showTitle":true,"className":"","visible":true,"disabled":false},{"id":"f9551d91b22b1441","type":"sqlitedb","db":"status.sqlite","mode":"RW"},{"id":"174e44d306da2771","type":"ui-base","name":"My Dashboard","path":"/dashboard","includeClientData":false,"acceptsClientConfig":["ui-notification","ui-control","ui-button"],"showPathInSidebar":false,"showPageTitle":true,"navigationStyle":"default","titleBarStyle":"default"},{"id":"7eacc83e5964c751","type":"ui-page","name":"Page 1","ui":"174e44d306da2771","path":"/page1","icon":"home","layout":"grid","theme":"171855b186577ac4","order":1,"className":"","visible":"true","disabled":"false"},{"id":"171855b186577ac4","type":"ui-theme","name":"Default Theme","colors":{"surface":"#ffffff","primary":"#0094CE","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [31 July 2024 11:52 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/114 "2024-07-31T11:52:18Z")

</div>

> [@Trying\_to\_learn](#):
>
> First line. Can not REDECLARE....... Errr.....????? Yeah. Above my pay grade.

Don't forget that you can click on the "View Problem" link and it will take you to a page the defines the problem and shows examples that trigger/avoid the problem.

> [@Trying\_to\_learn](#):
>
> Could you please help/explain what is going on there?

Yes - I think I confused you unnecessarily!

Try this simpler method:

```html
    <div>
        <label for="search">Search: </label>
        <input id="search" type="text" placeholder="Enter first characters of name to search for" style="width: 50%;" oninput="doSearch(event)">
    </div>

    <div>
        <div id="left" style="float:left;">
            <ul id="results"></ul>
        </div>

        <div id="right" style="float:right;">
            <ul id="today">
                <li>Example 1</li>
            </ul>
        </div>
    </div>

```

I've put the styles in manually but they should eventually be moved to `#left` and `#right` entries in your index.css.

I've also put in a single dummy entry into the today list just to have something to show.

Note how I've created a hierarchy of elements that encapsulates the "logic" of what you want to show. Some of it isn't strictly necessary but it should help you (and particularly your future self) understand the structure.

Note that there is an outer div that encapsulates the 2 floating div's which themselves encapsulate the lists which in turn encapsulate the list entries. This is really the essence of HTML and thinking about the hierarchy really helps.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [31 July 2024 20:42 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/115 "2024-07-31T20:42:36Z")

</div>

I know this is going to be a _dumb question_ but:

Where does that code go?

I guess 99% it is the `html` one.

But is it the full code?

(Sorry. I've only just got up, eating breakfast and have about 40 minutes before I am off until lunch time-ish)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [31 July 2024 20:57 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/116 "2024-07-31T20:57:58Z")

</div>

Um, thanks.

But.....

If I don't have the sql database, it kinda fails.

The flow was covered with errors.

![Screenshot from 2024-08-01 06-55-00](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/2/e250b77316094e587158b744a857ad3709988b88.png)

Ok, sorry, not sure which of these errors are yours and not _other_.  
That machine is a **TEST** machine just now.

 ![Screenshot from 2024-08-01 06-55-07](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/e/9e11088227224b30d68206e4a0bbc1028e98156b.png)

Sorry, I'll redact the _covered in errors._  
I forgot to DEPLOY it and the dots were blue, not red. 😉

But a lot of `missing node` nodes.

I've just got up.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [31 July 2024 21:05 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/117 "2024-07-31T21:05:09Z")

</div>

WRT the `view problem`

 ![Screenshot from 2024-08-01 07-01-22](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/10f5546fcb66a61f342fffd4a5d91ee75bff2bec.png)

Sorry, still _above my pay grade._

`2451` - I'm guessing is the line number.  
I can't see that many lines.

`4(1,5):` Where?

I don't know if me worrying about the _errors_ is helping the immediate thing.

I appreciate it would be good/better for me to understand what is going on, but as I see it - now - I am maybe better to accept it as _magic_ and concentrate on the output rather than the mechanics of it's workings.

When it is all working, I could then look at it and attempt to understand it all.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [31 July 2024 21:17 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/118 "2024-07-31T21:17:18Z")

</div>

> [@Trying\_to\_learn](#):
>
> But a lot of `missing node` nodes

That is because, as stated, it is for the new dashboard, which you have not installed.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [31 July 2024 21:19 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/119 "2024-07-31T21:19:16Z")

</div>

Argh.

Yaeh, ok.

Sorry @kitori.

I'll see if I can get it working when I get home this afternoon.

Dashboard-2 can co-exist with the original?

---

<div class="post-metadata">

**Author:** ![kitori](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kitori](https://discourse.nodered.org/u/kitori)\
**Post date:** [1 August 2024 07:10 UTC](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966/120 "2024-08-01T07:10:28Z")

</div>

Yes, i think so. Its on the path /dashboard

My example is a really fast draft.

You probably need some more SQL querys.

[Previous page](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966.md?page=5)

[Next page](https://discourse.nodered.org/t/viability-for-this-touch-screen-login-out-project/88966.md?page=7)
