Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 772 of 796  Not logged in ELOG logo
ID Date Icon Author Author Emailup Category OS ELOG Version Subject
  69253   Tue Oct 27 16:37:07 2020 Reply David Walliswallis@aps.anl.govQuestionLinuxV3.1.4-ba84827Re: Create entry from command line - override Date?

Hi Stefan, thanks! Does the Date field need to be the first field in each entry? I can see adding a "termpory" field called "Orig Date", upload the old entries, then edit the file(s), delete the Date field, and rename Orig Date to Date. Will that work?

Stefan Ritt wrote:

You have to manually manipulate the logbook files YYMMDDa.log where you find the date at the top like:

MID@$: 1
Date: Wed, 02 Sep 2020 15:38:09 +0300 <==== change here !!!!
Author: Stefan
Type: General
Category: 
Subject: CURL test
Attachment: 
Encoding: plain
========================================
Text body
 

 

  69256   Tue Oct 27 17:45:29 2020 Reply David Walliswallis@aps.anl.govQuestionLinuxV3.1.4-ba84827Re: Create entry from command line - override Date?

Hi Andreas,

Thanks for your input! After a little testing, it appears that if I make "Orig Date" the first field, it will fall under the Date field in the logbook file. I can then do a global delete of Date:, and replace Orig Date: with Date:, leaving it as the first field in the entry. Then I can delete the Orig Date field.

Andreas Luedeke wrote:

You could transform your entries into the ELOG file format (either XML or CSV) and then use the import function. That would upload the correct dates from your entries.

If you use the "Orig Date" trick you've proposed, you'll see that datetime fields are stored as seconds of the epoch (since 1.1.1970). Not so easy to copy and paste them, but you can convert them with a script.

Cheers, Andreas

David Wallis wrote:

Hi Stefan, thanks! Does the Date field need to be the first field in each entry? I can see adding a "termpory" field called "Orig Date", upload the old entries, then edit the file(s), delete the Date field, and rename Orig Date to Date. Will that work?

Stefan Ritt wrote:

You have to manually manipulate the logbook files YYMMDDa.log where you find the date at the top like:

MID@$: 1
Date: Wed, 02 Sep 2020 15:38:09 +0300 <==== change here !!!!
Author: Stefan
Type: General
Category: 
Subject: CURL test
Attachment: 
Encoding: plain
========================================
Text body
 

 

 

 

  69258   Tue Oct 27 22:24:18 2020 Reply David Walliswallis@aps.anl.govQuestionLinuxV3.1.4-ba84827Re: Create entry from command line - override Date?

Hi Andreas,

It was actually easier than that. The time stamps in the old system were in epoch format, so when I created the new record, (my conversion program was written in Python), I simply formatted that value in the format Stefan pointed out below, and defined the Orig Date field as text. Then I was able to munge the logbook file with 2 global editor commands, and it worked perfectly. Thanks again!

Andreas Luedeke wrote:

Hi David,
correct. And in addition you will need to convert "Orig Date" from seconds-of-the-epoch into a properly formated date string (see example below from Stefan) ...

Andreas

David Wallis wrote:

Hi Andreas,

Thanks for your input! After a little testing, it appears that if I make "Orig Date" the first field, it will fall under the Date field in the logbook file. I can then do a global delete of Date:, and replace Orig Date: with Date:, leaving it as the first field in the entry. Then I can delete the Orig Date field.

Andreas Luedeke wrote:

You could transform your entries into the ELOG file format (either XML or CSV) and then use the import function. That would upload the correct dates from your entries.

If you use the "Orig Date" trick you've proposed, you'll see that datetime fields are stored as seconds of the epoch (since 1.1.1970). Not so easy to copy and paste them, but you can convert them with a script.

Cheers, Andreas

David Wallis wrote:

Hi Stefan, thanks! Does the Date field need to be the first field in each entry? I can see adding a "termpory" field called "Orig Date", upload the old entries, then edit the file(s), delete the Date field, and rename Orig Date to Date. Will that work?

Stefan Ritt wrote:

You have to manually manipulate the logbook files YYMMDDa.log where you find the date at the top like:

MID@$: 1
Date: Wed, 02 Sep 2020 15:38:09 +0300 <==== change here !!!!
Author: Stefan
Type: General
Category: 
Subject: CURL test
Attachment: 
Encoding: plain
========================================
Text body
 

 

 

 

 

 

  69021   Sun Oct 6 20:25:27 2019 Question Kevin Wangwangkl1020@gmail.comQuestionLinux3.1.4Cannot connect to server of Gmail SMTP

Hi all,

When I tried to set SMTP server of Gmail in the global configuration file, I get the message "Error sending Email via <i>"smtp.gmail.com"</i>: Cannot connect to server" after I tried to receive the Email notification. Is there anyone gives help to solve this issue?

Thanks!

Kevin

  69023   Tue Oct 8 05:42:56 2019 Reply Kevin Wangwangkl1020@gmail.comQuestionLinux3.1.4Re: Cannot connect to server of Gmail SMTP

Hi Stefan,

 

Thank you very much for your reply. So which SMTP type can I use now? Is outlook OK?

 

Kevin

Stefan Ritt wrote:

Gmail uses a type of SMTP authentication which is currently not supported by elog. It's however on the todo list.

Stefan

Kevin Wang wrote:

Hi all,

When I tried to set SMTP server of Gmail in the global configuration file, I get the message "Error sending Email via <i>"smtp.gmail.com"</i>: Cannot connect to server" after I tried to receive the Email notification. Is there anyone gives help to solve this issue?

Thanks!

Kevin

 

 

  69394   Wed Oct 13 02:38:34 2021 Question Lin Wangwanglin@ihep.ac.cnQuestionLinuxUnknownHow to access PSI Elog data from other web clients

We want to develop separate mobile web pages for the web applications deployed at CSNS accelerator, including the PSI Elog.

In Elog, is there RESTful API or HTTP/JSON or HTTP/XML interface for other web clients to access?

Or is there any workaround?

  69019   Sat Sep 28 09:07:05 2019 Reply Qisheng Wangwangqisheng@zjlab.org.cnInfoWindows3.1.1Re: Custom input forms implementation

Dear Andreas,

The same problem by using the shiftchecklist and the cfg in Stefan's mail. It report the no password file, even the absolute path wroten in cfg file.  The author field also failed to be read, it is shown as "?" in the page . Did there miss some other files?

Any suggestion is welcome. Thank you very much.

Qisheng

Andreas Luedeke wrote:

You might try to specify an absolute path to the password file in the configuration.

I would need a complete minimal configuration that creates that problem.

 

JD wrote:

Hello Stefan,

I created a custom form with the example you provided. When I enter the Data and Submit the Form I get the error message "Datei passwordfile.xml kann nicht geöffnet werden: No such file or directory".  Posting stuff works in all other logbooks.  Only in the "logbook with the form" there seems to be an error. (or misconfiguration on my side)

sections from my conf. File:

[global]
Password file = passwordfile.xml

(...)

[ShiftCheck]
Comment = Shift Check List

Attributes = Hardware, Raith-Mitarbeiter, Rechnername, Rechnername-alt, Details, SN, AV-Nummer, System, Key, IT-Mitarbeiter, Erledigt_datum, Ausgemustert_datum
Quick filter = Shift, Author
Options Shift = Morning, Evening, Night

Enable attachments = 0
Show text = 0
Custom new form =forms\shiftcheck.html
Custom edit form = forms\shiftcheck.html
Custom display form = forms\shiftcheck.html
List after submit = 1

I tried copying the password file to the forms directory, the logbook directory, the ShiftCheck logbook directory and the elog root folder.  I always get the same error.  I tried entering the absolute path, there was no difference in the result.

When I disable the password file I am able to post without any problems.  Can you help me out? 

Jonathan

 

Stefan Ritt wrote:

Dear ELOG users,

starting with SVN revision 2328, custom input forms are implemented. This allows application specific formats for check lists etc. In our specific case we had to implement a shift check list, which was quite long. Furthermore the check list should be optimized for an iPad, which we take in the field and record various checks and readings (in our case some gas pressure gauges at the PSI particle accelerator). Since the standard ELOG interface was too inflexible, a completely hand-written form was needed. The form can be activated by the new configuration options Custom New Form, Custom Edit Form and Custom Display Form, one for a new entry, an entry to edit and and entry to display. In our case we used the same form for all three cases. This is how the shift check list looks under the Safari Browser on a PC:

Capture.png

And here is how it looks on the iPad:

IMAG0036.jpg

Each section can be collapsed and expanded (blue arrows at the left), and various internal checks are made before the check list can be submitted.

Implementing such forms is however more something for the advanced user, since you have to hand-write HTML with CSS and JavaScript code. It can then however be a powerful method for check lists. Please find in the attachments the elogd.cfg configuration for that logbook and the shiftcheck.html source code file. It is a bit complicated since the page is a static page, elogd just serves it from the file. This requires all the dynamic functions to be implemented inside the HTML file with JavaScript. To display an entry for example, the JavaScript loads the raw data with the "?cmd=Download" command and the populates the form fields. The collapsing and expanding is done by using CSS properties. The integrated style sheet was optimized for the rendering on an iPad. Rather large fonts were chosen so that the items can be checked easily with your finger tips. Various parameters are sent between the browser and the elogd program via hidden fields and cookies. So only something for experts! But if you go through the effort and hand-write the form, it can be very handy. Note that you have to upgrade to SVN revision 2328 for the three new options.

 

 

 

 

  Draft   Fri Feb 26 08:38:06 2016  Nigel Warrwarr@ikp.uni-koeln.deBug reportLinux Possible bug in elogd execute_shell

I was just playing around with gcc6's new feature for warning about misleading indentation (which can often hide real bugs) and I think it found one in elog-3.1.1-1 at src/elogd.c:22538. Here there is an if statement, which looks as though it should be inside a loop, but it isn't. The code is:

      for (i = 0; i < MAX_ATTACHMENTS; i++)
         generate_subdir_name(att_file[i], subdir, sizeof(subdir));
         if (att_file[i][0] && strlen(shell_cmd) + strlen(lbs->data_dir) + strl$
             < sizeof(shell_cmd) + 1)
{
            strcpy(p, "\"");
            strcat(p, lbs->data_dir);
            strlcat(str, subdir, sizeof(str));
            strlcpy(str, att_file[i], sizeof(str));
            str_escape(str, sizeof(str));
            strcat(p, str);
            strcat(p, "\" ");
            p += strlen(p);
         }

and the if statment is accessing the loop variable i but it is actually outside the loop. Presumably, there should be some more curly brackets here. gcc6 gave the warning:

src/elogd.c: In function ‘execute_shell’:
src/elogd.c:22538:10: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
          if (att_file[i][0] && strlen(shell_cmd) + strlen(lbs->data_dir) + strlen(subdir) + strlen(att_file[i])
          ^~
src/elogd.c:22536:7: note: ...this ‘for’ clause, but it is not
       for (i = 0; i < MAX_ATTACHMENTS; i++)
       ^~~

ELOG V3.1.5-2eba886