Commit f5fc19a6ab82276c0b2dc72aada173622c79031e

Authored by Julien Verneuil
1 parent daf7d84b

add "width" parameter to information

add "time" alternative to VT_edit_entry
change datetime input width
database/vtm/view_table_renderer.anubis
... ... @@ -63,12 +63,12 @@ public define List(CXM_Form_Field)
63 63 if h is
64 64 {
65 65 hidden(name, value) then
66   - print("hidden "+name+" = "+value);
  66 + //print("hidden "+name+" = "+value);
67 67 [hidden(htmlId(""), wan(name), init(value))],
68 68 primary_key(idx) then
69 69 [hidden(htmlId(""), wan("id"), init(idx))],
70   - information(s_name, c_name, value, help) then
71   - [input_readonly(_T(s_name), wan(c_name), init(value), narrow), help_line(help, _T)],
  70 + information(s_name, c_name, value, width, help) then
  71 + [input_readonly(_T(s_name), wan(c_name), init(value), if width > 0 then custom(width) else narrow), help_line(help, _T)],
72 72 text(s_name, c_name, value, help) then
73 73 [input(_T(s_name), wan(c_name), init(value), narrow, mandatory), help_line(help, _T)],
74 74 foreign_text(s_name, c_name, value, select, help) then
... ... @@ -81,8 +81,10 @@ public define List(CXM_Form_Field)
81 81 [input(_T(s_name), wan(c_name), init(abs_to_decimal(value)), small, mandatory), help_line(help, _T)],
82 82 date(s_name, c_name, value, help) then
83 83 [input([class("datepicker")], _T(s_name), htmlId(c_name), wan(c_name), init(value), small, non_mandatory), help_line(help, _T)],
  84 + time(s_name, c_name, value, help) then
  85 + [input([class("timepicker")], _T(s_name), htmlId(c_name), wan(c_name), init(value), small, non_mandatory), help_line(help, _T)],
84 86 datetime(s_name, c_name, value, help) then
85   - [input([class("datetimepicker")], _T(s_name), htmlId(c_name), wan(c_name), init(value), small, mandatory), help_line(help, _T)],
  87 + [input([class("datetimepicker")], _T(s_name), htmlId(c_name), wan(c_name), init(value), custom(18), mandatory), help_line(help, _T)],
86 88 },
87 89 edit_form_lines(db, _T, t, reverse(line)+so_far)
88 90 }.
... ...
database/vtm/view_table_types.anubis
... ... @@ -15,20 +15,22 @@ public type VT_edit_selector:
15 15 public type VT_edit_entry:
16 16 hidden (String name, String value),
17 17 primary_key (String idx),
18   - information (String s_name, String c_name, String v_name, HK_Help_Text help), //s_name = show_name for translation, v_name = string to show
19   - text (String s_name, String c_name, String value, HK_Help_Text help), //s_name = show_name for translation, c_name = table column name
  18 + information (String s_name, String c_name, String v_name, Int width, HK_Help_Text help), //s_name = show_name for translation, v_name = string to show
  19 + text (String s_name, String c_name, String value, HK_Help_Text help), //s_name = show_name for translation, c_name = table column name
20 20 foreign_text(String s_name, String c_name, Int selected, VT_edit_selector selector, HK_Help_Text help),
21   - text_area (String s_name, String c_name, String value, HK_Help_Text help), //s_name = show_name for translate, c_name = table column name
22   - boolean (String s_name, String c_name, Bool value, HK_Help_Text help),
23   - integer (String s_name, String c_name, Int value, HK_Help_Text help),
24   - date (String s_name, String c_name, String value, HK_Help_Text help),
25   - datetime (String s_name, String c_name, String value, HK_Help_Text help).
  21 + text_area (String s_name, String c_name, String value, HK_Help_Text help), //s_name = show_name for translate, c_name = table column name
  22 + boolean (String s_name, String c_name, Bool value, HK_Help_Text help),
  23 + integer (String s_name, String c_name, Int value, HK_Help_Text help),
  24 + date (String s_name, String c_name, String value, HK_Help_Text help),
  25 + time (String s_name, String c_name, String value, HK_Help_Text help),
  26 + datetime (String s_name, String c_name, String value, HK_Help_Text help).
26 27  
27 28 public define VT_edit_entry text (String s_name, String c_name, String value) = text(s_name, c_name, value, no_help_text).
28 29 public define VT_edit_entry foreign_text(String s_name, String c_name, Int selected, VT_edit_selector selector) = foreign_text(s_name, c_name, selected, selector, no_help_text).
29 30 public define VT_edit_entry text_area (String s_name, String c_name, String value) = text_area(s_name, c_name, value, no_help_text).
30 31 public define VT_edit_entry boolean(String s_name, String c_name, Bool value) = boolean(s_name, c_name, value, no_help_text).
31 32 public define VT_edit_entry integer(String s_name, String c_name, Int value) = integer(s_name, c_name, value, no_help_text).
  33 +public define VT_edit_entry information(String s_name, String c_name, String v_name, HK_Help_Text help) = information(s_name, c_name, v_name, 0, help).
32 34  
33 35  
34 36 public type VT_edit:
... ...
net_services_protocols/logger_service.anubis
... ... @@ -116,8 +116,8 @@ define Bool
116 116 success(log_name) then
117 117 if get_logger(logs, log_name) is
118 118 {
119   - failure then println("can't find log ["+log_name+"]");false,
120   - success(log) then process_log(log, msg)
  119 + failure then println("can't find log ["+log_name+"]");false,
  120 + success(log) then process_log(log, msg)
121 121 }
122 122 }.
123 123  
... ... @@ -183,32 +183,31 @@ public define String
183 183 firsts_bytes = extract(data, 0, max),
184 184 "Length=" + l + "; String='"+to_string(firsts_bytes)+"' Buffer=[" + to_ascii(firsts_bytes) + (if l > max then "...]" else "]").
185 185  
186   -
187   -define (UDP_Socket, ByteArray, Truncation, Word32, Word32) -> One
  186 +define (UDP_Socket, ByteArray, Truncation, Word32, Word32) -> One
188 187 make_udp_handler
189 188 (
190 189 List(Logger) logs,
191 190 Logger debug_logger
192   - ) =
193   - (
194   - UDP_Socket socket,
195   - ByteArray data,
196   - Truncation truncation,
197   - Word32 ip_address,
198   - Word32 ip_port
199   - ) |->
200   - with ip = ip_addr_to_string(ip_address),
201   - logTrace(debug_logger, logMask("Logger"), "LoggerServer: data received (" + length(data) + " bytes) from IP " + ip + "... ");
202   - if receive_message_from_io(make_data_io(data)) is
203   - {
204   - failure then logWarning(debug_logger, "LoggerServer: Bad data packet received from IP " + ip + ": " + data_preview(data, 20)),
205   - success(msg) then
  191 + ) =
  192 + (
  193 + UDP_Socket socket,
  194 + ByteArray data,
  195 + Truncation truncation,
  196 + Word32 ip_address,
  197 + Word32 ip_port
  198 + ) |->
  199 + with ip = ip_addr_to_string(ip_address),
  200 + logTrace(debug_logger, logMask("Logger"), "LoggerServer: data received (" + length(data) + " bytes) from IP " + ip + "... ");
  201 + if receive_message_from_io(make_data_io(data)) is
  202 + {
  203 + failure then logWarning(debug_logger, "LoggerServer: Bad data packet received from IP " + ip + ": " + data_preview(data, 20)),
  204 + success(msg) then
206 205 if *msg.what = _CXM_LOGGER_LOG then
207 206 forget(process_log(logs, msg))
208 207 else
209 208 println("LoggerService: wrong message_received. [" + to_hexa(*msg.what) + "] is not _CXM_LOGGER_LOG ")
210   - }.
211   -
  209 +}.
  210 +
212 211 define One
213 212 my_notify
214 213 (
... ... @@ -229,8 +228,8 @@ public define Maybe(UDP_Server)
229 228 my_notify) is
230 229 {
231 230 cannot_create_the_socket then logError(debug_logger, "Cannot create the listening socket."); failure,
232   - cannot_bind_address_port then logError(debug_logger, "Cannot bind to port " + logger_port + ".");failure,
233   - access_denied then logError(debug_logger, "Cannot listen on port " + logger_port + ".");failure,
  231 + cannot_bind_address_port then logError(debug_logger, "Cannot bind to port " + logger_port + "."); failure,
  232 + access_denied then logError(debug_logger, "Cannot listen on port " + logger_port + "."); failure,
234 233 ok(server) then logInfo(debug_logger, "LocalLog Server started on port " + logger_port + "."); success(server)
235 234 }.
236 235  
... ... @@ -284,16 +283,16 @@ define Message
284 283 String log_name
285 284 ) =
286 285 if log_name = debug_log then "debug.log"
287   - else if log_name = "SendMail" then "debug.log"
  286 + else if log_name = "SendMail" then "debug.log"
288 287 else if log_name = config_log then "config.log"
289 288 else if log_name = incoming_log then "incoming.log"
290   - else if log_name = outgoing_log then "outgoing.log"
291   - else if log_name = pop3_log then "pop3.log"
292   - else if log_name = mailing_log then "mailing.log"
293   - else if log_name = errors_log then "errors.log"
294   - else if log_name = "DB" then "errors.log"
295   - else if log_name = "SQL" then "sql_profiling.log"
296   - else if log_name = security_log then "security.log"
  289 + else if log_name = outgoing_log then "outgoing.log"
  290 + else if log_name = pop3_log then "pop3.log"
  291 + else if log_name = mailing_log then "mailing.log"
  292 + else if log_name = errors_log then "errors.log"
  293 + else if log_name = "DB" then "errors.log"
  294 + else if log_name = "SQL" then "sql_profiling.log"
  295 + else if log_name = security_log then "security.log"
297 296 else if log_name = spams_log then "spams.log"
298 297 else if log_name = api_log then "api.log"
299 298 else if log_name = internal_log then "internal"
... ...