Spaces:
Sleeping
Sleeping
Update nutri_call.html
Browse files- nutri_call.html +45 -45
nutri_call.html
CHANGED
@@ -4,7 +4,52 @@
|
|
4 |
|
5 |
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
|
10 |
<meta charset="UTF-8">
|
@@ -696,52 +741,7 @@ function data_out(response) {
|
|
696 |
|
697 |
|
698 |
|
699 |
-
<!-- Основные стили -->
|
700 |
-
<link href="https://cdn.jsdelivr.net/npm/@pnotify/core@5.2.0/dist/PNotify.css" rel="stylesheet">
|
701 |
-
<!-- Мобильная поддержка -->
|
702 |
-
<link href="https://cdn.jsdelivr.net/npm/@pnotify/mobile@5.2.0/dist/PNotifyMobile.css" rel="stylesheet">
|
703 |
-
<!-- Тема -->
|
704 |
-
<link href="https://cdn.jsdelivr.net/npm/@pnotify/core@5.2.0/dist/BrightTheme.css" rel="stylesheet">
|
705 |
|
706 |
-
<!-- Скрипты -->
|
707 |
-
<script type="module">
|
708 |
-
import { alert, defaultModules } from 'https://cdn.jsdelivr.net/npm/@pnotify/core@5.2.0/dist/PNotify.js';
|
709 |
-
import * as PNotifyMobile from 'https://cdn.jsdelivr.net/npm/@pnotify/mobile@5.2.0/dist/PNotifyMobile.js';
|
710 |
-
|
711 |
-
// Инициализация мобильного модуля
|
712 |
-
defaultModules.set(PNotifyMobile, {});
|
713 |
-
|
714 |
-
// Теперь функция showCalculationStatus будет доступна глобально
|
715 |
-
window.showCalculationStatus = function(response) {
|
716 |
-
if (Object.keys(response.deficits || {}).length === 0) {
|
717 |
-
alert({
|
718 |
-
title: 'Успешный расчёт',
|
719 |
-
text: 'Все элементы сбалансированы!',
|
720 |
-
type: 'success',
|
721 |
-
delay: 3000,
|
722 |
-
modules: {
|
723 |
-
Mobile: {
|
724 |
-
swipeDismiss: true
|
725 |
-
}
|
726 |
-
}
|
727 |
-
});
|
728 |
-
} else {
|
729 |
-
alert({
|
730 |
-
title: 'Обнаружены отклонения',
|
731 |
-
text: 'Дефициты: ' + Object.entries(response.deficits)
|
732 |
-
.map(([el, val]) => `${el}: ${val.toFixed(2)}ppm`)
|
733 |
-
.join(', '),
|
734 |
-
type: 'error',
|
735 |
-
delay: 5000,
|
736 |
-
modules: {
|
737 |
-
Mobile: {
|
738 |
-
swipeDismiss: true
|
739 |
-
}
|
740 |
-
}
|
741 |
-
});
|
742 |
-
}
|
743 |
-
};
|
744 |
-
</script>
|
745 |
|
746 |
<button id="testNotify">Тест уведомлений</button>
|
747 |
|
|
|
4 |
|
5 |
|
6 |
|
7 |
+
<!-- Основные стили -->
|
8 |
+
<link href="https://cdn.jsdelivr.net/npm/@pnotify/core@5.2.0/dist/PNotify.css" rel="stylesheet">
|
9 |
+
<!-- Мобильная поддержка -->
|
10 |
+
<link href="https://cdn.jsdelivr.net/npm/@pnotify/mobile@5.2.0/dist/PNotifyMobile.css" rel="stylesheet">
|
11 |
+
<!-- Тема -->
|
12 |
+
<link href="https://cdn.jsdelivr.net/npm/@pnotify/core@5.2.0/dist/BrightTheme.css" rel="stylesheet">
|
13 |
|
14 |
+
<!-- Скрипты -->
|
15 |
+
<script type="module">
|
16 |
+
import { alert, defaultModules } from 'https://cdn.jsdelivr.net/npm/@pnotify/core@5.2.0/dist/PNotify.js';
|
17 |
+
import * as PNotifyMobile from 'https://cdn.jsdelivr.net/npm/@pnotify/mobile@5.2.0/dist/PNotifyMobile.js';
|
18 |
+
|
19 |
+
// Инициализация мобильного модуля
|
20 |
+
defaultModules.set(PNotifyMobile, {});
|
21 |
+
|
22 |
+
// Теперь функция showCalculationStatus будет доступна глобально
|
23 |
+
window.showCalculationStatus = function(response) {
|
24 |
+
if (Object.keys(response.deficits || {}).length === 0) {
|
25 |
+
alert({
|
26 |
+
title: 'Успешный расчёт',
|
27 |
+
text: 'Все элементы сбалансированы!',
|
28 |
+
type: 'success',
|
29 |
+
delay: 3000,
|
30 |
+
modules: {
|
31 |
+
Mobile: {
|
32 |
+
swipeDismiss: true
|
33 |
+
}
|
34 |
+
}
|
35 |
+
});
|
36 |
+
} else {
|
37 |
+
alert({
|
38 |
+
title: 'Обнаружены отклонения',
|
39 |
+
text: 'Дефициты: ' + Object.entries(response.deficits)
|
40 |
+
.map(([el, val]) => `${el}: ${val.toFixed(2)}ppm`)
|
41 |
+
.join(', '),
|
42 |
+
type: 'error',
|
43 |
+
delay: 5000,
|
44 |
+
modules: {
|
45 |
+
Mobile: {
|
46 |
+
swipeDismiss: true
|
47 |
+
}
|
48 |
+
}
|
49 |
+
});
|
50 |
+
}
|
51 |
+
};
|
52 |
+
</script>
|
53 |
|
54 |
|
55 |
<meta charset="UTF-8">
|
|
|
741 |
|
742 |
|
743 |
|
|
|
|
|
|
|
|
|
|
|
|
|
744 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
745 |
|
746 |
<button id="testNotify">Тест уведомлений</button>
|
747 |
|