UniPiTechnology / evok-web-jq

Evok web is web front application for Evok
Apache License 2.0
1 stars 0 forks source link

Evok www interface does not support https protocol #14

Open brzezinol opened 2 years ago

brzezinol commented 2 years ago

I have a question about installing evok. I installed evok using this documentation https://github.com/UniPiTechnology/evok#legacy-installation-process-using-a-shell-script-required-for-unipi-11 There is, I assume link to latest vesion of evok "wget https://github.com/UniPiTechnology/evok/archive/2.4.12.zip" But after install I discover that https is not handled properly. http hardcoded is still in funtion:

function updateValues() {
    if (legacy_api) {
        $.ajax({
            crossDomain: true,
            url: 'http://' + $(location).attr('hostname') + ':' + api_port + '/rest/all',
            dataType: 'json',
            success: function (data) {
                $("#unipi_loading_spinner").css('visibility', 'hidden');
                data = sortResults(data);
                $.each(data, function (name, msg) {
                        syncDevice(msg);
                });
            },
            error: function (data) {
                $("#unipi_loading_spinner").css('visibility', 'visible');
            }
        });

Does mentioned documentation refers to latest version with fix from followin pull? https://github.com/UniPiTechnology/evok/pull/78

Is there a easy fix or update for this issue ? Because I made a little big installation using evok.

brzezinol commented 2 years ago

Changing line url: 'http://' + $(location).attr('hostname') + ':' + api_port + '/rest/all', to url: '/rest/all',

fix problem because request will be made using current base addres. but of course author of this script shuld check what was intention of hardcode http.

the same situation with: url: 'http://' + $(location).attr('hostname') + ':' + api_port + '/rest/' + device + '/' + circuit + '/',