DmitrMakeev commited on
Commit
ccca6fd
·
verified ·
1 Parent(s): 5bb687b

Update nutri_call.html

Browse files
Files changed (1) hide show
  1. nutri_call.html +45 -45
nutri_call.html CHANGED
@@ -1,52 +1,7 @@
1
  <!DOCTYPE html>
2
  <html lang="ru">
3
  <head>
4
- <!-- Основные стили -->
5
- <link href="https://cdn.jsdelivr.net/npm/@pnotify/core@5.2.0/dist/PNotify.css" rel="stylesheet">
6
- <!-- Мобильная поддержка -->
7
- <link href="https://cdn.jsdelivr.net/npm/@pnotify/mobile@5.2.0/dist/PNotifyMobile.css" rel="stylesheet">
8
- <!-- Тема -->
9
- <link href="https://cdn.jsdelivr.net/npm/@pnotify/core@5.2.0/dist/BrightTheme.css" rel="stylesheet">
10
 
11
- <!-- Скрипты -->
12
- <script type="module">
13
- import { alert, defaultModules } from 'https://cdn.jsdelivr.net/npm/@pnotify/core@5.2.0/dist/PNotify.js';
14
- import * as PNotifyMobile from 'https://cdn.jsdelivr.net/npm/@pnotify/mobile@5.2.0/dist/PNotifyMobile.js';
15
-
16
- // Инициализация мобильного модуля
17
- defaultModules.set(PNotifyMobile, {});
18
-
19
- // Теперь функция showCalculationStatus будет доступна глобально
20
- window.showCalculationStatus = function(response) {
21
- if (Object.keys(response.deficits || {}).length === 0) {
22
- alert({
23
- title: 'Успешный расчёт',
24
- text: 'Все элементы сбалансированы!',
25
- type: 'success',
26
- delay: 3000,
27
- modules: {
28
- Mobile: {
29
- swipeDismiss: true
30
- }
31
- }
32
- });
33
- } else {
34
- alert({
35
- title: 'Обнаружены отклонения',
36
- text: 'Дефициты: ' + Object.entries(response.deficits)
37
- .map(([el, val]) => `${el}: ${val.toFixed(2)}ppm`)
38
- .join(', '),
39
- type: 'error',
40
- delay: 5000,
41
- modules: {
42
- Mobile: {
43
- swipeDismiss: true
44
- }
45
- }
46
- });
47
- }
48
- };
49
- </script>
50
 
51
 
52
 
@@ -737,11 +692,56 @@ function data_out(response) {
737
 
738
 
739
 
 
740
 
741
 
742
 
 
 
 
 
 
 
743
 
 
 
 
 
744
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
745
 
746
  <button id="testNotify">Тест уведомлений</button>
747
 
 
1
  <!DOCTYPE html>
2
  <html lang="ru">
3
  <head>
 
 
 
 
 
 
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
 
7
 
 
692
 
693
 
694
 
695
+ </script>
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