<commit_before><html>
<link rel="stylesheet" type="text/css" href="../../lib/css/themes/jquery-ui/redmond/jquery-ui.min.css"/>
<script type="text/javascript" src="../../lib/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
<script type="text/javascript" src="../../lib/js/jquery-ui-1.10.3.full.min.js"></script>

<link rel="stylesheet" type="text/css" href="../../css/adapter.css"/>
<script type="text/javascript" src="../../js/translate.js"></script>
<script type="text/javascript" src="../../js/adapter-settings.js"></script>

<script type="text/javascript">
    systemDictionary = {
        "SMA Energy Meter Settings": {
            "en": "SMA Energy Meter settings",
            "de": "SMA Energy Meter Einstellungen",
            "ru": "Настройки измерителя энергии SMA"
        },
        "Settings": {"en": "Settings", "de": "Einstellungen", "ru": "Настройки"},
        "Multicast-IP": {"en": "Multicast-IP", "de": "Multicast-IP", "ru": "многоадресный ip"},
        "Multicast-Port": {"en": "Multicast-Port", "de": "Multicast-Port", "ru": "многоадресный порт"},
        "Auto-Reconnect" : {"en": "Auto-reconnect", "de": "Wiederverbinden", "ru": "воссоединиться"},
    };

    function setValue(id, value, onChange) {
        // example: select elements with id=key and class=value and insert value
        if ($('#' + id + '.value').attr('type') == 'checkbox') {
            $('#' + id + '.value').prop('checked', value).change(function() {
                onChange();
            });
        } else {
            $('#' + id + '.value').val(value).change(function() {
                onChange();
            }).keyup(function() {
                $(this).trigger('change');
            });
        }
    }

    // the function loadSettings has to exist ...
    function load(settings, onChange) {
        for (var key in settings) {
            setValue(key, settings[key], onChange);
        }
        onChange(false);
    }

    // ... and the function save has to exist.
    // you have to make sure the callback is called with the settings object as first param!
    function save(callback) {
        // example: select elements with class=value and build settings object
        var obj = {};
        $('.value').each(function () {
            var $this = $(this);
            if ($this.attr('type') == 'checkbox') {
                obj[$this.attr('id')] = $this.prop('checked');
            } else {
                obj[$this.attr('id')] = $this.val();
            }
        });
        $('.check').each(function () {
            var $this = $(this);
            obj[$this.attr('id')] = $this.is('checked');
        });
        callback(obj);
    }

    $(document).ready(function () {
        $('#tabs').tabs();
    });
</script>
<style>
    #settings tr { line-height: 2.5em; }
</style>
    
<!-- you have to put your config page in a div with id adapter-container -->
<div id="adapter-container">
<table>
<tbody>
<tr>
<td><img src="sma-em.png" width="64" height="64" /></td>
<td>
<h3 class="translate">SMA Energy Meter Settings</h3>
</td>
</tr>
</tbody>
</table>
<div id="settings">
<table>
<tbody>
<tr>
<td class="translate">Multicast-IP</td>
<td><input id="BIP" class="value" disabled="disabled" type="text" value="172.16.58.3" /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="translate">Multicast-Port</td>
<td><input id="BPO" class="value" disabled="disabled" type="text" value="9522" /></td>
<td>&nbsp;</td><commit_msg>sync index.html with template<commit_after><html>
<link rel="stylesheet" type="text/css" href="../../lib/css/themes/jquery-ui/redmond/jquery-ui.min.css"/>
<script type="text/javascript" src="../../lib/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
<script type="text/javascript" src="../../lib/js/jquery-ui-1.10.3.full.min.js"></script>

<link rel="stylesheet" type="text/css" href="../../css/adapter.css"/>
<script type="text/javascript" src="../../js/translate.js"></script>
<script type="text/javascript" src="../../js/adapter-settings.js"></script>

<script type="text/javascript">
    systemDictionary = {
        "SMA Energy Meter Settings": {
            "en": "SMA Energy Meter settings",
            "de": "SMA Energy Meter Einstellungen",
            "ru": "Настройки измерителя энергии SMA"
        },
        "Settings": {"en": "Settings", "de": "Einstellungen", "ru": "Настройки"},
        "Multicast-IP": {"en": "Multicast-IP", "de": "Multicast-IP", "ru": "многоадресный ip"},
        "Multicast-Port": {"en": "Multicast-Port", "de": "Multicast-Port", "ru": "многоадресный порт"},
        "Auto-Reconnect" : {"en": "Auto-reconnect", "de": "Wiederverbinden", "ru": "воссоединиться"},
    };

    // the function loadSettings has to exist ...
    function load(settings, onChange) {
        // example: select elements with id=key and class=value and insert value
       if (!settings) return;
        $('.value').each(function () {
            var $key = $(this);
            var id = $key.attr('id');
            if ($key.attr('type') === 'checkbox') {
		// do not call onChange direct, because onChange could expect some arguments
                $key.prop('checked', settings[id]).change(function() {
                    onChange();
                });
            } else {
		// do not call onChange direct, because onChange could expect some arguments
                $key.val(settings[id]).change(function() {
                    onChange();
                }).keyup(function() {
                    onChange();
                });
            }
        });
        onChange(false);
    }

    // ... and the function save has to exist.
    // you have to make sure the callback is called with the settings object as first param!
    function save(callback) {
        // example: select elements with class=value and build settings object
        var obj = {};
        $('.value').each(function () {
            var $this = $(this);
			if ($this.attr('type') === 'checkbox') {
				obj[$this.attr('id')] = $this.prop('checked');
			} else {
				obj[$this.attr('id')] = $this.val();
			}
        });
        callback(obj);
    }

    $(document).ready(function () {
        $('#tabs').tabs();
    });
</script>
<style>
    #settings tr { line-height: 2.5em; }
</style>

<!-- you have to put your config page in a div with id adapter-container -->
<div id="adapter-container">
<table>
<tbody>
<tr>
<td><img src="sma-em.png" width="64" height="64" /></td>
<td>
<h3 class="translate">SMA Energy Meter Settings</h3>
</td>
</tr>
</tbody>
</table>
<div id="settings">
<table>
<tbody>
<tr>
<td class="translate">Multicast-IP</td>
<td><input id="BIP" class="value" disabled="disabled" type="text" value="172.16.58.3" /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="translate">Multicast-Port</td>
<td><input id="BPO" class="value" disabled="disabled" type="text" value="9522" /></td>
<td>&nbsp;</td>
{'fraction_non_alphanumeric': 0.20958943439563596, 'fraction_numerical': 0.008039046798736722, 'mean_word_length': 2.6192207792207793, 'pattern_counts': {'":': 38, '<': 107, '<?xml version=': 0, '>': 107, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5347618', 'n_tokens_mistral': 2236, 'n_tokens_neox': 2210, 'n_words': 505}