Skip to content

Commit

Permalink
some fixes in UI Setting
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkhe committed Jan 4, 2025
1 parent da6a6b7 commit 1434766
Show file tree
Hide file tree
Showing 16 changed files with 574 additions and 457 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,11 @@ The supported commands are:
### **WORK IN PROGRESS**
* ()
-->
### 4.3.0 (2025-01-02)
### **WORK IN PROGRESS**
* (deher) token from config now encrypted, user has to re-choose device in settings
* (deher) some fixes in UI Setting

### 4.3.0 (2025-01-02) rejected
* (JimmyBondi) added dreame error messages
* (simatec) responsive design added
* (deher) update dependecies and linting
Expand Down
4 changes: 3 additions & 1 deletion admin/i18n/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"MiHome-vacuum adapter settings": "MiHome-Vakuum Adaptereinstellungen",
"Monday": "Montag",
"Own port:": "Eigener Port:",
"Please get Devices first": "Bitte holen Sie sich zuerst Geräte",
"Resume paused zonecleaning with start button": "Zonenreinigung nach Pause fortsetzen",
"Robot images": "Roboterbilder",
"Saturday": "Samstag",
Expand All @@ -28,6 +29,7 @@
"add a state for Alexa": "Füge einen Zustand für Alexa hinzu",
"add timer and choose room channels directly and/or choose rooms, which finds assigned room channels": "Timer hinzufügen und Raumkanäle direkt auswählen und/oder Räume auswählen, um zugewiesene Raumkanäle zu finden",
"additional settings": "zusätzliche Einstellungen",
"choose Device": "Wählen Sie Gerät",
"clean Room": "reinige Zimmer",
"clean assigned rooms": "zugewiesene Zimmer reinigen",
"clean water Filter": "säubere Wasser Filter",
Expand All @@ -52,4 +54,4 @@
"waiting position": "Warteposition",
"water box installed": "Wischeinheit installiert",
"water filter reset": "Wasser Filter zurücksetzen"
}
}
4 changes: 3 additions & 1 deletion admin/i18n/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"MiHome-vacuum adapter settings": "MiHome-vacuum adapter settings",
"Monday": "Monday",
"Own port:": "Own port:",
"Please get Devices first": "Please get Devices first",
"Resume paused zonecleaning with start button": "Resume paused zonecleaning with start button",
"Robot images": "Robot images",
"Saturday": "Saturday",
Expand All @@ -28,6 +29,7 @@
"add a state for Alexa": "add a state for Alexa",
"add timer and choose room channels directly and/or choose rooms, which finds assigned room channels": "add timer and choose room channels directly and/or choose rooms, which finds assigned room channels",
"additional settings": "additional settings",
"choose Device": "choose Device",
"clean Room": "clean Room",
"clean assigned rooms": "clean assigned rooms",
"clean water Filter": "clean water Filter",
Expand All @@ -52,4 +54,4 @@
"waiting position": "waiting position",
"water box installed": "water box installed",
"water filter reset": "water filter reset"
}
}
4 changes: 3 additions & 1 deletion admin/i18n/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"MiHome-vacuum adapter settings": "Configuración del adaptador MiHome-vacuum",
"Monday": "lunes",
"Own port:": "Puerto propio:",
"Please get Devices first": "Obtenga primero los dispositivos",
"Resume paused zonecleaning with start button": "Reanudar la zona de limpieza en pausa con el botón de inicio",
"Robot images": "Imágenes de robot",
"Saturday": "sábado",
Expand All @@ -28,6 +29,7 @@
"add a state for Alexa": "agregar un estado para Alexa",
"add timer and choose room channels directly and/or choose rooms, which finds assigned room channels": "agregue temporizador y elija canales de sala directamente y / o elija salas, que encuentra los canales de sala asignados",
"additional settings": "ajustes adicionales",
"choose Device": "elegir dispositivo",
"clean Room": "Habitación limpia",
"clean assigned rooms": "limpiar habitaciones asignadas",
"clean water Filter": "filtro de agua limpia",
Expand All @@ -52,4 +54,4 @@
"waiting position": "posición de espera",
"water box installed": "caja de agua instalada",
"water filter reset": "restablecimiento del filtro de agua"
}
}
4 changes: 3 additions & 1 deletion admin/i18n/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"MiHome-vacuum adapter settings": "MiHome-paramètres d'adaptateur de vide",
"Monday": "Lundi",
"Own port:": "Propre port:",
"Please get Devices first": "Veuillez d'abord vous procurer des appareils",
"Resume paused zonecleaning with start button": "Reprendre le nettoyage en mode pause avec le bouton Démarrer",
"Robot images": "Images de robots",
"Saturday": "samedi",
Expand All @@ -28,6 +29,7 @@
"add a state for Alexa": "ajouter un état pour Alexa",
"add timer and choose room channels directly and/or choose rooms, which finds assigned room channels": "ajouter une minuterie et choisir directement les canaux de pièce et / ou choisir les chambres, qui trouve les canaux de pièce attribués",
"additional settings": "paramètres additionnels",
"choose Device": "choisissez Appareil",
"clean Room": "chambre propre",
"clean assigned rooms": "nettoyer les chambres attribuées",
"clean water Filter": "Filtre à eau propre",
Expand All @@ -52,4 +54,4 @@
"waiting position": "position d'attente",
"water box installed": "boîte à eau installée",
"water filter reset": "réinitialisation du filtre à eau"
}
}
4 changes: 3 additions & 1 deletion admin/i18n/it/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"MiHome-vacuum adapter settings": "Impostazioni dell'adattatore per vuoto MiHome",
"Monday": "Lunedi",
"Own port:": "Porto proprio:",
"Please get Devices first": "Per favore procurati prima i dispositivi",
"Resume paused zonecleaning with start button": "Riprendi zonecleaning in pausa con il pulsante di avvio",
"Robot images": "Immagini di robot",
"Saturday": "Sabato",
Expand All @@ -28,6 +29,7 @@
"add a state for Alexa": "aggiungi uno stato per Alexa",
"add timer and choose room channels directly and/or choose rooms, which finds assigned room channels": "aggiungi il timer e scegli i canali room direttamente e / o scegli room, che trova i canali room assegnati",
"additional settings": "altre impostazioni",
"choose Device": "scegli Dispositivo",
"clean Room": "stanza pulita",
"clean assigned rooms": "camere pulite assegnate",
"clean water Filter": "filtro per acqua pulita",
Expand All @@ -52,4 +54,4 @@
"waiting position": "posizione di attesa",
"water box installed": "scatola dell'acqua installata",
"water filter reset": "reset del filtro dell'acqua"
}
}
4 changes: 3 additions & 1 deletion admin/i18n/nl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"MiHome-vacuum adapter settings": "MiHome-vacuüm adapterinstellingen",
"Monday": "maandag",
"Own port:": "Eigen poort:",
"Please get Devices first": "Koop eerst Apparaten",
"Resume paused zonecleaning with start button": "Pauzeer zonecleaning opnieuw met de startknop",
"Robot images": "Robotafbeeldingen",
"Saturday": "zaterdag",
Expand All @@ -28,6 +29,7 @@
"add a state for Alexa": "voeg een staat toe voor Alexa",
"add timer and choose room channels directly and/or choose rooms, which finds assigned room channels": "voeg de timer toe en kies direct kamerkanalen en / of kies kamers, die toegewezen kamerkanalen vinden",
"additional settings": "aanvullende instellingen",
"choose Device": "kies Apparaat",
"clean Room": "schone kamer",
"clean assigned rooms": "schone toegewezen kamers",
"clean water Filter": "schoon waterfilter",
Expand All @@ -52,4 +54,4 @@
"waiting position": "wachtpositie",
"water box installed": "waterbak geïnstalleerd",
"water filter reset": "waterfilter reset"
}
}
4 changes: 3 additions & 1 deletion admin/i18n/pl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"MiHome-vacuum adapter settings": "Ustawienia adaptera MiHome-vacuum",
"Monday": "Poniedziałek",
"Own port:": "Własny port:",
"Please get Devices first": "Najpierw zdobądź Urządzenia",
"Resume paused zonecleaning with start button": "Wznów wstrzymanie procesu oczyszczania za pomocą przycisku Start",
"Robot images": "Obrazy robotów",
"Saturday": "Sobota",
Expand All @@ -28,6 +29,7 @@
"add a state for Alexa": "dodaj stan dla Alexy",
"add timer and choose room channels directly and/or choose rooms, which finds assigned room channels": "dodaj zegar i wybierz kanały pokojowe bezpośrednio i / lub wybierz pokoje, które wyszukają przypisane kanały pokojowe",
"additional settings": "dodatkowe ustawienia",
"choose Device": "wybierz Urządzenie",
"clean Room": "czysty pokój",
"clean assigned rooms": "posprzątaj przydzielone pokoje",
"clean water Filter": "Filtr czystej wody",
Expand All @@ -52,4 +54,4 @@
"waiting position": "pozycja oczekiwania",
"water box installed": "zainstalowany pojemnik na wodę",
"water filter reset": "reset filtra wody"
}
}
4 changes: 3 additions & 1 deletion admin/i18n/pt/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"MiHome-vacuum adapter settings": "Configurações do adaptador MiHome-vácuo",
"Monday": "Segunda-feira",
"Own port:": "Porta própria:",
"Please get Devices first": "Obtenha os dispositivos primeiro",
"Resume paused zonecleaning with start button": "Retomar o zonecleaning pausado com o botão Iniciar",
"Robot images": "Imagens de robô",
"Saturday": "Sábado",
Expand All @@ -28,6 +29,7 @@
"add a state for Alexa": "adicione um estado para Alexa",
"add timer and choose room channels directly and/or choose rooms, which finds assigned room channels": "adicione temporizador e escolha os canais da sala diretamente e / ou escolha as salas, que encontram os canais de sala atribuídos",
"additional settings": "Configurações adicionais",
"choose Device": "escolha Dispositivo",
"clean Room": "quarto limpo",
"clean assigned rooms": "limpar quartos designados",
"clean water Filter": "filtro de agua potável",
Expand All @@ -52,4 +54,4 @@
"waiting position": "posição de espera",
"water box installed": "caixa de água instalada",
"water filter reset": "redefinição do filtro de água"
}
}
4 changes: 3 additions & 1 deletion admin/i18n/ru/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"MiHome-vacuum adapter settings": "Настройки адаптера MiHome-vacuum",
"Monday": "понедельник",
"Own port:": "Собственный порт:",
"Please get Devices first": "Сначала приобретите устройства",
"Resume paused zonecleaning with start button": "Возобновление приостановки zonecleaning с кнопкой запуска",
"Robot images": "Робот изображения",
"Saturday": "суббота",
Expand All @@ -28,6 +29,7 @@
"add a state for Alexa": "добавить информацию о пользователе Alexa",
"add timer and choose room channels directly and/or choose rooms, which finds assigned room channels": "добавить таймер и выбрать каналы номеров напрямую и / или выбрать номера, которые находят назначенные каналы номеров",
"additional settings": "дополнительные настройки",
"choose Device": "выберите Устройство",
"clean Room": "чистая комната",
"clean assigned rooms": "чистые назначенные комнаты",
"clean water Filter": "Фильтр чистой воды",
Expand All @@ -52,4 +54,4 @@
"waiting position": "позиция ожидания",
"water box installed": "установлен водяной бокс",
"water filter reset": "сброс фильтра воды"
}
}
4 changes: 3 additions & 1 deletion admin/i18n/zh-cn/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"MiHome-vacuum adapter settings": "MiHome真空适配器设置",
"Monday": "星期一",
"Own port:": "自己的港口:",
"Please get Devices first": "请先获取设备",
"Resume paused zonecleaning with start button": "使用开始按钮恢复暂停的区域清理",
"Robot images": "机器人图像",
"Saturday": "星期六",
Expand All @@ -28,6 +29,7 @@
"add a state for Alexa": "为Alexa添加状态",
"add timer and choose room channels directly and/or choose rooms, which finds assigned room channels": "添加计时器并直接选择房间频道和/或选择房间,以查找分配的房间频道",
"additional settings": "其他设置",
"choose Device": "选择设备",
"clean Room": "整理房间",
"clean assigned rooms": "清洁分配的房间",
"clean water Filter": "净水过滤器",
Expand All @@ -52,4 +54,4 @@
"waiting position": "等待位置",
"water box installed": "水箱安装",
"water filter reset": "滤水器重置"
}
}
55 changes: 24 additions & 31 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@
$('.hidden').hide();
//soad selection list

console.log('sett_' + JSON.stringify(settings))
loadSelect(settings['MiDevice'])
//console.log('sett_' + JSON.stringify(settings))
//loadSelect(settings['MiDevice'])
settings.pingInterval = parseInt(settings.pingInterval / 1000, 10)
settings.wifiInterval = parseInt(settings.wifiInterval / 1000, 10)
curToken = settings.token;
Expand All @@ -207,14 +207,13 @@
onChange();
});
} else {
if ($key.attr('id') === 'devices') {

if ( $key.data("store") != 'no') {
$key.val(settings[key]).change(function () {
onChange();
}).keyup(function () {
onChange();
});
}
$key.val(settings[key]).change(function () {
onChange();
}).keyup(function () {
onChange();
});
}


Expand Down Expand Up @@ -248,10 +247,10 @@

// wenn device selection changed.
$('#devices').change(function () {
let tmp = JSON.parse($(this).val());
let tmp = JSON.parse($(this).val() || {});
console.log("changed....devices" + $(this).val())
setValue('token', tmp.token, onChange);
setValue('ip', tmp.localip, onChange);
setValue('token', tmp.token || '', onChange);
setValue('ip', tmp.localip || '', onChange);
});

$('#getDevices').on('click', function () {
Expand All @@ -268,7 +267,7 @@
let pass = $('#password').val();
let user = $('#email').val();
let server = $('#server').val();
console.log("send to..." + user + " server: " + server);
//console.log("send to..." + user + " server: " + server);

if (typeof (server) == 'undefinded' || server == '') {
$getDevices.removeClass('disabled');
Expand All @@ -283,7 +282,7 @@
server: server
}, function (result) {

console.log(JSON.stringify(result));
//console.log(JSON.stringify(result));
$getDevices.removeClass('disabled');
$('#loader1').addClass('seenot');

Expand All @@ -300,7 +299,7 @@
rawdevices = arr;
let text = "";

setValue('MiDevice', JSON.stringify(arr), onChange);
setValue('MiDevice', JSON.stringify(arr));

arr.forEach(function (entry) {
text += "<option value='" + JSON.stringify(entry) + "' >" + entry
Expand All @@ -309,7 +308,7 @@

//check if in config
});
$devicelist.html(text).select();
$devicelist.html('<option>' + _('choose Device') + '</option>' + text).select();
});

});
Expand Down Expand Up @@ -449,19 +448,11 @@
function setValue(key, value, onChange) {
var $key = $('#' + key + '.value');
if ($key.attr('type') === 'checkbox') {
$key.prop('checked', value).on('change', function () {
onChange();
});
$key.prop('checked', value);
} else {
$key.val(value).on('change', function () {
if ($(this).attr('id') === 'type') {
showHideSettings();
}
onChange();
}).on('keyup', function () {
onChange();
});
$key.val(value);
}
$key.trigger('change')
}

function save(callback) {
Expand Down Expand Up @@ -500,6 +491,8 @@
return showMessage(_('same start time of 2 timer not possible'));
timerList[name] = timer
}
delete obj.devices;
delete obj.MiDevice

socket.emit('getForeignStates', namespace + 'timer.*', function (err, timerStates) {
if (!err && timerStates) {
Expand Down Expand Up @@ -630,7 +623,7 @@
</head>

<body>
<div class="m adapter-container">
<form class="m adapter-container">

<div class="row">
<!-- Tabs navigation -->
Expand Down Expand Up @@ -703,7 +696,7 @@ <h6 class="title translate" data-lang="Xiaomi cloud login">Cloud login</h6>
</div>
<div class="row">
<div class="col s12 m12 l12 input-field">
<select class="value " id="devices">
<select class="value " id="devices" data-store="no">
<option value="" disabled selected class="translate">Please get Devices first</option>
</select>
<label class="translate" for="devices">devices</label>
Expand All @@ -721,7 +714,7 @@ <h6 class="title translate" data-lang="manuell settings">manuell settings</h6>
</div>
</div>
<div class="col s12 m4 l2 input-field hidden">
<input class="value" id="MiDevice" type="text" />
<input class="value" id="MiDevice" type="text" data-store="no" />
<label class="translate" for="MiDevice">device</label>
</div>
<div class="row">
Expand Down Expand Up @@ -894,7 +887,7 @@ <h6 class="col s12 translate">add timer and choose room channels directly and/or
</div>
</div>
</div>
</div>
</form>
</body>

</html>
Loading

0 comments on commit 1434766

Please sign in to comment.