Версия:

Client Logs

The client application outputs logs to the console in accordance with the client code; however, there are server interaction logs that can be managed. This refers to clients where our go_core_query library is used for communication (see in npm). See Connecting to the Backend.

Whether to output server interaction logs is determined during the initialization of go_core_query. As a rule, in our implementations, the flag is taken from the debugMode cookie, which is toggled by the debug() function. But in fact, this is the debug:boolean parameter when initializing a new connection instance.

If the flag is enabled, two groups will be output to the console. The first one, light green, outputs only the outgoing request, and the second one, dark green, contains two objects: the request and the response. With this implementation, the request object is output twice in the console, but this is done on purpose, as there may be other requests between the request and the response, and to see the full picture, we output information both when the request left and when it returned.

More about viewing the exchange of the client part of the application with the server.

In order for the request exchange via the api function (formerly socketQuery) to be displayed in the browser console (DevTools), it is necessary to call the following function in this console once:

debug()
// Will output debug mode ON'

after that, reload the page. The mode is stored in cookies.

The console output for one method consists of two groups:

Example ➢ User ➢ get_me

{
    "command": "get_me",
    "object": "User",
    "params": {
        "getRoles": false
    }
}

Response received ➢ User ➢ get_me

// Request object (duplicated, as the outgoing object (light green) could get lost at the top, since there can be many requests and they are independent).
{
    "command": "get_me",
    "object": "User",
    "params": {
        "getRoles": false
    }
}
// Response object
{
    "time": 3,
    "start": 1773213403269,
    "toastr": {
        "type": "success",
        "message": "noToastr",
        "title": "Ok"
    },
    "data": {
        "user": {
            "id": 1,
            "firstname": "Ivan",
            ...
        },
        "message_en": "noToastr"
    },
    "errName": "noToastr",
    "type": "success",
    "code": 0,
    "msg": "noToastr",
}

There is also a debugFull parameter in the connection instance initialization parameters, and if set to true, the library outputs significantly more information about its actions, which allows dealing with the problem if you cannot establish a connection with the server or in any other emergency situations.

Global Objects of the GoCore Client Part

The frontend of the system was written a long time ago but thoroughly. It has systems of windows and tables, dropdown lists, and other components. Some information about loaded instances and settings is stored in the global MB object. It contains a lot of information, you can study this object yourself if you wish. However, here is what might be useful to you: MB.Tables.tables, MB.Forms.forms, MB.Frames.frames. These are arrays with instances containing all the loaded information (about the profile, about fields, the data itself, all settings, states).

You can also get information about the user via MB.User.