uawdijnntqw1x1x1
IP : 18.221.172.197
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
.
/
b24.axolotl.ru
/
public_html
/
bitrix
/
js
/
bizproc
/
debugger
/
src
/
helper.js
/
/
import {Loc, Text, Type} from 'main.core'; import {DateTimeFormat} from 'main.date'; export class Helper { /** Finds whether a variable is a number or a numeric string */ static isNumeric(num: string | number): boolean { if (Type.isNumber(num)) { return true; } if (!Type.isStringFilled(num)) { return false; } return (Number(num).toString() === num.trim()); } /** Checks whether the variable is a date or a timestamp */ static isDate(date: string | Date): boolean { if (Type.isDate(date)) { return true; } if (!Helper.isNumeric(date)) { return false; } return (new Date(Number(date)).getTime() === Number(date)); } /** Convert date from DataBase to date in JS */ static convertDateFromDB(date: string | number): ?Date { if (!Helper.isNumeric(date)) { return null; } return new Date(date * 1000); } /** if the variable is a date or a timestamp return Date, else null */ static toDate(date: string | Date): ?Date { if (Date.parse(date)) { return new Date(date); } if (!Helper.isDate(date)) { return null; } if (Type.isDate(date)) { return date; } return Helper.convertDateFromDB(date); } /** formats the date */ static formatDate(format: string, date: Date): string { if (!Type.isStringFilled(format)) { format = 'j F Y H:i:s'; } return DateTimeFormat.format(format, date); } /** return condition operators label */ static getOperatorsLabel(): object { return { '!empty': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_NOT_EMPTY'), 'empty': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_EMPTY'), '=': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_EQ'), '!=': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_NE'), 'in': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_IN'), '!in': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_NOT_IN'), 'contain': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_CONTAIN'), '!contain': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_NOT_CONTAIN'), '>': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_GT'), '>=': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_GTE'), '<': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_LT'), '<=': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_LTE'), }; } /** return condition operator label */ static getOperatorLabel(operator: string): string { return Helper.getOperatorsLabel()[operator]; } /** return joiner label */ static getJoinerLabel(joiner: string): string { const joiners = { 'AND': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_AND'), 'OR': Loc.getMessage('BIZPROC_JS_DEBUGGER_LOG_CONDITION_OR'), }; return joiners[joiner]; } static getColorBrightness(bgColor: string): number { if (bgColor[0] === '#') { bgColor = bgColor.replace('#', ''); } const bigint = parseInt(bgColor, 16); const r = (bigint >> 16) & 255; const g = (bigint >> 8) & 255; const b = bigint & 255; return 0.21 * r + 0.72 * g + 0.07 * b; } static getBgColorAdditionalClass(bgColor: string): boolean { const brightness = Helper.getColorBrightness(bgColor); if (brightness > 224) { return '--with-border --light-color'; } if (brightness > 145) { return '--light-color'; } return ''; } static toHtml(text): string { return Text.encode(text || '') .replace(/\[(\/)?b\]/ig, '<$1b>') ; } }
/var/www/axolotl/data/www/./b24.axolotl.ru/public_html/bitrix/js/bizproc/debugger/src/helper.js