Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 108 of 806  Not logged in ELOG logo
New entries since:Thu Jan 1 01:00:00 1970
IDdown Date Icon Author Author Email Category OS ELOG Version Subject
  68971   Tue May 14 09:40:58 2019 Idea Xuan Wuwux@ihep.ac.cnCommentLinux3.1.3add a little function--go to the specified page number

Hi all,

I added an input widget for pagination. I'd like to share it here, maybe someone needs. If there are many pages,  specifying the page number will be useful. 

The picture and patch code are in the attachment

Regards,

Xuan

Attachment 1: pagination.png
pagination.png
Attachment 2: goto.patch
--- elogd.c.org	2019-05-14 10:12:01.891558950 +0800
+++ elogd.c	2019-05-14 10:44:38.165898395 +0800
@@ -19407,6 +19407,26 @@ void show_page_navigation(LOGBOOK * lbs,
       rsprintf("<a href=\"%s\">%s</a>\n", ref, loc("All"));
    }
 
+   sprintf(ref, "");
+   build_ref(ref, sizeof(ref), "", "", "", "");
+
+   rsprintf("<input id=\"setPage\" title=\"Goto\" type=number size=\"6\" onChange=\'getPage(\"%d\");\'>", num_pages);
+   rsprintf("<script language=\"JavaScript\" type=\"text/javascript\">\n");
+   rsprintf("<!--\n");
+   rsprintf("function getPage(max)\n");
+   rsprintf("  {\n");
+   rsprintf("   var value = document.getElementById('setPage').value;\n");
+   rsprintf("   value = parseInt(value);\n");
+   rsprintf("   if(value > max)\n");
+   rsprintf("      value = max;\n");
+   rsprintf("   if(value < 1)\n");
+   rsprintf("      value = 1;\n");
+   rsprintf("   var url = 'page' + value + \"%s\";\n", ref);
+   rsprintf("   window.location.href = url;\n");
+   rsprintf("  }\n");
+   rsprintf("//-->\n");
+   rsprintf("</script>\n");
+
    rsprintf("</span></td></tr>\n");
 }
 
  68970   Tue May 14 06:07:07 2019 Question Alan Grantagrant@winnipeg.caQuestionWindows3.1.2Shell execute

I have the line in my elog config to run a Powershell script when submitting a New entry. I just send an email as a test:

Execute New = "Powershell.exe -ExecutionPolicy Bypass D:\SendEmail.ps1"

Fyi, the Powershell statement itself (Send-MailMessage -From 'MeterElog@winnipeg.ca' -To 'alangrant@mts.net' -Subject 'New meter entry' -Body 'TEST' -Priority High -DeliveryNotificationOption OnSuccess, OnFailure -SmtpServer 'citygw') works fine and the email is received when running it from the Powershell ISE app directly from the same elog vm server but not from within Elog with the above statement.

I'd like to first confirm that the syntax of the line Execute New = is correct, ie, double quoting the entire command. Can anyone please confirm.

  68969   Fri May 10 15:01:52 2019 Reply Alan Grantagrant@winnipeg.caQuestionWindows3.1.2Re: Execute attribute

I think it was just a matter of my specific interepretation of the documentation, ie: using native OS shell commands vs any script language file containing shell commands or any app for that matter. Nevertheless I think you've answered my questiuon so it's all good. Thanks Stefan.

Stefan Ritt wrote:

I don't understand your question. There is no "inline" vs. "external" script. Using the "execute new = <command>", you run a script on the server side. Can be powershell under Windows or bash/csh under Linux. I remember however that there has been issues under recent windows in passing parameters to the shell. Linux certainly works fine, we usse it all the time.

Alan Grant wrote:

Apart from an inline shell command that can be run with the Execute attribute, is it possible to run an external script file? I would like to run a Powershell script with the Elog attribute data parameters passed to it upon Submit New entry.

 

 

  68968   Fri May 10 08:19:08 2019 Reply Stefan Rittstefan.ritt@psi.chQuestionWindows3.1.2Re: Execute attribute

I don't understand your question. There is no "inline" vs. "external" script. Using the "execute new = <command>", you run a script on the server side. Can be powershell under Windows or bash/csh under Linux. I remember however that there has been issues under recent windows in passing parameters to the shell. Linux certainly works fine, we usse it all the time.

Alan Grant wrote:

Apart from an inline shell command that can be run with the Execute attribute, is it possible to run an external script file? I would like to run a Powershell script with the Elog attribute data parameters passed to it upon Submit New entry.

 

  68967   Fri May 10 04:34:36 2019 Question Alan Grantagrant@winnipeg.caQuestionWindows3.1.2Execute attribute

Apart from an inline shell command that can be run with the Execute attribute, is it possible to run an external script file? I would like to run a Powershell script with the Elog attribute data parameters passed to it upon Submit New entry.

  68966   Thu May 9 16:42:13 2019 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux3.1.2Re: Does there is a way to no the $message_id when creating a new submission

No, the message ID gets assigned only when you submit the entry.

Stefan

Lagarde wrote:

Hello,

I would like to know if it's possible to know the message_id of when creating a new entry in elog ?

I would like to do something like this Preset text = $message_id

Thx;

 

  68965   Thu May 9 13:34:55 2019 Entry Lagarde lagarde@sjtu.edu.cnQuestionLinux3.1.2Does there is a way to no the $message_id when creating a new submission

Hello,

I would like to know if it's possible to know the message_id of when creating a new entry in elog ?

I would like to do something like this Preset text = $message_id

Thx;

  68964   Fri May 3 16:48:47 2019 Reply Stefan Rittstefan.ritt@psi.chQuestionWindows3.1.2Re: Last default = <n>

Indeed you're right (my memory is fading, argh). Please try 3.1.4.

Stefan

Alan Grant wrote:

Thanks again.

I noticed in the Change Log for 3.1.4 that there's a reference to something done with "Last default" in Sept 2018 so I think I will try to set up a Linux instance and try out 3.1.4. Regards.

Version 3.1.4, released September 26th, 2018
============================================

- Replaced sprintf by snprintf
- Changed midas.psi.ch to elog.psi.ch
- Fixed bug for redirect under two daisy-chained proxies
- Removed while(in_asend) which caused some browsers to block
- Implemented elogd.service for systemd daemon
- Implemented "max email attachment size"
- Limit max request size to 100 MB
- Allow ampersand in user names
- Added code to detect Unicode characters as HTML
- add "Email CSS URL" : use public copy of CSS for emails
- bugfix: replace hard-coded reference of "New" to loc("New")
- add "Subscription columns" : format list of logbooks for subscriptions in columns
- Added "interface" option
- Fixed crash on negative Content-Length in header
- Fixed "?npp=0" crash
- Added confirmation dialog before deleting an attachment
- Implemented "last default" to restrict quick filter display by default on the last n days
- Made header parsing case insensitive
- Switched to TLSv1_

Stefan Ritt wrote:

Yes I always run the current version from bitbucket. I haven't touched that code for "last default" since a long time, so I don't expect the verison to make a difference. Unfortuantely I have not Windows Server or IE for testing.

Alan Grant wrote:

Ok thanks for taking the time to try it out. I definitely still show "All entries" in any case, so I will continue to try to resolve on my end and if I find the cause or solution I will share back on the forum.

First though, I noticed you ran 3.1.4 whereas I'm still on 3.1.2. I'm also on Windows Server 2016 and IE 11. Do you think any of that might make the difference?

Stefan Ritt wrote:

I just tried your elogd.cfg, and it works fine for me. So no idea what is wrong in your case.

Stefan

 

 

 

 

ELOG V3.1.5-3fb85fa6