create-basicjs 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/create-basicjs.js +2 -2
- package/bin/verify-package.js +16 -0
- package/package.json +4 -1
- package/payload/starter/AGENTS.md +84 -0
- package/payload/starter/CLAUDE.md +1 -0
- package/payload/starter/README.md +45 -0
- package/payload/starter/_basic/VERSION +1 -0
- package/payload/starter/_basic/assets/categories/cappuccino.png +0 -0
- package/payload/starter/_basic/assets/categories/chocolate-milk.png +0 -0
- package/payload/starter/_basic/assets/categories/coffee-cup.png +0 -0
- package/payload/starter/_basic/assets/categories/coffee.png +0 -0
- package/payload/starter/_basic/assets/categories/frappe.png +0 -0
- package/payload/starter/_basic/assets/categories/iced-caffee.png +0 -0
- package/payload/starter/_basic/assets/categories/milkshake.png +0 -0
- package/payload/starter/_basic/assets/categories/orange-juice.png +0 -0
- package/payload/starter/_basic/assets/categories/tea.png +0 -0
- package/payload/starter/_basic/assets/data-table/palette.svg +2 -0
- package/payload/starter/_basic/assets/data-table/people.js +104 -0
- package/payload/starter/_basic/assets/data-table/trash.svg +2 -0
- package/payload/starter/_basic/assets/fruids/brokoli.png +0 -0
- package/payload/starter/_basic/assets/fruids/cilek.png +0 -0
- package/payload/starter/_basic/assets/fruids/domates.png +0 -0
- package/payload/starter/_basic/assets/fruids/elma.png +0 -0
- package/payload/starter/_basic/assets/fruids/havuc.png +0 -0
- package/payload/starter/_basic/assets/fruids/karpuz.png +0 -0
- package/payload/starter/_basic/assets/fruids/limon.png +0 -0
- package/payload/starter/_basic/assets/fruids/muz.png +0 -0
- package/payload/starter/_basic/assets/fruids/nar.png +0 -0
- package/payload/starter/_basic/assets/fruids/patlican.png +0 -0
- package/payload/starter/_basic/assets/fruids/yabanmersini.png +0 -0
- package/payload/starter/_basic/assets/fruids/yesilbiber.png +0 -0
- package/payload/starter/_basic/assets/icons/alert-black.png +0 -0
- package/payload/starter/_basic/assets/icons/alert.png +0 -0
- package/payload/starter/_basic/assets/icons/arrow-drop.svg +3 -0
- package/payload/starter/_basic/assets/icons/arrow-rise.svg +3 -0
- package/payload/starter/_basic/assets/icons/close.svg +1 -0
- package/payload/starter/_basic/assets/icons/lamp-on.png +0 -0
- package/payload/starter/_basic/assets/icons/lamp.png +0 -0
- package/payload/starter/_basic/assets/icons/lock.png +0 -0
- package/payload/starter/_basic/assets/icons/panel.png +0 -0
- package/payload/starter/_basic/assets/icons/plant.png +0 -0
- package/payload/starter/_basic/assets/icons/trash.png +0 -0
- package/payload/starter/_basic/assets/icons/trash.svg +2 -0
- package/payload/starter/_basic/assets/tab-bar/settings.png +0 -0
- package/payload/starter/_basic/assets/tab-bar/status.png +0 -0
- package/payload/starter/_basic/assets/tab-bar/transactions.png +0 -0
- package/payload/starter/_basic/assets/tutorial/blueberries.png +0 -0
- package/payload/starter/_basic/assets/tutorial/carrot.png +0 -0
- package/payload/starter/_basic/assets/tutorial/olives.png +0 -0
- package/payload/starter/_basic/assets/tutorial/strawberry.png +0 -0
- package/payload/starter/_basic/assets/ui-bottom-bar/setting.svg +11 -0
- package/payload/starter/_basic/basic/LICENSE +14 -0
- package/payload/starter/_basic/basic/basic.css +277 -0
- package/payload/starter/_basic/basic/basic.js +3767 -0
- package/payload/starter/_basic/basic/basic.min.css +1 -0
- package/payload/starter/_basic/basic/basic.min.js +65 -0
- package/payload/starter/_basic/basic/font/open-sans/LICENSE.txt +206 -0
- package/payload/starter/_basic/basic/font/open-sans/OpenSans-Bold.ttf +0 -0
- package/payload/starter/_basic/basic/font/open-sans/OpenSans-Regular.ttf +0 -0
- package/payload/starter/_basic/basic/scroll-bar.js +536 -0
- package/payload/starter/_basic/basic/scroll-bar.min.js +2 -0
- package/payload/starter/_basic/comp/action-button/add.png +0 -0
- package/payload/starter/_basic/comp/action-button.js +522 -0
- package/payload/starter/_basic/comp/action-tab-bar.js +383 -0
- package/payload/starter/_basic/comp/app-bar.js +236 -0
- package/payload/starter/_basic/comp/badge-v2.js +246 -0
- package/payload/starter/_basic/comp/bottom-bar.js +547 -0
- package/payload/starter/_basic/comp/breadcrumbs.js +522 -0
- package/payload/starter/_basic/comp/chart-box/chart-4.5.1.umd.min.js +13 -0
- package/payload/starter/_basic/comp/chart-box/chart-js-LICENSE.md +9 -0
- package/payload/starter/_basic/comp/chart-box.js +868 -0
- package/payload/starter/_basic/comp/check-box.js +374 -0
- package/payload/starter/_basic/comp/context-menu.js +634 -0
- package/payload/starter/_basic/comp/currency-input-b.js +190 -0
- package/payload/starter/_basic/comp/data-table/arrow.svg +2 -0
- package/payload/starter/_basic/comp/data-table.js +865 -0
- package/payload/starter/_basic/comp/dialog.js +854 -0
- package/payload/starter/_basic/comp/email-input-b.js +57 -0
- package/payload/starter/_basic/comp/filters.js +493 -0
- package/payload/starter/_basic/comp/form.js +590 -0
- package/payload/starter/_basic/comp/full-screen-select/arrow.svg +2 -0
- package/payload/starter/_basic/comp/full-screen-select/cancel.svg +2 -0
- package/payload/starter/_basic/comp/full-screen-select.js +611 -0
- package/payload/starter/_basic/comp/gauge.js +435 -0
- package/payload/starter/_basic/comp/hold-to-confirm-button/trash-red.png +0 -0
- package/payload/starter/_basic/comp/hold-to-confirm-button/trash.png +0 -0
- package/payload/starter/_basic/comp/hold-to-confirm-button.js +280 -0
- package/payload/starter/_basic/comp/input-b.js +759 -0
- package/payload/starter/_basic/comp/item-list.js +1396 -0
- package/payload/starter/_basic/comp/label-editor.js +1137 -0
- package/payload/starter/_basic/comp/left-menu/_Material Symbols & Icons - Google Fonts.webloc +8 -0
- package/payload/starter/_basic/comp/left-menu/data-table.png +0 -0
- package/payload/starter/_basic/comp/left-menu/home.png +0 -0
- package/payload/starter/_basic/comp/left-menu/reports.png +0 -0
- package/payload/starter/_basic/comp/left-menu/setting.png +0 -0
- package/payload/starter/_basic/comp/left-menu.js +476 -0
- package/payload/starter/_basic/comp/line-progress-bar.js +192 -0
- package/payload/starter/_basic/comp/loading-screen.js +382 -0
- package/payload/starter/_basic/comp/login-page-v2.js +586 -0
- package/payload/starter/_basic/comp/mini-graph-box.js +483 -0
- package/payload/starter/_basic/comp/notice.js +227 -0
- package/payload/starter/_basic/comp/number-input-b.js +121 -0
- package/payload/starter/_basic/comp/numeric-keyboard.js +296 -0
- package/payload/starter/_basic/comp/page-control.js +745 -0
- package/payload/starter/_basic/comp/page-header.js +190 -0
- package/payload/starter/_basic/comp/password-input-b/hide-btn.png +0 -0
- package/payload/starter/_basic/comp/password-input-b/hide-btn2.png +0 -0
- package/payload/starter/_basic/comp/password-input-b/show-btn.png +0 -0
- package/payload/starter/_basic/comp/password-input-b/show-btn2.png +0 -0
- package/payload/starter/_basic/comp/password-input-b.js +164 -0
- package/payload/starter/_basic/comp/period-bar.js +435 -0
- package/payload/starter/_basic/comp/phone-input-b.js +287 -0
- package/payload/starter/_basic/comp/progress-bar.js +676 -0
- package/payload/starter/_basic/comp/property-panel.js +2740 -0
- package/payload/starter/_basic/comp/radio-button.js +467 -0
- package/payload/starter/_basic/comp/rich-text-editor.js +1061 -0
- package/payload/starter/_basic/comp/scrolling-text.js +296 -0
- package/payload/starter/_basic/comp/search-input-v2/clear-round.svg +1 -0
- package/payload/starter/_basic/comp/search-input-v2/clear.svg +1 -0
- package/payload/starter/_basic/comp/search-input-v2/filter.png +0 -0
- package/payload/starter/_basic/comp/search-input-v2/filter.svg +1 -0
- package/payload/starter/_basic/comp/search-input-v2/search.svg +1 -0
- package/payload/starter/_basic/comp/search-input-v2.js +427 -0
- package/payload/starter/_basic/comp/search-results.js +560 -0
- package/payload/starter/_basic/comp/select-box.js +1740 -0
- package/payload/starter/_basic/comp/select-color.js +603 -0
- package/payload/starter/_basic/comp/select-date.js +1003 -0
- package/payload/starter/_basic/comp/select-file.js +732 -0
- package/payload/starter/_basic/comp/select-time.js +979 -0
- package/payload/starter/_basic/comp/settings-row.js +298 -0
- package/payload/starter/_basic/comp/side-panel.js +573 -0
- package/payload/starter/_basic/comp/slider-field.js +776 -0
- package/payload/starter/_basic/comp/slider.js +368 -0
- package/payload/starter/_basic/comp/smart-button/alert-black.png +0 -0
- package/payload/starter/_basic/comp/smart-button/clock.png +0 -0
- package/payload/starter/_basic/comp/smart-button.js +896 -0
- package/payload/starter/_basic/comp/smart-table/clock.png +0 -0
- package/payload/starter/_basic/comp/smart-table/down.png +0 -0
- package/payload/starter/_basic/comp/smart-table/scroll.png +0 -0
- package/payload/starter/_basic/comp/smart-table/sort.png +0 -0
- package/payload/starter/_basic/comp/smart-table/up.png +0 -0
- package/payload/starter/_basic/comp/smart-table.js +1321 -0
- package/payload/starter/_basic/comp/sortable-list.js +1172 -0
- package/payload/starter/_basic/comp/spark-line-box.js +729 -0
- package/payload/starter/_basic/comp/stepper.js +699 -0
- package/payload/starter/_basic/comp/tabs.js +1317 -0
- package/payload/starter/_basic/comp/tag-input.js +1067 -0
- package/payload/starter/_basic/comp/tap-effect.js +168 -0
- package/payload/starter/_basic/comp/textarea-b.js +184 -0
- package/payload/starter/_basic/comp/time-line.js +324 -0
- package/payload/starter/_basic/comp/tiny-select/arrow.svg +1 -0
- package/payload/starter/_basic/comp/tiny-select.js +282 -0
- package/payload/starter/_basic/comp/tiny-table.js +279 -0
- package/payload/starter/_basic/comp/toast.js +838 -0
- package/payload/starter/_basic/comp/toggle.js +636 -0
- package/payload/starter/_basic/comp/tooltip.js +471 -0
- package/payload/starter/_basic/comp/tree-view.js +1096 -0
- package/payload/starter/_basic/comp/ui-effects.js +1091 -0
- package/payload/starter/_basic/comp/ui-standards.js +402 -0
- package/payload/starter/_basic/comp/url-input-b.js +145 -0
- package/payload/starter/_basic/comp/web-view.js +534 -0
- package/payload/starter/_basic/docs/basic-js-animated-rules.md +90 -0
- package/payload/starter/_basic/docs/basic-js-code-rules.md +91 -0
- package/payload/starter/_basic/docs/basic-js-components.md +134 -0
- package/payload/starter/_basic/docs/basic-js-core.md +131 -0
- package/payload/starter/_basic/docs/component-index.md +522 -0
- package/payload/starter/_basic/docs/component-template.js +416 -0
- package/payload/starter/_basic/docs/handbook/00-introduction.md +125 -0
- package/payload/starter/_basic/docs/handbook/00-what-is-new.md +96 -0
- package/payload/starter/_basic/docs/handbook/01-label.md +104 -0
- package/payload/starter/_basic/docs/handbook/02-box.md +166 -0
- package/payload/starter/_basic/docs/handbook/03-image.md +81 -0
- package/payload/starter/_basic/docs/handbook/04-common-properties.md +159 -0
- package/payload/starter/_basic/docs/handbook/05-autolayout.md +332 -0
- package/payload/starter/_basic/docs/handbook/06-button.md +103 -0
- package/payload/starter/_basic/docs/handbook/07-input.md +78 -0
- package/payload/starter/_basic/docs/handbook/08-page.md +120 -0
- package/payload/starter/_basic/docs/handbook/09-useful-examples.md +309 -0
- package/payload/starter/_basic/docs/handbook/10-motion.md +132 -0
- package/payload/starter/_basic/docs/handbook/11-other-functions.md +92 -0
- package/payload/starter/_basic/docs/handbook/12-utilities.md +123 -0
- package/payload/starter/_basic/docs/handbook/13-sound.md +88 -0
- package/payload/starter/_basic/docs/what-is-new.md +402 -0
- package/payload/starter/_basic/examples/action-button.htm +81 -0
- package/payload/starter/_basic/examples/action-tab-bar.htm +97 -0
- package/payload/starter/_basic/examples/app-bar.htm +140 -0
- package/payload/starter/_basic/examples/badgeV2.htm +68 -0
- package/payload/starter/_basic/examples/bottom-bar/grid.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/grids.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/home.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/homes.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon1.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon1s.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon2.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon2s.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon3.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon3s.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon4.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon4s.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/search.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/searchs.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/settings.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/settingss.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/tasks.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/taskss.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar-2.htm +187 -0
- package/payload/starter/_basic/examples/bottom-bar.htm +46 -0
- package/payload/starter/_basic/examples/breadcrumbs.htm +284 -0
- package/payload/starter/_basic/examples/chart-box.htm +287 -0
- package/payload/starter/_basic/examples/check-box-1.htm +220 -0
- package/payload/starter/_basic/examples/check-box-2.htm +212 -0
- package/payload/starter/_basic/examples/check-box-3.htm +179 -0
- package/payload/starter/_basic/examples/context-menu.htm +269 -0
- package/payload/starter/_basic/examples/currency-input-b.htm +71 -0
- package/payload/starter/_basic/examples/data-table-2.htm +67 -0
- package/payload/starter/_basic/examples/data-table-3.htm +72 -0
- package/payload/starter/_basic/examples/data-table-4.htm +144 -0
- package/payload/starter/_basic/examples/data-table-5.htm +152 -0
- package/payload/starter/_basic/examples/data-table.htm +178 -0
- package/payload/starter/_basic/examples/dialog-centered.htm +130 -0
- package/payload/starter/_basic/examples/dialog.htm +209 -0
- package/payload/starter/_basic/examples/email-input-b.htm +67 -0
- package/payload/starter/_basic/examples/filters.htm +115 -0
- package/payload/starter/_basic/examples/form-1.htm +123 -0
- package/payload/starter/_basic/examples/full-screen-select.htm +114 -0
- package/payload/starter/_basic/examples/gauge.htm +133 -0
- package/payload/starter/_basic/examples/hold-to-confirm-button.htm +144 -0
- package/payload/starter/_basic/examples/input-b-ex1.htm +132 -0
- package/payload/starter/_basic/examples/input-b-ex2.htm +136 -0
- package/payload/starter/_basic/examples/input-b-ex3-style.htm +113 -0
- package/payload/starter/_basic/examples/input-b-ex4-custom-unit.htm +112 -0
- package/payload/starter/_basic/examples/input-b-ex5-warning-icon.htm +80 -0
- package/payload/starter/_basic/examples/input-b-ex6-dark.htm +108 -0
- package/payload/starter/_basic/examples/input-b-ex7-ozden.htm +153 -0
- package/payload/starter/_basic/examples/item-list-2.htm +253 -0
- package/payload/starter/_basic/examples/item-list.htm +176 -0
- package/payload/starter/_basic/examples/label-editor.htm +196 -0
- package/payload/starter/_basic/examples/left-menu.htm +81 -0
- package/payload/starter/_basic/examples/line-progress-bar.htm +145 -0
- package/payload/starter/_basic/examples/loading-screen.htm +217 -0
- package/payload/starter/_basic/examples/login-page-dark-v2.htm +269 -0
- package/payload/starter/_basic/examples/login-page-v2.htm +269 -0
- package/payload/starter/_basic/examples/mini-graph-box.htm +229 -0
- package/payload/starter/_basic/examples/notice.htm +79 -0
- package/payload/starter/_basic/examples/number-input-b.htm +68 -0
- package/payload/starter/_basic/examples/numeric-keyboard.htm +100 -0
- package/payload/starter/_basic/examples/page-control.htm +262 -0
- package/payload/starter/_basic/examples/page-header.htm +117 -0
- package/payload/starter/_basic/examples/password-input-b.htm +70 -0
- package/payload/starter/_basic/examples/period-bar.htm +94 -0
- package/payload/starter/_basic/examples/phone-input-b-select-country.htm +298 -0
- package/payload/starter/_basic/examples/phone-input-b.htm +72 -0
- package/payload/starter/_basic/examples/progress-bar-ozden.htm +168 -0
- package/payload/starter/_basic/examples/progress-bar.htm +296 -0
- package/payload/starter/_basic/examples/property-panel.htm +216 -0
- package/payload/starter/_basic/examples/radio-button-1.htm +264 -0
- package/payload/starter/_basic/examples/radio-button-2.htm +256 -0
- package/payload/starter/_basic/examples/radio-button-3.htm +168 -0
- package/payload/starter/_basic/examples/rich-text-editor.htm +228 -0
- package/payload/starter/_basic/examples/scrolling-text.htm +75 -0
- package/payload/starter/_basic/examples/search-input-v2-ozden.htm +128 -0
- package/payload/starter/_basic/examples/search-input-v2-place.htm +80 -0
- package/payload/starter/_basic/examples/search-input-v2.htm +65 -0
- package/payload/starter/_basic/examples/search-results.htm +193 -0
- package/payload/starter/_basic/examples/select-box-ozden-item.htm +114 -0
- package/payload/starter/_basic/examples/select-box-ozden-text.htm +64 -0
- package/payload/starter/_basic/examples/select-box.htm +254 -0
- package/payload/starter/_basic/examples/select-color.htm +215 -0
- package/payload/starter/_basic/examples/select-date.htm +244 -0
- package/payload/starter/_basic/examples/select-file.htm +268 -0
- package/payload/starter/_basic/examples/select-time.htm +249 -0
- package/payload/starter/_basic/examples/settings-row.htm +193 -0
- package/payload/starter/_basic/examples/side-panel-2.htm +270 -0
- package/payload/starter/_basic/examples/side-panel.htm +219 -0
- package/payload/starter/_basic/examples/slider-field.htm +223 -0
- package/payload/starter/_basic/examples/slider.htm +180 -0
- package/payload/starter/_basic/examples/smart-button-2.htm +220 -0
- package/payload/starter/_basic/examples/smart-button-3-ozden.htm +320 -0
- package/payload/starter/_basic/examples/smart-button-4-dark.htm +102 -0
- package/payload/starter/_basic/examples/smart-button-5-features.htm +205 -0
- package/payload/starter/_basic/examples/smart-button.htm +252 -0
- package/payload/starter/_basic/examples/smart-table-1.htm +142 -0
- package/payload/starter/_basic/examples/smart-table-2.htm +191 -0
- package/payload/starter/_basic/examples/smart-table-3.htm +359 -0
- package/payload/starter/_basic/examples/smart-table-4.htm +158 -0
- package/payload/starter/_basic/examples/sortable-list.htm +250 -0
- package/payload/starter/_basic/examples/spark-line-box.htm +285 -0
- package/payload/starter/_basic/examples/stepper-2.htm +172 -0
- package/payload/starter/_basic/examples/stepper.htm +255 -0
- package/payload/starter/_basic/examples/tabs-2/coffee.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i1-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i1.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i2-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i2.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i3-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i3.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i4-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i4.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i5-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i5.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/lamp-on.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/lamp.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/search.svg +2 -0
- package/payload/starter/_basic/examples/tabs-2.htm +188 -0
- package/payload/starter/_basic/examples/tabs.htm +300 -0
- package/payload/starter/_basic/examples/tag-input.htm +242 -0
- package/payload/starter/_basic/examples/tap-effect.htm +100 -0
- package/payload/starter/_basic/examples/textarea-b.htm +76 -0
- package/payload/starter/_basic/examples/time-line.htm +226 -0
- package/payload/starter/_basic/examples/tiny-select.htm +86 -0
- package/payload/starter/_basic/examples/tiny-table.htm +109 -0
- package/payload/starter/_basic/examples/toast.htm +262 -0
- package/payload/starter/_basic/examples/toggle-2.htm +163 -0
- package/payload/starter/_basic/examples/toggle-3.htm +218 -0
- package/payload/starter/_basic/examples/toggle.htm +93 -0
- package/payload/starter/_basic/examples/tooltip-2.htm +177 -0
- package/payload/starter/_basic/examples/tooltip-3.htm +212 -0
- package/payload/starter/_basic/examples/tooltip.htm +124 -0
- package/payload/starter/_basic/examples/tree-view.htm +285 -0
- package/payload/starter/_basic/examples/ui-effects.htm +463 -0
- package/payload/starter/_basic/examples/ui-standards.htm +261 -0
- package/payload/starter/_basic/examples/unfinished-login-page-dark-supabase.htm +221 -0
- package/payload/starter/_basic/examples/unfinished-login-page-supabase.htm +221 -0
- package/payload/starter/_basic/examples/url-input-b.htm +85 -0
- package/payload/starter/_basic/examples/web-view.htm +241 -0
- package/payload/starter/_basic/min/action-button.min.js +2 -0
- package/payload/starter/_basic/min/action-tab-bar.min.js +2 -0
- package/payload/starter/_basic/min/app-bar.min.js +2 -0
- package/payload/starter/_basic/min/badge-v2.min.js +2 -0
- package/payload/starter/_basic/min/bottom-bar.min.js +2 -0
- package/payload/starter/_basic/min/breadcrumbs.min.js +2 -0
- package/payload/starter/_basic/min/chart-box.min.js +2 -0
- package/payload/starter/_basic/min/check-box.min.js +2 -0
- package/payload/starter/_basic/min/context-menu.min.js +2 -0
- package/payload/starter/_basic/min/currency-input-b.min.js +2 -0
- package/payload/starter/_basic/min/data-table.min.js +2 -0
- package/payload/starter/_basic/min/dialog.min.js +2 -0
- package/payload/starter/_basic/min/email-input-b.min.js +2 -0
- package/payload/starter/_basic/min/filters.min.js +2 -0
- package/payload/starter/_basic/min/form.min.js +2 -0
- package/payload/starter/_basic/min/full-screen-select.min.js +2 -0
- package/payload/starter/_basic/min/gauge.min.js +2 -0
- package/payload/starter/_basic/min/hold-to-confirm-button.min.js +2 -0
- package/payload/starter/_basic/min/input-b.min.js +2 -0
- package/payload/starter/_basic/min/item-list.min.js +2 -0
- package/payload/starter/_basic/min/label-editor.min.js +2 -0
- package/payload/starter/_basic/min/left-menu.min.js +2 -0
- package/payload/starter/_basic/min/line-progress-bar.min.js +2 -0
- package/payload/starter/_basic/min/loading-screen.min.js +2 -0
- package/payload/starter/_basic/min/login-page-v2.min.js +2 -0
- package/payload/starter/_basic/min/mini-graph-box.min.js +2 -0
- package/payload/starter/_basic/min/notice.min.js +2 -0
- package/payload/starter/_basic/min/number-input-b.min.js +2 -0
- package/payload/starter/_basic/min/numeric-keyboard.min.js +2 -0
- package/payload/starter/_basic/min/page-control.min.js +2 -0
- package/payload/starter/_basic/min/page-header.min.js +2 -0
- package/payload/starter/_basic/min/password-input-b.min.js +2 -0
- package/payload/starter/_basic/min/period-bar.min.js +2 -0
- package/payload/starter/_basic/min/phone-input-b.min.js +2 -0
- package/payload/starter/_basic/min/progress-bar.min.js +2 -0
- package/payload/starter/_basic/min/property-panel.min.js +2 -0
- package/payload/starter/_basic/min/radio-button.min.js +2 -0
- package/payload/starter/_basic/min/rich-text-editor.min.js +2 -0
- package/payload/starter/_basic/min/scrolling-text.min.js +2 -0
- package/payload/starter/_basic/min/search-input-v2.min.js +2 -0
- package/payload/starter/_basic/min/search-results.min.js +2 -0
- package/payload/starter/_basic/min/select-box.min.js +2 -0
- package/payload/starter/_basic/min/select-color.min.js +2 -0
- package/payload/starter/_basic/min/select-date.min.js +2 -0
- package/payload/starter/_basic/min/select-file.min.js +2 -0
- package/payload/starter/_basic/min/select-time.min.js +2 -0
- package/payload/starter/_basic/min/settings-row.min.js +2 -0
- package/payload/starter/_basic/min/side-panel.min.js +2 -0
- package/payload/starter/_basic/min/slider-field.min.js +2 -0
- package/payload/starter/_basic/min/slider.min.js +2 -0
- package/payload/starter/_basic/min/smart-button.min.js +2 -0
- package/payload/starter/_basic/min/smart-table.min.js +2 -0
- package/payload/starter/_basic/min/sortable-list.min.js +2 -0
- package/payload/starter/_basic/min/spark-line-box.min.js +2 -0
- package/payload/starter/_basic/min/stepper.min.js +2 -0
- package/payload/starter/_basic/min/tabs.min.js +2 -0
- package/payload/starter/_basic/min/tag-input.min.js +2 -0
- package/payload/starter/_basic/min/tap-effect.min.js +2 -0
- package/payload/starter/_basic/min/textarea-b.min.js +2 -0
- package/payload/starter/_basic/min/time-line.min.js +2 -0
- package/payload/starter/_basic/min/tiny-select.min.js +2 -0
- package/payload/starter/_basic/min/tiny-table.min.js +2 -0
- package/payload/starter/_basic/min/toast.min.js +2 -0
- package/payload/starter/_basic/min/toggle.min.js +2 -0
- package/payload/starter/_basic/min/tooltip.min.js +2 -0
- package/payload/starter/_basic/min/tree-view.min.js +2 -0
- package/payload/starter/_basic/min/ui-effects.min.js +2 -0
- package/payload/starter/_basic/min/ui-standards.min.js +2 -0
- package/payload/starter/_basic/min/url-input-b.min.js +2 -0
- package/payload/starter/_basic/min/web-view.min.js +2 -0
- package/payload/starter/_basic/tools/build.js +175 -0
- package/payload/starter/_basic/tools/check.js +336 -0
- package/payload/starter/app/app.js +27 -0
- package/payload/starter/assets/.gitkeep +0 -0
- package/payload/starter/gitignore +3 -0
- package/payload/starter/index.htm +23 -0
- package/payload/templates/booking/TEMPLATE.md +77 -0
- package/payload/templates/booking/app/app.js +722 -0
- package/payload/templates/booking/app/settings.js +52 -0
- package/payload/templates/booking/app/store.js +265 -0
- package/payload/templates/booking/app/texts.js +148 -0
- package/payload/templates/booking/assets/app-icon.svg +1 -0
- package/payload/templates/booking/assets/tabs/account.svg +1 -0
- package/payload/templates/booking/assets/tabs/appointments.svg +1 -0
- package/payload/templates/booking/assets/tabs/home.svg +1 -0
- package/payload/templates/booking/assets/tabs/services.svg +1 -0
- package/payload/templates/booking/components/booking-ui.js +252 -0
- package/payload/templates/booking/index.htm +53 -0
- package/payload/templates/booking/pages/account.js +124 -0
- package/payload/templates/booking/pages/appointments.js +141 -0
- package/payload/templates/booking/pages/book.js +231 -0
- package/payload/templates/booking/pages/home.js +99 -0
- package/payload/templates/booking/pages/services.js +79 -0
- package/payload/templates/classic/TEMPLATE.md +104 -0
- package/payload/templates/classic/app/app.js +779 -0
- package/payload/templates/classic/app/settings.js +77 -0
- package/payload/templates/classic/assets/_attribute.txt +37 -0
- package/payload/templates/classic/assets/cards/dill.png +0 -0
- package/payload/templates/classic/assets/cards/fennel.png +0 -0
- package/payload/templates/classic/assets/cards/juniper.png +0 -0
- package/payload/templates/classic/assets/cards/olives.png +0 -0
- package/payload/templates/classic/assets/cards/oregano.png +0 -0
- package/payload/templates/classic/assets/cards/pepper.png +0 -0
- package/payload/templates/classic/assets/cards/rosehip.png +0 -0
- package/payload/templates/classic/assets/categories/cappuccino.png +0 -0
- package/payload/templates/classic/assets/categories/chocolate-milk.png +0 -0
- package/payload/templates/classic/assets/categories/coffee-cup.png +0 -0
- package/payload/templates/classic/assets/categories/coffee.png +0 -0
- package/payload/templates/classic/assets/categories/frappe.png +0 -0
- package/payload/templates/classic/assets/categories/iced-caffee.png +0 -0
- package/payload/templates/classic/assets/categories/milkshake.png +0 -0
- package/payload/templates/classic/assets/categories/orange-juice.png +0 -0
- package/payload/templates/classic/assets/categories/tea.png +0 -0
- package/payload/templates/classic/assets/example-tabs/coffee.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i1-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i1.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i2-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i2.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i3-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i3.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i4-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i4.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i5-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i5.png +0 -0
- package/payload/templates/classic/assets/example-tabs/lamp-on.png +0 -0
- package/payload/templates/classic/assets/example-tabs/lamp.png +0 -0
- package/payload/templates/classic/assets/example-tabs/search.svg +2 -0
- package/payload/templates/classic/assets/files/ai.png +0 -0
- package/payload/templates/classic/assets/files/doc.png +0 -0
- package/payload/templates/classic/assets/files/folder.png +0 -0
- package/payload/templates/classic/assets/files/js.png +0 -0
- package/payload/templates/classic/assets/files/pdf.png +0 -0
- package/payload/templates/classic/assets/files/txt.png +0 -0
- package/payload/templates/classic/assets/files/xls.png +0 -0
- package/payload/templates/classic/assets/icons/arrow-drop.svg +3 -0
- package/payload/templates/classic/assets/icons/arrow-rise.svg +3 -0
- package/payload/templates/classic/assets/icons/download.svg +18 -0
- package/payload/templates/classic/assets/icons/lamp-on.png +0 -0
- package/payload/templates/classic/assets/icons/lamp.png +0 -0
- package/payload/templates/classic/assets/icons/lock-small.png +0 -0
- package/payload/templates/classic/assets/icons/lock.png +0 -0
- package/payload/templates/classic/assets/icons/logo.png +0 -0
- package/payload/templates/classic/assets/icons/trash-red.svg +2 -0
- package/payload/templates/classic/assets/icons/trash.svg +2 -0
- package/payload/templates/classic/assets/menu/t1.png +0 -0
- package/payload/templates/classic/assets/menu/t10.png +0 -0
- package/payload/templates/classic/assets/menu/t11.png +0 -0
- package/payload/templates/classic/assets/menu/t2.png +0 -0
- package/payload/templates/classic/assets/menu/t3.png +0 -0
- package/payload/templates/classic/assets/menu/t4.png +0 -0
- package/payload/templates/classic/assets/menu/t5.png +0 -0
- package/payload/templates/classic/assets/menu/t6.png +0 -0
- package/payload/templates/classic/assets/menu/t7.png +0 -0
- package/payload/templates/classic/assets/menu/t8.png +0 -0
- package/payload/templates/classic/assets/menu/t9.png +0 -0
- package/payload/templates/classic/assets/products/brokoli.png +0 -0
- package/payload/templates/classic/assets/products/cilek.png +0 -0
- package/payload/templates/classic/assets/products/domates.png +0 -0
- package/payload/templates/classic/assets/products/elma.png +0 -0
- package/payload/templates/classic/assets/products/havuc.png +0 -0
- package/payload/templates/classic/assets/products/karpuz.png +0 -0
- package/payload/templates/classic/assets/products/limon.png +0 -0
- package/payload/templates/classic/assets/products/muz.png +0 -0
- package/payload/templates/classic/assets/products/nar.png +0 -0
- package/payload/templates/classic/assets/products/patlican.png +0 -0
- package/payload/templates/classic/assets/products/yabanmersini.png +0 -0
- package/payload/templates/classic/assets/products/yesilbiber.png +0 -0
- package/payload/templates/classic/assets/tab-bar/settings.png +0 -0
- package/payload/templates/classic/assets/tab-bar/status.png +0 -0
- package/payload/templates/classic/assets/tab-bar/transactions.png +0 -0
- package/payload/templates/classic/assets/tabs/grid.png +0 -0
- package/payload/templates/classic/assets/tabs/grids.png +0 -0
- package/payload/templates/classic/assets/tabs/home.png +0 -0
- package/payload/templates/classic/assets/tabs/homes.png +0 -0
- package/payload/templates/classic/assets/tabs/search.png +0 -0
- package/payload/templates/classic/assets/tabs/searchs.png +0 -0
- package/payload/templates/classic/assets/tabs/settings.png +0 -0
- package/payload/templates/classic/assets/tabs/settingss.png +0 -0
- package/payload/templates/classic/assets/tabs/tasks.png +0 -0
- package/payload/templates/classic/assets/tabs/taskss.png +0 -0
- package/payload/templates/classic/html/privacy.htm +58 -0
- package/payload/templates/classic/index.htm +70 -0
- package/payload/templates/classic/pages/dialogs.js +205 -0
- package/payload/templates/classic/pages/example.js +296 -0
- package/payload/templates/classic/pages/examples.js +148 -0
- package/payload/templates/classic/pages/home.js +268 -0
- package/payload/templates/classic/pages/info-pages.js +95 -0
- package/payload/templates/classic/pages/lock.js +70 -0
- package/payload/templates/classic/pages/search.js +153 -0
- package/payload/templates/classic/pages/settings.js +184 -0
- package/payload/templates/classic/pages/tasks.js +221 -0
- package/payload/templates/classic/pages/template-pages.js +240 -0
- package/payload/templates/coffee-shop/TEMPLATE.md +63 -0
- package/payload/templates/coffee-shop/app/app.js +713 -0
- package/payload/templates/coffee-shop/app/settings.js +20 -0
- package/payload/templates/coffee-shop/app/store.js +52 -0
- package/payload/templates/coffee-shop/assets/cappuccino.png +0 -0
- package/payload/templates/coffee-shop/assets/chocolate-milk.png +0 -0
- package/payload/templates/coffee-shop/assets/coffee-art/cocoa.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/filter.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/frappe.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/iced.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/latte.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/tea.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee.png +0 -0
- package/payload/templates/coffee-shop/assets/credits.txt +41 -0
- package/payload/templates/coffee-shop/assets/fonts/OFL.txt +93 -0
- package/payload/templates/coffee-shop/assets/fonts/gelasio-OFL.txt +93 -0
- package/payload/templates/coffee-shop/assets/fonts/gelasio.ttf +0 -0
- package/payload/templates/coffee-shop/assets/frappe.png +0 -0
- package/payload/templates/coffee-shop/assets/iced-caffee.png +0 -0
- package/payload/templates/coffee-shop/assets/tabs/cart.svg +1 -0
- package/payload/templates/coffee-shop/assets/tabs/home.svg +1 -0
- package/payload/templates/coffee-shop/assets/tabs/menu.svg +1 -0
- package/payload/templates/coffee-shop/assets/tabs/rewards.svg +1 -0
- package/payload/templates/coffee-shop/assets/tea.png +0 -0
- package/payload/templates/coffee-shop/components/coffee-ui.js +246 -0
- package/payload/templates/coffee-shop/index.htm +55 -0
- package/payload/templates/coffee-shop/pages/cart.js +82 -0
- package/payload/templates/coffee-shop/pages/drink.js +74 -0
- package/payload/templates/coffee-shop/pages/home.js +54 -0
- package/payload/templates/coffee-shop/pages/menu.js +53 -0
- package/payload/templates/coffee-shop/pages/rewards.js +38 -0
- package/payload/templates/forms/TEMPLATE.md +12 -0
- package/payload/templates/forms/app/app.js +30 -0
- package/payload/templates/forms/appointment-form.htm +969 -0
- package/payload/templates/forms/assets/error.png +0 -0
- package/payload/templates/forms/assets/logo.png +0 -0
- package/payload/templates/forms/assets/logo2.png +0 -0
- package/payload/templates/forms/assets/mail.png +0 -0
- package/payload/templates/forms/assets/success.png +0 -0
- package/payload/templates/forms/contact-form-iframe.htm +24 -0
- package/payload/templates/forms/contact-form-table.sql +11 -0
- package/payload/templates/forms/contact-form-to-mail.htm +358 -0
- package/payload/templates/forms/contact-form-to-supabase.htm +396 -0
- package/payload/templates/forms/dark-contact-form.htm +623 -0
- package/payload/templates/forms/event-registration-form.htm +1056 -0
- package/payload/templates/forms/feedback-form.htm +813 -0
- package/payload/templates/forms/order-form.htm +1187 -0
- package/payload/templates/forms/recruitment-form.htm +698 -0
- package/payload/templates/forms/service/PHPMailer/Exception.php +40 -0
- package/payload/templates/forms/service/PHPMailer/LICENSE +502 -0
- package/payload/templates/forms/service/PHPMailer/PHPMailer.php +5586 -0
- package/payload/templates/forms/service/PHPMailer/SMTP.php +1617 -0
- package/payload/templates/forms/service/readme.md +162 -0
- package/payload/templates/forms/service/send-form-mail.php +941 -0
- package/payload/templates/forms/support-ticket-form.htm +908 -0
- package/payload/templates/panel/TEMPLATE.md +16 -0
- package/payload/templates/panel/assets/_Material Symbols & Icons - Google Fonts.webloc +8 -0
- package/payload/templates/panel/assets/arrow_down.png +0 -0
- package/payload/templates/panel/assets/close.png +0 -0
- package/payload/templates/panel/assets/left-menu/bolt.png +0 -0
- package/payload/templates/panel/assets/left-menu/brick.png +0 -0
- package/payload/templates/panel/assets/left-menu/code.png +0 -0
- package/payload/templates/panel/assets/left-menu/dashboard.png +0 -0
- package/payload/templates/panel/assets/left-menu/data-table.png +0 -0
- package/payload/templates/panel/assets/left-menu/extension.png +0 -0
- package/payload/templates/panel/assets/left-menu/home.png +0 -0
- package/payload/templates/panel/assets/left-menu/reports.png +0 -0
- package/payload/templates/panel/assets/left-menu/setting.png +0 -0
- package/payload/templates/panel/assets/left-menu/url.png +0 -0
- package/payload/templates/panel/assets/light.png +0 -0
- package/payload/templates/panel/assets/maybe.png +0 -0
- package/payload/templates/panel/assets/panel-icon.png +0 -0
- package/payload/templates/panel/assets/top-bar/add.png +0 -0
- package/payload/templates/panel/assets/top-bar/add.svg +1 -0
- package/payload/templates/panel/assets/top-bar/apps.png +0 -0
- package/payload/templates/panel/assets/top-bar/apps.svg +1 -0
- package/payload/templates/panel/assets/top-bar/arrow-down.svg +1 -0
- package/payload/templates/panel/assets/top-bar/bell.svg +1 -0
- package/payload/templates/panel/assets/top-bar/bookmark.png +0 -0
- package/payload/templates/panel/assets/top-bar/bookmark.svg +1 -0
- package/payload/templates/panel/assets/top-bar/cancel.png +0 -0
- package/payload/templates/panel/assets/top-bar/close.svg +1 -0
- package/payload/templates/panel/assets/top-bar/comment.png +0 -0
- package/payload/templates/panel/assets/top-bar/filter.png +0 -0
- package/payload/templates/panel/assets/top-bar/keyboard.svg +1 -0
- package/payload/templates/panel/assets/top-bar/notification.png +0 -0
- package/payload/templates/panel/assets/top-bar/search.png +0 -0
- package/payload/templates/panel/assets/top-bar/search.svg +1 -0
- package/payload/templates/panel/assets/top-bar/user.png +0 -0
- package/payload/templates/panel/assets/top-bar/user.svg +1 -0
- package/payload/templates/panel/assets/warning.png +0 -0
- package/payload/templates/panel/common/bridge.js +1 -0
- package/payload/templates/panel/common/bridge.min.js +0 -0
- package/payload/templates/panel/common/components.js +12 -0
- package/payload/templates/panel/common/full-view.js +107 -0
- package/payload/templates/panel/common/full-view.min.js +1 -0
- package/payload/templates/panel/common/main-view.js +53 -0
- package/payload/templates/panel/common/main-view.min.js +1 -0
- package/payload/templates/panel/common/module-page.js +46 -0
- package/payload/templates/panel/common/module-page.min.js +1 -0
- package/payload/templates/panel/common/right-view.js +77 -0
- package/payload/templates/panel/common/right-view.min.js +1 -0
- package/payload/templates/panel/common/start-page.js +31 -0
- package/payload/templates/panel/common/start-page.min.js +1 -0
- package/payload/templates/panel/common/theme.js +491 -0
- package/payload/templates/panel/common/top-bar-v25-07-29-1.js +330 -0
- package/payload/templates/panel/common/top-bar-v25-07-29-2.js +265 -0
- package/payload/templates/panel/common/top-bar.js +855 -0
- package/payload/templates/panel/common/top-bar.min.js +1 -0
- package/payload/templates/panel/common/ui-standards.css +77 -0
- package/payload/templates/panel/common/ui-standards.js +133 -0
- package/payload/templates/panel/common/ui-standards.min.css +1 -0
- package/payload/templates/panel/common/ui-standards.min.js +1 -0
- package/payload/templates/panel/index.htm +642 -0
- package/payload/templates/panel/managers/database.js +1 -0
- package/payload/templates/panel/managers/database.min.js +1 -0
- package/payload/templates/panel/managers/login.js +2 -0
- package/payload/templates/panel/managers/login.min.js +1 -0
- package/payload/templates/panel/module1/empty-main.htm +27 -0
- package/payload/templates/panel/module10/greenhouse.htm +1362 -0
- package/payload/templates/panel/module11/arduino-projects.htm +1125 -0
- package/payload/templates/panel/module2/empty-full.htm +27 -0
- package/payload/templates/panel/module3/empty-right.htm +27 -0
- package/payload/templates/panel/module4/empty-main-topbar.htm +27 -0
- package/payload/templates/panel/module5/empty-right-topbar.htm +27 -0
- package/payload/templates/panel/module6/energy-hub.htm +1508 -0
- package/payload/templates/panel/module7/3d-printers.htm +1259 -0
- package/payload/templates/panel/module8/cold-rooms.htm +1251 -0
- package/payload/templates/panel/module9/elevator-fleet.htm +1489 -0
- package/payload/templates/panel/pages/_page-template.js +36 -0
- package/payload/templates/panel/pages/_page-template.min.js +1 -0
- package/payload/templates/panel/pages/activity.js +1072 -0
- package/payload/templates/panel/pages/contents.js +1555 -0
- package/payload/templates/panel/pages/contents.min.js +1 -0
- package/payload/templates/panel/pages/customers.js +1171 -0
- package/payload/templates/panel/pages/edit-user.js +381 -0
- package/payload/templates/panel/pages/edit-user.min.js +1 -0
- package/payload/templates/panel/pages/edit-users-table.min.js +1 -0
- package/payload/templates/panel/pages/home.js +637 -0
- package/payload/templates/panel/pages/home.min.js +1 -0
- package/payload/templates/panel/pages/media.js +1538 -0
- package/payload/templates/panel/pages/notifications.js +542 -0
- package/payload/templates/panel/pages/notifications.min.js +1 -0
- package/payload/templates/panel/pages/orders.js +1147 -0
- package/payload/templates/panel/pages/products.js +1281 -0
- package/payload/templates/panel/pages/reports.js +1138 -0
- package/payload/templates/panel/pages/reports.min.js +1 -0
- package/payload/templates/panel/pages/roles.js +1096 -0
- package/payload/templates/panel/pages/settings.js +1462 -0
- package/payload/templates/panel/pages/settings.min.js +1 -0
- package/payload/templates/panel/pages/user-actions.js +456 -0
- package/payload/templates/panel/pages/user-actions.min.js +2 -0
- package/payload/templates/panel/pages/user-list.js +1113 -0
- package/payload/templates/panel/pages/users.js +334 -0
- package/payload/templates/panel/pages/users.min.js +1 -0
- package/payload/templates/shop/TEMPLATE.md +69 -0
- package/payload/templates/shop/app/app.js +727 -0
- package/payload/templates/shop/app/art.js +89 -0
- package/payload/templates/shop/app/settings.js +45 -0
- package/payload/templates/shop/app/store.js +239 -0
- package/payload/templates/shop/app/texts.js +232 -0
- package/payload/templates/shop/assets/app-icon.svg +1 -0
- package/payload/templates/shop/assets/tabs/account.svg +1 -0
- package/payload/templates/shop/assets/tabs/cart.svg +1 -0
- package/payload/templates/shop/assets/tabs/home.svg +1 -0
- package/payload/templates/shop/assets/tabs/shop.svg +1 -0
- package/payload/templates/shop/components/shop-ui.js +343 -0
- package/payload/templates/shop/index.htm +57 -0
- package/payload/templates/shop/pages/account.js +190 -0
- package/payload/templates/shop/pages/cart.js +116 -0
- package/payload/templates/shop/pages/checkout.js +134 -0
- package/payload/templates/shop/pages/favorites.js +37 -0
- package/payload/templates/shop/pages/home.js +86 -0
- package/payload/templates/shop/pages/orders.js +132 -0
- package/payload/templates/shop/pages/product.js +168 -0
- package/payload/templates/shop/pages/shop.js +113 -0
- package/payload/templates/starter/TEMPLATE.md +107 -0
- package/payload/templates/starter/app/app.js +660 -0
- package/payload/templates/starter/app/settings.js +57 -0
- package/payload/templates/starter/assets/app-icon.svg +5 -0
- package/payload/templates/starter/assets/products/brokoli.png +0 -0
- package/payload/templates/starter/assets/products/cilek.png +0 -0
- package/payload/templates/starter/assets/products/domates.png +0 -0
- package/payload/templates/starter/assets/products/elma.png +0 -0
- package/payload/templates/starter/assets/products/havuc.png +0 -0
- package/payload/templates/starter/assets/products/karpuz.png +0 -0
- package/payload/templates/starter/assets/products/limon.png +0 -0
- package/payload/templates/starter/assets/products/muz.png +0 -0
- package/payload/templates/starter/assets/products/nar.png +0 -0
- package/payload/templates/starter/assets/products/patlican.png +0 -0
- package/payload/templates/starter/assets/products/yabanmersini.png +0 -0
- package/payload/templates/starter/assets/products/yesilbiber.png +0 -0
- package/payload/templates/starter/assets/tabs/grid.png +0 -0
- package/payload/templates/starter/assets/tabs/grids.png +0 -0
- package/payload/templates/starter/assets/tabs/home.png +0 -0
- package/payload/templates/starter/assets/tabs/homes.png +0 -0
- package/payload/templates/starter/assets/tabs/settings.png +0 -0
- package/payload/templates/starter/assets/tabs/settingss.png +0 -0
- package/payload/templates/starter/assets/tabs/tasks.png +0 -0
- package/payload/templates/starter/assets/tabs/taskss.png +0 -0
- package/payload/templates/starter/html/about.htm +54 -0
- package/payload/templates/starter/index.htm +57 -0
- package/payload/templates/starter/pages/about.js +23 -0
- package/payload/templates/starter/pages/home.js +81 -0
- package/payload/templates/starter/pages/product.js +45 -0
- package/payload/templates/starter/pages/products.js +61 -0
- package/payload/templates/starter/pages/settings.js +103 -0
- package/payload/templates/starter/pages/tasks.js +187 -0
- package/payload/templates/starter/pages/website.js +29 -0
|
@@ -0,0 +1,1508 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta name="basic-check" content="skip">
|
|
5
|
+
|
|
6
|
+
<title>Energy Hub</title>
|
|
7
|
+
|
|
8
|
+
<meta charset="UTF-8">
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0"><!-- , user-scalable=no -->
|
|
10
|
+
|
|
11
|
+
<!-- LIBRARY FILES -->
|
|
12
|
+
<link rel="preload" href="../_basic/basic/font/open-sans/OpenSans-Regular.ttf" as="font" crossorigin="anonymous">
|
|
13
|
+
<link rel="stylesheet" type="text/css" href="../_basic/basic/basic.min.css">
|
|
14
|
+
<script src="../_basic/basic/basic.js" type="text/javascript" charset="utf-8"></script>
|
|
15
|
+
<script src="../common/theme.js" type="text/javascript" charset="utf-8"></script>
|
|
16
|
+
|
|
17
|
+
<!-- COMPONENTS -->
|
|
18
|
+
<script src="../_basic/comp/tiny-select.js" type="text/javascript" charset="utf-8"></script>
|
|
19
|
+
<script src="../_basic/comp/tiny-table.js" type="text/javascript" charset="utf-8"></script>
|
|
20
|
+
<script src="../_basic/comp/toggle.js" type="text/javascript" charset="utf-8"></script>
|
|
21
|
+
<script src="../_basic/comp/slider.js" type="text/javascript" charset="utf-8"></script>
|
|
22
|
+
<script src="../_basic/comp/smart-button.js" type="text/javascript" charset="utf-8"></script>
|
|
23
|
+
<script src="../_basic/comp/dialog.js" type="text/javascript" charset="utf-8"></script>
|
|
24
|
+
<script src="../_basic/comp/check-box.js" type="text/javascript" charset="utf-8"></script>
|
|
25
|
+
<script src="../_basic/comp/radio-button.js" type="text/javascript" charset="utf-8"></script>
|
|
26
|
+
<script src="../_basic/comp/progress-bar.js" type="text/javascript" charset="utf-8"></script>
|
|
27
|
+
<script src="../_basic/comp/spark-line-box.js" type="text/javascript" charset="utf-8"></script>
|
|
28
|
+
<script src="../_basic/comp/gauge.js" type="text/javascript" charset="utf-8"></script>
|
|
29
|
+
<script src="../_basic/comp/chart-box.js" type="text/javascript" charset="utf-8"></script>
|
|
30
|
+
<script src="../_basic/comp/context-menu.js" type="text/javascript" charset="utf-8"></script>
|
|
31
|
+
|
|
32
|
+
<!--
|
|
33
|
+
|
|
34
|
+
/* Bismillah */
|
|
35
|
+
|
|
36
|
+
Module #6: Energy Hub (Template) - v26.09
|
|
37
|
+
|
|
38
|
+
- Control and monitoring of a home energy system: solar panels, a home battery, the grid,
|
|
39
|
+
an EV charger and smart loads (water heater, pool pump, air conditioner).
|
|
40
|
+
- Live energy flow diagram (SVG), battery gauge, summary graphs, today's power chart and energy mix.
|
|
41
|
+
- Controls: battery strategy (self-use, backup, time-of-use), battery reserve, EV charging
|
|
42
|
+
(current limit, solar only, target charge), smart loads (only with excess solar).
|
|
43
|
+
- Tariff of the day, savings, CO₂ and an event log.
|
|
44
|
+
- Opens full screen in the admin panel (iframe), but it can work alone too.
|
|
45
|
+
- Simulation: 1 second = 1 minute of the day, so the sun and the tariff periods can be seen.
|
|
46
|
+
Replace the "ENERGY SERVICE" functions with your API calls (Modbus, MQTT, cloud API of the inverter...).
|
|
47
|
+
|
|
48
|
+
-->
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
|
|
52
|
+
// *** CONSTANTS:
|
|
53
|
+
const LIB_PATH = "../_basic/";
|
|
54
|
+
const ASSETS = "../assets/";
|
|
55
|
+
|
|
56
|
+
const PAGE_COLOR = T.page;
|
|
57
|
+
const CARD_COLOR = T.surface; // Same with ChartBox dark theme background
|
|
58
|
+
const CARD_BORDER_COLOR = Ink(0.1);
|
|
59
|
+
const FIELD_COLOR = T.surface2;
|
|
60
|
+
const PRIMARY_COLOR = T.primary;
|
|
61
|
+
const ACCENT_COLOR = T.accent;
|
|
62
|
+
const WARNING_COLOR = T.warning;
|
|
63
|
+
const ERROR_COLOR = T.danger;
|
|
64
|
+
|
|
65
|
+
// Colors of the energy parts (used in all the charts and the diagram)
|
|
66
|
+
const SOLAR_COLOR = Theme.readable("#E8B04A");
|
|
67
|
+
const HOME_COLOR = T.info;
|
|
68
|
+
const BATTERY_COLOR = T.accent;
|
|
69
|
+
const GRID_COLOR = "#9085E9";
|
|
70
|
+
const EV_COLOR = "#D55181";
|
|
71
|
+
|
|
72
|
+
const DAY_MINUTES = 24 * 60;
|
|
73
|
+
const START_MINUTE = 10 * 60 + 30; // Simulation starts at 10:30 (morning: solar rises, battery charges)
|
|
74
|
+
const CHART_STEP = 15; // Minutes between the chart points
|
|
75
|
+
const KPI_COUNT = 60; // Minutes on the summary graphs
|
|
76
|
+
|
|
77
|
+
const EXPORT_PRICE = 0.08; // $/kWh
|
|
78
|
+
const CO2_PER_KWH = 0.42; // kg (grid electricity)
|
|
79
|
+
|
|
80
|
+
// Tariff periods (time-of-use)
|
|
81
|
+
const TARIFFS = {
|
|
82
|
+
night: { text: "Night", price: 0.11, color: T.info },
|
|
83
|
+
day: { text: "Day", price: 0.24, color: Theme.readable("#A9A79F") },
|
|
84
|
+
peak: { text: "Peak", price: 0.39, color: T.danger },
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const MODES = [
|
|
88
|
+
{ value: "self", text: "Self-use", desc: "Solar first, battery at night, grid last" },
|
|
89
|
+
{ value: "backup", text: "Backup", desc: "Keeps the battery full for power cuts" },
|
|
90
|
+
{ value: "tou", text: "Time-of-use", desc: "Charges at night (cheap), uses it at peak" },
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
const TARGET_SOC_LIST = [60, 70, 80, 90, 100];
|
|
94
|
+
|
|
95
|
+
const LEVEL_COLORS = {
|
|
96
|
+
"Info": Ink(0.6),
|
|
97
|
+
"Success": ACCENT_COLOR,
|
|
98
|
+
"Warning": WARNING_COLOR,
|
|
99
|
+
"Error": ERROR_COLOR,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// *** TEST DATA: (ENERGY SERVICE)
|
|
103
|
+
const system = {
|
|
104
|
+
site: "Home · Izmir",
|
|
105
|
+
inverter: { model: "SH-10K Hybrid", serial: "SH10K-25-01184", firmware: "v3.2.0", efficiency: 97.4 },
|
|
106
|
+
pv: { peakKw: 9.6, cloud: 0.95, cloudTimer: 0 },
|
|
107
|
+
battery: { model: "BX-13.5", capacity: 13.5, soc: 46, maxKw: 5, temp: 27, health: 98, cycles: 412 },
|
|
108
|
+
ev: { plugged: 0, enabled: 1, limitA: 16, solarOnly: 0, carCapacity: 64, carSoc: 38, targetSoc: 80, sessionKwh: 0, state: "" },
|
|
109
|
+
mode: "self",
|
|
110
|
+
reserve: 20, // %
|
|
111
|
+
gridOnline: 1,
|
|
112
|
+
loads: [
|
|
113
|
+
{ key: "heater", title: "Water heater", kw: 2.0, enabled: 1, solarOnly: 1, running: 0 },
|
|
114
|
+
{ key: "pool", title: "Pool pump", kw: 0.75, enabled: 1, solarOnly: 1, running: 0 },
|
|
115
|
+
{ key: "ac", title: "Air conditioner", kw: 1.3, enabled: 1, solarOnly: 0, running: 0 },
|
|
116
|
+
],
|
|
117
|
+
now: { solar: 0, home: 0, ev: 0, battery: 0, grid: 0 }, // kW. battery: + charging. grid: + import.
|
|
118
|
+
today: {},
|
|
119
|
+
history: { solar: [], home: [], grid: [], selfUse: [] }, // Last minutes (summary graphs)
|
|
120
|
+
events: [],
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// *** VARIABLES:
|
|
124
|
+
let simMinute = 0; // Minute of the simulated day
|
|
125
|
+
let isReady = 0;
|
|
126
|
+
let isRendering = 0; // WHY: Component setters call onChange. Changes made by code must not be logged.
|
|
127
|
+
|
|
128
|
+
let lblClock, lblWeather, lblStatus, moreMenu;
|
|
129
|
+
let flowBox, flow = {};
|
|
130
|
+
let gaugeBattery, batteryInfo = {};
|
|
131
|
+
let kpiBoxList = [];
|
|
132
|
+
let chartPower, chartMix;
|
|
133
|
+
let lblReserve, sliderReserve, lblModeInfo;
|
|
134
|
+
let lblEvState, evProgress, toggleEv, lblEvLimit, sliderEvLimit, chkSolarOnly, lblEvSession, btnPlug, targetSelect;
|
|
135
|
+
let loadRows = {};
|
|
136
|
+
let tariffCells = [], lblTariffNow, savingsLabels = {};
|
|
137
|
+
let grpEventTable, eventTable = null;
|
|
138
|
+
|
|
139
|
+
// First running function.
|
|
140
|
+
const start = function () {
|
|
141
|
+
|
|
142
|
+
page.color = PAGE_COLOR;
|
|
143
|
+
|
|
144
|
+
// Today until the start time (fast, without events)
|
|
145
|
+
resetToday();
|
|
146
|
+
for (let m = 0; m < START_MINUTE; m++) {
|
|
147
|
+
simMinute = m;
|
|
148
|
+
simulateMinute(1);
|
|
149
|
+
}
|
|
150
|
+
simMinute = START_MINUTE;
|
|
151
|
+
|
|
152
|
+
// Test: The car is plugged in when the page opens.
|
|
153
|
+
system.ev.plugged = 1;
|
|
154
|
+
system.ev.carSoc = 38;
|
|
155
|
+
system.ev.sessionKwh = 0;
|
|
156
|
+
|
|
157
|
+
addEvent("Info", "Connected to " + system.inverter.model + " (" + system.inverter.serial + ")");
|
|
158
|
+
addEvent("Success", "EV connected, charging started at " + system.ev.limitA + " A");
|
|
159
|
+
|
|
160
|
+
// BOX: Full screen scrollable container
|
|
161
|
+
// WHY: page does not scroll. Scrollable content must be inside a Box with scrollY: 1.
|
|
162
|
+
startBox(0, 0, "100%", "100%", {
|
|
163
|
+
color: "transparent",
|
|
164
|
+
scrollY: 1,
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
VGroup({
|
|
168
|
+
width: "100%",
|
|
169
|
+
height: "auto", // Grows with content, so the Box can scroll.
|
|
170
|
+
align: "left top",
|
|
171
|
+
gap: 16,
|
|
172
|
+
padding: 24,
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
initHeader();
|
|
176
|
+
initHeroRow();
|
|
177
|
+
initKpiRow();
|
|
178
|
+
initChartRow();
|
|
179
|
+
initControlRow();
|
|
180
|
+
initBottomRow();
|
|
181
|
+
|
|
182
|
+
endGroup();
|
|
183
|
+
|
|
184
|
+
endBox();
|
|
185
|
+
|
|
186
|
+
// WHY: Bar count was calculated with the default width (before flex).
|
|
187
|
+
kpiBoxList.forEach(function (kpiBox) { kpiBox.refresh(); });
|
|
188
|
+
|
|
189
|
+
isReady = 1;
|
|
190
|
+
renderAll();
|
|
191
|
+
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// Runs every second: one minute of the day.
|
|
195
|
+
const loop = function () {
|
|
196
|
+
|
|
197
|
+
if (!isReady) return;
|
|
198
|
+
|
|
199
|
+
simMinute++;
|
|
200
|
+
if (simMinute >= DAY_MINUTES) {
|
|
201
|
+
simMinute = 0;
|
|
202
|
+
resetToday();
|
|
203
|
+
addEvent("Info", "A new day. Today's totals are reset.");
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
simulateMinute(0);
|
|
207
|
+
renderLive();
|
|
208
|
+
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
// *** ENERGY SERVICE (SIMULATION):
|
|
212
|
+
|
|
213
|
+
const resetToday = function () {
|
|
214
|
+
system.today = { solar: 0, consumption: 0, import: 0, export: 0, charge: 0, discharge: 0, ev: 0, savings: 0, co2: 0, cost: 0 };
|
|
215
|
+
system.chart = { solar: [], consumption: [], battery: [], grid: [] }; // One value for each CHART_STEP
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const getTariffId = function (minute) {
|
|
219
|
+
const hour = Math.floor(minute / 60);
|
|
220
|
+
if (hour < 7) return "night";
|
|
221
|
+
if (hour >= 17 && hour < 22) return "peak";
|
|
222
|
+
return "day";
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
// One minute of the system. silent: 1 -> No events.
|
|
226
|
+
const simulateMinute = function (silent) {
|
|
227
|
+
|
|
228
|
+
const s = system;
|
|
229
|
+
const hour = simMinute / 60;
|
|
230
|
+
const dtH = 1 / 60;
|
|
231
|
+
const tariffId = getTariffId(simMinute);
|
|
232
|
+
const tariff = TARIFFS[tariffId];
|
|
233
|
+
const event = function (level, text) { if (!silent) addEvent(level, text); };
|
|
234
|
+
|
|
235
|
+
// Tariff period changes
|
|
236
|
+
if (simMinute > 0 && getTariffId(simMinute - 1) != tariffId) event("Info", tariff.text + " tariff started (" + tariff.price.toFixed(2) + " $/kWh)");
|
|
237
|
+
|
|
238
|
+
// SOLAR: Sun curve, clouds move slowly
|
|
239
|
+
if (s.pv.cloudTimer > 0) {
|
|
240
|
+
s.pv.cloudTimer--;
|
|
241
|
+
s.pv.cloud = Math.max(0.2, s.pv.cloud - 0.08);
|
|
242
|
+
if (s.pv.cloudTimer == 0) event("Info", "The cloud has passed");
|
|
243
|
+
} else {
|
|
244
|
+
s.pv.cloud = Math.min(1, Math.max(0.55, s.pv.cloud + (Math.random() - 0.48) * 0.04));
|
|
245
|
+
}
|
|
246
|
+
const sun = Math.max(0, Math.sin(Math.PI * (hour - 6.3) / 13.4));
|
|
247
|
+
let solar = s.pv.peakKw * 0.86 * Math.pow(sun, 1.3) * s.pv.cloud; // 0.86: Heat and cable losses
|
|
248
|
+
|
|
249
|
+
// HOME: Base load (more in the morning and the evening)
|
|
250
|
+
let base = 0.35 + ((hour > 6.5 && hour < 8.5) ? 0.6 : 0) + ((hour > 18 && hour < 23) ? 0.9 : 0) + (Math.random() - 0.5) * 0.1;
|
|
251
|
+
|
|
252
|
+
// SMART LOADS: "Only with excess solar" loads run when there is enough solar power.
|
|
253
|
+
let surplus = solar - base;
|
|
254
|
+
let loadsKw = 0;
|
|
255
|
+
s.loads.forEach(function (load) {
|
|
256
|
+
let run = load.enabled;
|
|
257
|
+
if (run && load.solarOnly) run = (load.running) ? surplus >= load.kw * 0.6 : surplus >= load.kw * 1.1; // Hysteresis
|
|
258
|
+
if (run && load.key == "ac") run = (hour > 11 && hour < 23); // Test: AC runs in the hot hours
|
|
259
|
+
if (run != load.running) {
|
|
260
|
+
load.running = run;
|
|
261
|
+
if (load.solarOnly && load.enabled) event("Info", load.title + (run ? " started with excess solar" : " stopped (not enough solar)"));
|
|
262
|
+
}
|
|
263
|
+
if (run) { loadsKw += load.kw; surplus -= load.kw; }
|
|
264
|
+
});
|
|
265
|
+
const home = base + loadsKw;
|
|
266
|
+
|
|
267
|
+
// EV CHARGER
|
|
268
|
+
let ev = 0;
|
|
269
|
+
let evState = "Unplugged";
|
|
270
|
+
if (s.ev.plugged) {
|
|
271
|
+
const maxKw = s.ev.limitA * 230 / 1000;
|
|
272
|
+
if (s.ev.carSoc >= s.ev.targetSoc) {
|
|
273
|
+
evState = "Complete";
|
|
274
|
+
} else if (!s.ev.enabled) {
|
|
275
|
+
evState = "Paused";
|
|
276
|
+
} else if (!s.gridOnline) {
|
|
277
|
+
evState = "Paused (power cut)";
|
|
278
|
+
} else if (s.ev.solarOnly) {
|
|
279
|
+
const available = solar - home;
|
|
280
|
+
if (available >= 1.4) { ev = Math.min(available, maxKw); evState = "Charging with solar"; } else { evState = "Waiting for solar"; }
|
|
281
|
+
} else {
|
|
282
|
+
ev = maxKw;
|
|
283
|
+
evState = "Charging";
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (evState != s.ev.state) {
|
|
287
|
+
if (evState == "Complete" && s.ev.state) event("Success", "EV charging complete: " + Math.round(s.ev.carSoc) + "% (" + s.ev.sessionKwh.toFixed(1) + " kWh)");
|
|
288
|
+
s.ev.state = evState;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// BATTERY: Strategy
|
|
292
|
+
const load = home + ev;
|
|
293
|
+
const net = solar - load; // + surplus, - deficit
|
|
294
|
+
const b = s.battery;
|
|
295
|
+
const canCharge = b.soc < 100;
|
|
296
|
+
const canDischarge = function (limit) { return b.soc > limit; };
|
|
297
|
+
let battery = 0; // + charge, - discharge
|
|
298
|
+
const reserve = (s.mode == "backup") ? Math.max(80, s.reserve) : s.reserve;
|
|
299
|
+
|
|
300
|
+
if (!s.gridOnline) {
|
|
301
|
+
// Power cut: the battery covers everything (down to 5%)
|
|
302
|
+
if (net > 0 && canCharge) battery = Math.min(net, b.maxKw);
|
|
303
|
+
if (net < 0 && canDischarge(5)) battery = -Math.min(-net, b.maxKw);
|
|
304
|
+
} else if (s.mode == "self") {
|
|
305
|
+
if (net > 0 && canCharge) battery = Math.min(net, b.maxKw);
|
|
306
|
+
if (net < 0 && canDischarge(reserve)) battery = -Math.min(-net, b.maxKw);
|
|
307
|
+
} else if (s.mode == "backup") {
|
|
308
|
+
if (net > 0 && canCharge) battery = Math.min(net, b.maxKw);
|
|
309
|
+
if (b.soc < reserve) battery = Math.max(battery, 2); // Charges from the grid too, to keep the reserve
|
|
310
|
+
} else if (s.mode == "tou") {
|
|
311
|
+
if (tariffId == "night" && b.soc < 95) battery = 3; // Cheap grid energy
|
|
312
|
+
else if (net > 0 && canCharge) battery = Math.min(net, b.maxKw);
|
|
313
|
+
else if (tariffId == "peak" && net < 0 && canDischarge(reserve)) battery = -Math.min(-net, b.maxKw);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Battery limits
|
|
317
|
+
if (battery > 0 && b.soc >= 100) battery = 0;
|
|
318
|
+
b.soc = Math.min(100, Math.max(0, b.soc + battery * dtH * ((battery > 0) ? 0.95 : 1) / b.capacity * 100));
|
|
319
|
+
b.temp = Math.round((27 + Math.abs(battery) * 0.9 + (Math.random() - 0.5)) * 10) / 10;
|
|
320
|
+
|
|
321
|
+
// GRID
|
|
322
|
+
let grid = load + battery - solar; // + import, - export
|
|
323
|
+
if (!s.gridOnline) {
|
|
324
|
+
if (grid < 0) solar += grid; // Solar is limited: no export in a power cut
|
|
325
|
+
grid = 0;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// EV car charge
|
|
329
|
+
if (ev > 0) {
|
|
330
|
+
s.ev.carSoc = Math.min(100, s.ev.carSoc + ev * dtH * 0.92 / s.ev.carCapacity * 100);
|
|
331
|
+
s.ev.sessionKwh += ev * dtH;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// Battery events
|
|
335
|
+
if (!silent) {
|
|
336
|
+
if (b.soc >= 100 && s.now.battery > 0) event("Success", "Battery is full");
|
|
337
|
+
if (s.mode == "self" && s.gridOnline && Math.round(b.soc) == reserve && s.now.battery < 0 && battery == 0) event("Warning", "Battery reserve (" + reserve + "%) reached. Home uses the grid.");
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
s.now = { solar: solar, home: home, ev: ev, battery: battery, grid: grid };
|
|
341
|
+
|
|
342
|
+
// Today
|
|
343
|
+
const t = s.today;
|
|
344
|
+
t.solar += solar * dtH;
|
|
345
|
+
t.consumption += load * dtH;
|
|
346
|
+
t.import += Math.max(0, grid) * dtH;
|
|
347
|
+
t.export += Math.max(0, -grid) * dtH;
|
|
348
|
+
t.charge += Math.max(0, battery) * dtH;
|
|
349
|
+
t.discharge += Math.max(0, -battery) * dtH;
|
|
350
|
+
t.ev += ev * dtH;
|
|
351
|
+
t.cost += Math.max(0, grid) * dtH * tariff.price - Math.max(0, -grid) * dtH * EXPORT_PRICE;
|
|
352
|
+
t.savings = Math.max(0, t.consumption * 0.24 - t.cost); // Compared with the day price, without the system
|
|
353
|
+
t.co2 = (t.solar) * CO2_PER_KWH;
|
|
354
|
+
|
|
355
|
+
// History for the summary graphs
|
|
356
|
+
const h = s.history;
|
|
357
|
+
h.solar.push(solar);
|
|
358
|
+
h.home.push(load);
|
|
359
|
+
h.grid.push({ value: Math.abs(grid), color: (grid < 0) ? ACCENT_COLOR : "" });
|
|
360
|
+
h.selfUse.push((load > 0) ? Math.round((1 - Math.max(0, grid) / load) * 100) : 100);
|
|
361
|
+
for (const key in h) {
|
|
362
|
+
if (h[key].length > KPI_COUNT) h[key].shift();
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Chart points (every CHART_STEP minutes)
|
|
366
|
+
if (simMinute % CHART_STEP == 0) {
|
|
367
|
+
const c = s.chart;
|
|
368
|
+
c.solar.push(round2(solar));
|
|
369
|
+
c.consumption.push(round2(load));
|
|
370
|
+
c.battery.push(round2(battery));
|
|
371
|
+
c.grid.push(round2(grid));
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
const setGridOnline = function (online) {
|
|
377
|
+
if (system.gridOnline == online) return;
|
|
378
|
+
system.gridOnline = online;
|
|
379
|
+
addEvent((online) ? "Success" : "Error", (online) ? "Grid power is back" : "Power cut! The battery powers the home.");
|
|
380
|
+
renderAll();
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
const passCloud = function () {
|
|
384
|
+
system.pv.cloudTimer = 25;
|
|
385
|
+
addEvent("Warning", "Test: A cloud is passing over the panels");
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
// *** HELPERS:
|
|
389
|
+
|
|
390
|
+
const round2 = function (value) {
|
|
391
|
+
return Math.round(value * 100) / 100;
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
const formatKw = function (kw) {
|
|
395
|
+
return (Math.abs(kw) < 0.05) ? "0 kW" : Math.abs(kw).toFixed(1) + " kW";
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
const formatMinute = function (minute) {
|
|
399
|
+
const pad = function (n) { return String(n).padStart(2, "0"); };
|
|
400
|
+
return pad(Math.floor(minute / 60) % 24) + ":" + pad(minute % 60);
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
const getChartLabels = function () {
|
|
404
|
+
const labels = [];
|
|
405
|
+
for (let m = 0; m < DAY_MINUTES; m += CHART_STEP) labels.push(formatMinute(m));
|
|
406
|
+
return labels;
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
// WHY: Some components have no enabled setting. "inert" blocks the mouse and keyboard for all the children.
|
|
410
|
+
const setInteractive = function (obj, enabled) {
|
|
411
|
+
obj.elem.inert = !enabled;
|
|
412
|
+
obj.opacity = (enabled) ? 1 : 0.4;
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
const addEvent = function (level, message) {
|
|
416
|
+
system.events.unshift({ time: formatMinute(simMinute), level: level, message: message });
|
|
417
|
+
if (system.events.length > 100) system.events.pop();
|
|
418
|
+
if (isReady) renderEvents();
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
const downloadReport = function () {
|
|
422
|
+
const t = system.today;
|
|
423
|
+
const lines = ["metric,value", "time," + formatMinute(simMinute)];
|
|
424
|
+
[["solar_kwh", t.solar], ["consumption_kwh", t.consumption], ["grid_import_kwh", t.import], ["grid_export_kwh", t.export],
|
|
425
|
+
["battery_charge_kwh", t.charge], ["battery_discharge_kwh", t.discharge], ["ev_kwh", t.ev], ["cost_usd", t.cost], ["savings_usd", t.savings], ["co2_avoided_kg", t.co2]]
|
|
426
|
+
.forEach(function (row) { lines.push(row[0] + "," + row[1].toFixed(2)); });
|
|
427
|
+
const link = document.createElement("a");
|
|
428
|
+
link.href = URL.createObjectURL(new Blob([lines.join("\n")], { type: "text/csv" }));
|
|
429
|
+
link.download = "energy-report.csv";
|
|
430
|
+
link.click();
|
|
431
|
+
URL.revokeObjectURL(link.href);
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
// *** VIEW HELPERS:
|
|
435
|
+
|
|
436
|
+
// GROUP: Cards side by side (wraps on small screens)
|
|
437
|
+
const startRow = function () {
|
|
438
|
+
HGroup({ width: "100%", height: "auto", align: "left top", gap: 16 });
|
|
439
|
+
that.elem.style.flexWrap = "wrap";
|
|
440
|
+
that.elem.style.alignItems = "stretch"; // WHY: Cards in the same row have the same height.
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
// flex: "1 1 320px" (grow, shrink, min width before wrap)
|
|
444
|
+
const setFlex = function (obj, flex) {
|
|
445
|
+
obj.elem.style.flex = flex;
|
|
446
|
+
obj.elem.style.minWidth = "0";
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
const startCard = function (title, subtitle, flex) {
|
|
450
|
+
|
|
451
|
+
const card = VGroup({ height: "auto", align: "left top", gap: 16, padding: 16, color: CARD_COLOR, border: 1, borderColor: CARD_BORDER_COLOR, round: 12 });
|
|
452
|
+
setFlex(card, flex);
|
|
453
|
+
|
|
454
|
+
startSpaceBetween();
|
|
455
|
+
|
|
456
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
457
|
+
Label({ text: title, fontSize: 16, textColor: Ink(0.95) });
|
|
458
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
459
|
+
if (subtitle) Label({ text: subtitle, fontSize: 12, textColor: Ink(0.45) });
|
|
460
|
+
endGroup();
|
|
461
|
+
|
|
462
|
+
card.lblRight = Label({ text: "", fontSize: 12, round: 100, padding: [10, 3], border: 1, borderColor: "transparent" });
|
|
463
|
+
that.elem.style.whiteSpace = "nowrap";
|
|
464
|
+
|
|
465
|
+
endGroup();
|
|
466
|
+
|
|
467
|
+
return card;
|
|
468
|
+
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
const endCard = function () {
|
|
472
|
+
endGroup();
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
// GROUP: Left and right items (space between)
|
|
476
|
+
const startSpaceBetween = function (gap = 12) {
|
|
477
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: gap });
|
|
478
|
+
that.elem.style.justifyContent = "space-between";
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
const createSmallTitle = function (text) {
|
|
482
|
+
Label({ text: text.toUpperCase(), fontSize: 11, textColor: Ink(0.45) });
|
|
483
|
+
that.elem.style.letterSpacing = "1px";
|
|
484
|
+
return that;
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
// A pill label: text and color
|
|
488
|
+
const setPill = function (label, text, color) {
|
|
489
|
+
label.text = text;
|
|
490
|
+
label.textColor = color;
|
|
491
|
+
label.color = ChartBox.alpha(color, 0.12);
|
|
492
|
+
label.borderColor = ChartBox.alpha(color, 0.4);
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
const createInfoLine = function (title, first) {
|
|
496
|
+
startSpaceBetween();
|
|
497
|
+
that.elem.style.padding = "8px 0px";
|
|
498
|
+
if (!first) that.elem.style.borderTop = "1px solid " + Ink(0.06);
|
|
499
|
+
Label({ text: title, fontSize: 14, textColor: Ink(0.5) });
|
|
500
|
+
const value = Label({ text: "", fontSize: 14, textColor: Ink(0.9) });
|
|
501
|
+
that.elem.style.whiteSpace = "nowrap";
|
|
502
|
+
endGroup();
|
|
503
|
+
return value;
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
const createButton = function (text, iconFile, onClick) {
|
|
507
|
+
const btn = SmartButton({
|
|
508
|
+
styleName: "classic",
|
|
509
|
+
width: "auto",
|
|
510
|
+
labelText: text,
|
|
511
|
+
iconFile: (iconFile) ? ASSETS + iconFile : "",
|
|
512
|
+
onClick: onClick,
|
|
513
|
+
style: {
|
|
514
|
+
layout: { gap: 10, padding: [14, 8], align: "center center" },
|
|
515
|
+
icon: { width: 20, height: 20 },
|
|
516
|
+
label: { fontSize: 14, textColor: Ink(0.9) },
|
|
517
|
+
box: { color: FIELD_COLOR, border: 1, borderColor: CARD_BORDER_COLOR, round: 8 },
|
|
518
|
+
hover: { color: T.surface3 },
|
|
519
|
+
active: { color: T.surface4 },
|
|
520
|
+
},
|
|
521
|
+
});
|
|
522
|
+
if (btn.icon) btn.icon.elem.style.filter = T.iconFilter; // WHY: Panel icons are black.
|
|
523
|
+
return btn;
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
const createToggle = function (onChange) {
|
|
527
|
+
return Toggle({
|
|
528
|
+
width: 52,
|
|
529
|
+
height: 30,
|
|
530
|
+
spacing: 3,
|
|
531
|
+
backgroundStyle: { color: T.surface3, selectedColor: PRIMARY_COLOR, border: 1, borderColor: CARD_BORDER_COLOR },
|
|
532
|
+
buttonStyle: { color: Ink(0.35), selectedColor: Ink(0.95) },
|
|
533
|
+
onChange: function (self) {
|
|
534
|
+
if (!isRendering) onChange(self);
|
|
535
|
+
},
|
|
536
|
+
});
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
const createSlider = function (width, color, onDragMove, onDragEnd) {
|
|
540
|
+
const slider = Slider({
|
|
541
|
+
width: width,
|
|
542
|
+
trackHeight: 8,
|
|
543
|
+
minThumbHeight: 26,
|
|
544
|
+
trackColor: color,
|
|
545
|
+
trackBackgroundColor: Ink(0.1),
|
|
546
|
+
thumbColor: Ink(0.9),
|
|
547
|
+
showValueOnSet: 0,
|
|
548
|
+
showValueOnDrag: 0, // WHY: Slider shows 0-100. The real value is shown in a label.
|
|
549
|
+
onDragMove: onDragMove,
|
|
550
|
+
onDragEnd: onDragEnd,
|
|
551
|
+
});
|
|
552
|
+
return slider;
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
const DARK_RADIO_STYLE = {
|
|
556
|
+
mark: { width: 20, height: 20, color: "transparent", borderColor: Ink(0.35) },
|
|
557
|
+
checkedMark: { color: "transparent", borderColor: ACCENT_COLOR },
|
|
558
|
+
hoverMark: { borderColor: Ink(0.7) },
|
|
559
|
+
dot: { color: ACCENT_COLOR },
|
|
560
|
+
label: { fontSize: 14, textColor: Ink(0.9) },
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
const DARK_CHECK_STYLE = {
|
|
564
|
+
layout: { padding: [0, 2] },
|
|
565
|
+
mark: { width: 18, height: 18, color: "transparent", borderColor: Ink(0.35) },
|
|
566
|
+
checkedMark: { color: PRIMARY_COLOR, borderColor: PRIMARY_COLOR },
|
|
567
|
+
hoverMark: { borderColor: Ink(0.7) },
|
|
568
|
+
tick: { color: Ink(1) },
|
|
569
|
+
label: { fontSize: 13, textColor: Ink(0.75) },
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
// *** VIEW:
|
|
573
|
+
|
|
574
|
+
const initHeader = function () {
|
|
575
|
+
|
|
576
|
+
startSpaceBetween(16);
|
|
577
|
+
that.elem.style.flexWrap = "wrap";
|
|
578
|
+
that.elem.style.paddingRight = "60px"; // WHY: The close button of the full view is on the right top.
|
|
579
|
+
|
|
580
|
+
HGroup({ width: "auto", height: "auto", align: "left center", gap: 20 });
|
|
581
|
+
that.elem.style.flexWrap = "wrap";
|
|
582
|
+
|
|
583
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
584
|
+
Label({ text: "Energy Hub", fontSize: 26, textColor: Ink(0.95) });
|
|
585
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
586
|
+
Label({ text: system.site + " · Solar " + system.pv.peakKw + " kWp · Battery " + system.battery.capacity + " kWh · EV charger", fontSize: 14, textColor: Ink(0.5) });
|
|
587
|
+
endGroup();
|
|
588
|
+
|
|
589
|
+
lblStatus = Label({ text: "", fontSize: 13, round: 100, border: 1, padding: [12, 4] });
|
|
590
|
+
that.elem.style.whiteSpace = "nowrap";
|
|
591
|
+
|
|
592
|
+
endGroup();
|
|
593
|
+
|
|
594
|
+
HGroup({ width: "auto", height: "auto", align: "right center", gap: 16 });
|
|
595
|
+
|
|
596
|
+
VGroup({ width: "auto", height: "auto", align: "right center", gap: 0 });
|
|
597
|
+
lblClock = Label({ text: "", fontSize: 22, textColor: Ink(0.95) });
|
|
598
|
+
that.elem.style.fontVariantNumeric = "tabular-nums";
|
|
599
|
+
lblWeather = Label({ text: "", fontSize: 12, textColor: Ink(0.5) });
|
|
600
|
+
that.elem.style.whiteSpace = "nowrap";
|
|
601
|
+
endGroup();
|
|
602
|
+
|
|
603
|
+
const btnMore = createButton("More", "top-bar/apps.png", function () { });
|
|
604
|
+
|
|
605
|
+
moreMenu = ContextMenu({
|
|
606
|
+
items: [
|
|
607
|
+
{ text: "Test: Power cut", key: "cut" },
|
|
608
|
+
{ text: "Test: Grid power back", key: "back" },
|
|
609
|
+
{ text: "Test: A cloud passes", key: "cloud" },
|
|
610
|
+
"-",
|
|
611
|
+
{ text: "Download today's report (CSV)", key: "csv" },
|
|
612
|
+
{ text: "Copy inverter serial number", key: "copy" },
|
|
613
|
+
],
|
|
614
|
+
onClick: function (self, item) { onMoreMenuClick(item.key); },
|
|
615
|
+
style: {
|
|
616
|
+
menu: { color: FIELD_COLOR, borderColor: Ink(0.12), shadow: "0px 8px 24px rgba(0, 0, 0, 0.5)" },
|
|
617
|
+
item: { textColor: Ink(0.85) },
|
|
618
|
+
itemHover: { textColor: Ink(1), color: Ink(0.08) },
|
|
619
|
+
disabled: { textColor: Ink(0.3) },
|
|
620
|
+
separator: { color: Ink(0.1) },
|
|
621
|
+
},
|
|
622
|
+
});
|
|
623
|
+
moreMenu.attachTo(btnMore, "click");
|
|
624
|
+
|
|
625
|
+
endGroup();
|
|
626
|
+
|
|
627
|
+
endGroup();
|
|
628
|
+
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
const initHeroRow = function () {
|
|
632
|
+
|
|
633
|
+
startRow();
|
|
634
|
+
|
|
635
|
+
// FLOW: Live energy flow diagram
|
|
636
|
+
const flowCard = startCard("Live Energy Flow", "Where the power comes from and where it goes", "2 1 560px");
|
|
637
|
+
flow.card = flowCard;
|
|
638
|
+
|
|
639
|
+
flowBox = Box({ width: "100%", height: "auto", color: "transparent" });
|
|
640
|
+
flowBox.position = "relative";
|
|
641
|
+
flowBox.elem.innerHTML = createFlowSvg();
|
|
642
|
+
flow.svg = flowBox.elem.querySelector("svg");
|
|
643
|
+
|
|
644
|
+
endCard();
|
|
645
|
+
|
|
646
|
+
// BATTERY
|
|
647
|
+
const batteryCard = startCard("Battery", system.battery.model + " · " + system.battery.capacity + " kWh", "1 1 320px");
|
|
648
|
+
batteryInfo.card = batteryCard;
|
|
649
|
+
|
|
650
|
+
// GAUGE: comp/gauge.js (full ring). The marker line is the reserve.
|
|
651
|
+
HGroup({ width: "100%", height: "auto", align: "center center" });
|
|
652
|
+
gaugeBattery = Gauge({
|
|
653
|
+
width: 180,
|
|
654
|
+
height: 180,
|
|
655
|
+
styleName: T.compStyle,
|
|
656
|
+
radius: 74,
|
|
657
|
+
value: system.battery.soc,
|
|
658
|
+
markerValue: system.reserve,
|
|
659
|
+
ariaLabel: "Battery charge",
|
|
660
|
+
style: {
|
|
661
|
+
bar: { color: BATTERY_COLOR },
|
|
662
|
+
marker: { color: WARNING_COLOR, width: 3, length: 18 },
|
|
663
|
+
value: { fontSize: 38 },
|
|
664
|
+
},
|
|
665
|
+
});
|
|
666
|
+
endGroup();
|
|
667
|
+
|
|
668
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 0 });
|
|
669
|
+
batteryInfo.power = createInfoLine("Power", 1);
|
|
670
|
+
batteryInfo.time = createInfoLine("Estimate");
|
|
671
|
+
batteryInfo.reserve = createInfoLine("Reserve");
|
|
672
|
+
batteryInfo.temp = createInfoLine("Temperature");
|
|
673
|
+
batteryInfo.health = createInfoLine("Health");
|
|
674
|
+
endGroup();
|
|
675
|
+
|
|
676
|
+
endCard();
|
|
677
|
+
|
|
678
|
+
endGroup();
|
|
679
|
+
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
// SVG: Nodes (solar, grid, home, battery, EV) around the inverter, with moving dashes on the lines.
|
|
683
|
+
const FLOW_NODES = {
|
|
684
|
+
solar: { x: 320, y: 64, color: SOLAR_COLOR, title: "Solar", label: "right" },
|
|
685
|
+
grid: { x: 96, y: 206, color: GRID_COLOR, title: "Grid", label: "below" },
|
|
686
|
+
home: { x: 544, y: 206, color: HOME_COLOR, title: "Home", label: "below" },
|
|
687
|
+
battery: { x: 196, y: 338, color: BATTERY_COLOR, title: "Battery", label: "left" },
|
|
688
|
+
ev: { x: 444, y: 338, color: EV_COLOR, title: "EV", label: "right" },
|
|
689
|
+
};
|
|
690
|
+
const FLOW_HUB = { x: 320, y: 206, r: 46 };
|
|
691
|
+
const NODE_R = 34;
|
|
692
|
+
|
|
693
|
+
const FLOW_ICONS = {
|
|
694
|
+
solar: "<circle r='8'/>" + [0, 45, 90, 135, 180, 225, 270, 315].map(function (a) {
|
|
695
|
+
const r = a * Math.PI / 180;
|
|
696
|
+
return "<line x1='" + (Math.cos(r) * 12).toFixed(1) + "' y1='" + (Math.sin(r) * 12).toFixed(1) + "' x2='" + (Math.cos(r) * 17).toFixed(1) + "' y2='" + (Math.sin(r) * 17).toFixed(1) + "'/>";
|
|
697
|
+
}).join(""),
|
|
698
|
+
grid: "<path d='M-10 16 L-4 -14 L4 -14 L10 16 M-13 -6 L13 -6 M-8 4 L8 4 M-4 -14 L0 -19 L4 -14 M-7 4 L4 -6 M7 4 L-4 -6'/>",
|
|
699
|
+
home: "<path d='M-15 2 L0 -13 L15 2 M-10 -2 L-10 14 L10 14 L10 -2 M-3 14 L-3 5 L3 5 L3 14'/>",
|
|
700
|
+
battery: "<rect x='-9' y='-14' width='18' height='30' rx='3'/><rect x='-4' y='-18' width='8' height='4' rx='1'/><rect class='level' x='-5.5' y='12.5' width='11' height='0' rx='1.5' stroke='none'/>",
|
|
701
|
+
ev: "<path d='M-16 6 L-16 -1 L-11 -9 L11 -9 L16 -1 L16 6 Z M-11 -1 L11 -1'/><circle cx='-8' cy='9' r='3'/><circle cx='8' cy='9' r='3'/>",
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
const createFlowSvg = function () {
|
|
705
|
+
|
|
706
|
+
let lines = "", nodes = "";
|
|
707
|
+
|
|
708
|
+
Object.keys(FLOW_NODES).forEach(function (key) {
|
|
709
|
+
|
|
710
|
+
const n = FLOW_NODES[key];
|
|
711
|
+
const dx = FLOW_HUB.x - n.x, dy = FLOW_HUB.y - n.y;
|
|
712
|
+
const length = Math.sqrt(dx * dx + dy * dy);
|
|
713
|
+
const ux = dx / length, uy = dy / length;
|
|
714
|
+
const x1 = n.x + ux * (NODE_R + 6), y1 = n.y + uy * (NODE_R + 6);
|
|
715
|
+
const x2 = FLOW_HUB.x - ux * (FLOW_HUB.r + 6), y2 = FLOW_HUB.y - uy * (FLOW_HUB.r + 6);
|
|
716
|
+
const d = "M" + x1.toFixed(1) + " " + y1.toFixed(1) + " L" + x2.toFixed(1) + " " + y2.toFixed(1);
|
|
717
|
+
|
|
718
|
+
lines += "<path d='" + d + "' stroke='" + Ink(0.07) + "' stroke-width='4' stroke-linecap='round'/>" +
|
|
719
|
+
"<path id='flow-" + key + "' class='flow' d='" + d + "' stroke='" + n.color + "' stroke-width='4'/>";
|
|
720
|
+
|
|
721
|
+
// Label position
|
|
722
|
+
let tx = n.x, ty = n.y + NODE_R + 22, anchor = "middle";
|
|
723
|
+
if (n.label == "right") { tx = n.x + NODE_R + 14; ty = n.y - 4; anchor = "start"; }
|
|
724
|
+
if (n.label == "left") { tx = n.x - NODE_R - 14; ty = n.y - 4; anchor = "end"; }
|
|
725
|
+
|
|
726
|
+
nodes += "<g transform='translate(" + n.x + " " + n.y + ")'>" +
|
|
727
|
+
"<circle id='node-" + key + "' r='" + NODE_R + "' fill='" + ChartBox.alpha(n.color, 0.12) + "' stroke='" + ChartBox.alpha(n.color, 0.6) + "' stroke-width='1.5'/>" +
|
|
728
|
+
"<g id='icon-" + key + "' fill='none' stroke='" + n.color + "' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>" + FLOW_ICONS[key] + "</g>" +
|
|
729
|
+
"</g>" +
|
|
730
|
+
"<text x='" + tx + "' y='" + ty + "' text-anchor='" + anchor + "' class='t-title'>" + n.title + "</text>" +
|
|
731
|
+
"<text id='value-" + key + "' x='" + tx + "' y='" + (ty + 22) + "' text-anchor='" + anchor + "' class='t-value'></text>" +
|
|
732
|
+
"<text id='sub-" + key + "' x='" + tx + "' y='" + (ty + 40) + "' text-anchor='" + anchor + "' class='t-sub'></text>";
|
|
733
|
+
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
const hub = "<circle cx='" + FLOW_HUB.x + "' cy='" + FLOW_HUB.y + "' r='" + FLOW_HUB.r + "' fill='" + FIELD_COLOR + "' stroke='" + Ink(0.18) + "' stroke-width='1.5'/>" +
|
|
737
|
+
"<circle cx='" + FLOW_HUB.x + "' cy='" + FLOW_HUB.y + "' r='" + (FLOW_HUB.r + 8) + "' fill='none' stroke='" + Ink(0.05) + "' stroke-width='1'/>" +
|
|
738
|
+
"<text x='" + FLOW_HUB.x + "' y='" + (FLOW_HUB.y - 4) + "' text-anchor='middle' class='t-hub'>Inverter</text>" +
|
|
739
|
+
"<text id='hub-sub' x='" + FLOW_HUB.x + "' y='" + (FLOW_HUB.y + 14) + "' text-anchor='middle' class='t-sub'></text>";
|
|
740
|
+
|
|
741
|
+
return "<svg viewBox='0 0 640 410' style='display:block; width:100%; height:auto; max-height:430px; font-family:inherit'>" +
|
|
742
|
+
"<style>" +
|
|
743
|
+
".flow { fill:none; stroke-dasharray:2 12; stroke-linecap:round; animation: flowmove 1s linear infinite; transition: opacity 0.4s; }" +
|
|
744
|
+
"@keyframes flowmove { to { stroke-dashoffset: -28; } }" +
|
|
745
|
+
".t-title { fill:" + Ink(0.5) + "; font-size:13px; }" +
|
|
746
|
+
".t-value { fill:" + Ink(0.95) + "; font-size:19px; font-weight:bold; }" +
|
|
747
|
+
".t-sub { fill:" + Ink(0.45) + "; font-size:12px; }" +
|
|
748
|
+
".t-hub { fill:" + Ink(0.85) + "; font-size:13px; }" +
|
|
749
|
+
"</style>" +
|
|
750
|
+
lines + hub + nodes +
|
|
751
|
+
"</svg>";
|
|
752
|
+
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
// SVG: Ring gauge of the battery charge, with the reserve mark.
|
|
756
|
+
|
|
757
|
+
const initKpiRow = function () {
|
|
758
|
+
|
|
759
|
+
const KPI_LIST = [
|
|
760
|
+
{ title: "Solar production", iconFile: "light.png", lineColor: SOLAR_COLOR, maxValue: system.pv.peakKw },
|
|
761
|
+
{ title: "Consumption (home + EV)", iconFile: "left-menu/home.png", lineColor: HOME_COLOR, maxValue: 0 },
|
|
762
|
+
{ title: "Grid (import / export)", iconFile: "left-menu/bolt.png", lineColor: GRID_COLOR, maxValue: 0 },
|
|
763
|
+
{ title: "Self-sufficiency now", iconFile: "left-menu/extension.png", lineColor: BATTERY_COLOR, maxValue: 100 },
|
|
764
|
+
];
|
|
765
|
+
|
|
766
|
+
startRow();
|
|
767
|
+
|
|
768
|
+
KPI_LIST.forEach(function (kpi) {
|
|
769
|
+
|
|
770
|
+
const kpiBox = SparkLineBox({
|
|
771
|
+
height: 100,
|
|
772
|
+
title: kpi.title,
|
|
773
|
+
valueText: "",
|
|
774
|
+
iconFile: ASSETS + kpi.iconFile,
|
|
775
|
+
lineColor: kpi.lineColor,
|
|
776
|
+
maxValue: kpi.maxValue,
|
|
777
|
+
// WHY: With a fixed maxValue the scale starts at zero, as the bars did before.
|
|
778
|
+
// maxValue 0 (auto) keeps the automatic range of the line graph.
|
|
779
|
+
minValue: (kpi.maxValue) ? 0 : null,
|
|
780
|
+
style: {
|
|
781
|
+
box: { color: CARD_COLOR, border: 1, borderColor: CARD_BORDER_COLOR, round: 12 },
|
|
782
|
+
text: { padding: 14 },
|
|
783
|
+
title: { fontSize: 13, textColor: Ink(0.5) },
|
|
784
|
+
valueText: { fontSize: 24, textColor: Ink(0.95) },
|
|
785
|
+
trend: { flatColor: Ink(0.45) }, // WHY: The default flat color is made for light cards.
|
|
786
|
+
icon: { width: 20, height: 20 },
|
|
787
|
+
graph: { height: 34, padding: 14 },
|
|
788
|
+
},
|
|
789
|
+
});
|
|
790
|
+
setFlex(kpiBox, "1 1 220px");
|
|
791
|
+
kpiBox.icon.elem.style.filter = T.iconFilter; // WHY: Panel icons are black.
|
|
792
|
+
kpiBox.icon.opacity = 0.5;
|
|
793
|
+
kpiBoxList.push(kpiBox);
|
|
794
|
+
|
|
795
|
+
});
|
|
796
|
+
|
|
797
|
+
endGroup();
|
|
798
|
+
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
const initChartRow = function () {
|
|
802
|
+
|
|
803
|
+
startRow();
|
|
804
|
+
|
|
805
|
+
// LINE: Power today
|
|
806
|
+
chartPower = ChartBox({
|
|
807
|
+
height: 340,
|
|
808
|
+
type: "line",
|
|
809
|
+
theme: T.chartTheme,
|
|
810
|
+
title: "Power Today",
|
|
811
|
+
subtitle: "Every 15 minutes. Battery: + charging, − discharging. Grid: + import, − export.",
|
|
812
|
+
beginAtZero: 0,
|
|
813
|
+
animated: 0,
|
|
814
|
+
legend: "top",
|
|
815
|
+
labels: getChartLabels(),
|
|
816
|
+
datasets: [
|
|
817
|
+
{ label: "Solar", data: [], borderColor: SOLAR_COLOR, fill: "origin", tension: 0.35, backgroundColor: ChartBox.gradient("rgba(232, 176, 74, 0.35)", "rgba(232, 176, 74, 0)") },
|
|
818
|
+
{ label: "Consumption", data: [], borderColor: HOME_COLOR, tension: 0.35 },
|
|
819
|
+
{ label: "Battery", data: [], borderColor: BATTERY_COLOR, tension: 0.35, borderDash: [5, 4] },
|
|
820
|
+
{ label: "Grid", data: [], borderColor: GRID_COLOR, tension: 0.35 },
|
|
821
|
+
],
|
|
822
|
+
formatValue: function (value) { return value + " kW"; },
|
|
823
|
+
options: {
|
|
824
|
+
elements: { point: { radius: 0 } },
|
|
825
|
+
interaction: { mode: "index", intersect: false },
|
|
826
|
+
scales: { x: { ticks: { maxTicksLimit: 9 } } },
|
|
827
|
+
},
|
|
828
|
+
style: {
|
|
829
|
+
box: { color: CARD_COLOR, borderColor: CARD_BORDER_COLOR, round: 12, padding: 16 },
|
|
830
|
+
chart: { colors: [SOLAR_COLOR, HOME_COLOR, BATTERY_COLOR, GRID_COLOR] }, // WHY: The legend uses the theme colors.
|
|
831
|
+
},
|
|
832
|
+
});
|
|
833
|
+
setFlex(chartPower, "2 1 560px");
|
|
834
|
+
chartPower.elem.style.height = "auto";
|
|
835
|
+
chartPower.elem.style.minHeight = "340px";
|
|
836
|
+
|
|
837
|
+
// DOUGHNUT: Energy mix today
|
|
838
|
+
chartMix = ChartBox({
|
|
839
|
+
height: 340,
|
|
840
|
+
type: "doughnut",
|
|
841
|
+
theme: T.chartTheme,
|
|
842
|
+
title: "Energy Mix Today",
|
|
843
|
+
subtitle: "Where the used energy came from",
|
|
844
|
+
legend: "bottom",
|
|
845
|
+
labels: ["Solar", "Battery", "Grid"],
|
|
846
|
+
datasets: [{ data: [0, 0, 0], backgroundColor: [SOLAR_COLOR, BATTERY_COLOR, GRID_COLOR], borderColor: CARD_COLOR, borderWidth: 3 }],
|
|
847
|
+
formatValue: function (value) { return value + " kWh"; },
|
|
848
|
+
options: { cutout: "68%" },
|
|
849
|
+
style: {
|
|
850
|
+
box: { color: CARD_COLOR, borderColor: CARD_BORDER_COLOR, round: 12, padding: 16 },
|
|
851
|
+
},
|
|
852
|
+
});
|
|
853
|
+
setFlex(chartMix, "1 1 320px");
|
|
854
|
+
|
|
855
|
+
endGroup();
|
|
856
|
+
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
const initControlRow = function () {
|
|
860
|
+
|
|
861
|
+
startRow();
|
|
862
|
+
|
|
863
|
+
// BATTERY STRATEGY
|
|
864
|
+
startCard("Battery Strategy", "How the battery is used", "1 1 320px");
|
|
865
|
+
|
|
866
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 10 });
|
|
867
|
+
|
|
868
|
+
MODES.forEach(function (mode) {
|
|
869
|
+
RadioButton({
|
|
870
|
+
group: "energyMode",
|
|
871
|
+
value: mode.value,
|
|
872
|
+
labelText: mode.text + "<br><span style='color:" + Ink(0.4) + "; font-size: 12px'>" + mode.desc + "</span>",
|
|
873
|
+
style: DARK_RADIO_STYLE,
|
|
874
|
+
onChange: function (self) {
|
|
875
|
+
if (isRendering) return;
|
|
876
|
+
system.mode = self.value;
|
|
877
|
+
addEvent("Info", "Battery strategy: " + mode.text);
|
|
878
|
+
renderControls();
|
|
879
|
+
},
|
|
880
|
+
});
|
|
881
|
+
});
|
|
882
|
+
|
|
883
|
+
endGroup();
|
|
884
|
+
|
|
885
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 8 });
|
|
886
|
+
|
|
887
|
+
startSpaceBetween();
|
|
888
|
+
createSmallTitle("Battery reserve");
|
|
889
|
+
lblReserve = Label({ text: "", fontSize: 16, textColor: Ink(0.95) });
|
|
890
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
891
|
+
endGroup();
|
|
892
|
+
|
|
893
|
+
sliderReserve = createSlider(260, WARNING_COLOR,
|
|
894
|
+
function (value) { lblReserve.text = sliderToReserve(value) + "%"; },
|
|
895
|
+
function () {
|
|
896
|
+
const reserve = sliderToReserve(sliderReserve.getValue());
|
|
897
|
+
if (reserve == system.reserve) return;
|
|
898
|
+
system.reserve = reserve;
|
|
899
|
+
addEvent("Info", "Battery reserve set to " + reserve + "%");
|
|
900
|
+
renderControls();
|
|
901
|
+
}
|
|
902
|
+
);
|
|
903
|
+
|
|
904
|
+
lblModeInfo = Label({ text: "", fontSize: 12, textColor: Ink(0.45), width: "100%" });
|
|
905
|
+
|
|
906
|
+
endGroup();
|
|
907
|
+
|
|
908
|
+
endCard();
|
|
909
|
+
|
|
910
|
+
// EV CHARGER
|
|
911
|
+
const evCard = startCard("EV Charger", "WB-22 Wallbox · 230 V", "1 1 320px");
|
|
912
|
+
lblEvState = evCard.lblRight;
|
|
913
|
+
|
|
914
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 6 });
|
|
915
|
+
|
|
916
|
+
evProgress = ProgressBar({
|
|
917
|
+
width: "100%",
|
|
918
|
+
titleText: "Car battery",
|
|
919
|
+
valueFormat: function (self) { return Math.round(self.value) + "% of " + system.ev.targetSoc + "% target"; },
|
|
920
|
+
styleName: "modern",
|
|
921
|
+
style: {
|
|
922
|
+
track: { height: 12, color: Ink(0.08) },
|
|
923
|
+
bar: { color: EV_COLOR },
|
|
924
|
+
successBar: { color: ACCENT_COLOR },
|
|
925
|
+
title: { fontSize: 14, textColor: Ink(0.85) },
|
|
926
|
+
valueText: { fontSize: 13, textColor: Ink(0.6) },
|
|
927
|
+
},
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
lblEvSession = Label({ text: "", fontSize: 12, textColor: Ink(0.45), width: "100%" });
|
|
931
|
+
|
|
932
|
+
endGroup();
|
|
933
|
+
|
|
934
|
+
startSpaceBetween();
|
|
935
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
936
|
+
Label({ text: "Charging", fontSize: 15, textColor: Ink(0.9) });
|
|
937
|
+
Label({ text: "Pause or start the session", fontSize: 12, textColor: Ink(0.45) });
|
|
938
|
+
endGroup();
|
|
939
|
+
toggleEv = createToggle(function (self) {
|
|
940
|
+
system.ev.enabled = self.value;
|
|
941
|
+
addEvent("Info", "EV charging " + ((self.value) ? "started" : "paused") + " by user");
|
|
942
|
+
renderEv();
|
|
943
|
+
});
|
|
944
|
+
endGroup();
|
|
945
|
+
|
|
946
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 8 });
|
|
947
|
+
|
|
948
|
+
startSpaceBetween();
|
|
949
|
+
createSmallTitle("Current limit");
|
|
950
|
+
lblEvLimit = Label({ text: "", fontSize: 16, textColor: Ink(0.95) });
|
|
951
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
952
|
+
endGroup();
|
|
953
|
+
|
|
954
|
+
sliderEvLimit = createSlider(260, EV_COLOR,
|
|
955
|
+
function (value) { lblEvLimit.text = getLimitText(sliderToAmps(value)); },
|
|
956
|
+
function () {
|
|
957
|
+
const amps = sliderToAmps(sliderEvLimit.getValue());
|
|
958
|
+
if (amps == system.ev.limitA) return;
|
|
959
|
+
system.ev.limitA = amps;
|
|
960
|
+
addEvent("Info", "EV current limit set to " + amps + " A");
|
|
961
|
+
renderEv();
|
|
962
|
+
}
|
|
963
|
+
);
|
|
964
|
+
|
|
965
|
+
endGroup();
|
|
966
|
+
|
|
967
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 12 });
|
|
968
|
+
that.elem.style.flexWrap = "wrap";
|
|
969
|
+
that.elem.style.justifyContent = "space-between";
|
|
970
|
+
|
|
971
|
+
chkSolarOnly = CheckBox({
|
|
972
|
+
labelText: "Charge only with excess solar",
|
|
973
|
+
style: DARK_CHECK_STYLE,
|
|
974
|
+
onChange: function (self) {
|
|
975
|
+
if (isRendering) return;
|
|
976
|
+
system.ev.solarOnly = self.checked;
|
|
977
|
+
addEvent("Info", "EV solar-only charging " + ((self.checked) ? "on" : "off"));
|
|
978
|
+
},
|
|
979
|
+
});
|
|
980
|
+
|
|
981
|
+
HGroup({ width: "auto", height: "auto", align: "left center", gap: 8 });
|
|
982
|
+
Label({ text: "Target", fontSize: 13, textColor: Ink(0.5) });
|
|
983
|
+
targetSelect = TinySelect({
|
|
984
|
+
list: TARGET_SOC_LIST.map(function (v) { return { id: String(v), label: v + "%" }; }),
|
|
985
|
+
selectedIndex: TARGET_SOC_LIST.indexOf(system.ev.targetSoc),
|
|
986
|
+
height: 34,
|
|
987
|
+
fontSize: 14,
|
|
988
|
+
color: FIELD_COLOR,
|
|
989
|
+
border: 1,
|
|
990
|
+
borderColor: CARD_BORDER_COLOR,
|
|
991
|
+
round: 8,
|
|
992
|
+
labelBoldFont: 0,
|
|
993
|
+
labelTextColor: Ink(0.9),
|
|
994
|
+
arrowIcon: LIB_PATH + "comp/tiny-select/arrow.svg",
|
|
995
|
+
arrowSize: 16,
|
|
996
|
+
invertIconColor: T.invertIcon,
|
|
997
|
+
listFontSize: 14,
|
|
998
|
+
listTextColor: Ink(0.85),
|
|
999
|
+
listOverTextColor: ACCENT_COLOR,
|
|
1000
|
+
listBackgroundColor: FIELD_COLOR,
|
|
1001
|
+
listBorderColor: Ink(0.15),
|
|
1002
|
+
onSelect: function (index, id) {
|
|
1003
|
+
if (!isReady || isRendering || Number(id) == system.ev.targetSoc) return;
|
|
1004
|
+
system.ev.targetSoc = Number(id);
|
|
1005
|
+
addEvent("Info", "EV target charge set to " + id + "%");
|
|
1006
|
+
renderEv();
|
|
1007
|
+
},
|
|
1008
|
+
});
|
|
1009
|
+
endGroup();
|
|
1010
|
+
|
|
1011
|
+
endGroup();
|
|
1012
|
+
|
|
1013
|
+
btnPlug = createButton("Test: Unplug the car", "", function () { // WHY: Created with a text. A button without a text has no label.
|
|
1014
|
+
system.ev.plugged = (system.ev.plugged) ? 0 : 1;
|
|
1015
|
+
if (system.ev.plugged) system.ev.sessionKwh = 0;
|
|
1016
|
+
addEvent("Info", "Test: EV " + ((system.ev.plugged) ? "plugged in" : "unplugged"));
|
|
1017
|
+
renderEv();
|
|
1018
|
+
});
|
|
1019
|
+
|
|
1020
|
+
endCard();
|
|
1021
|
+
|
|
1022
|
+
// SMART LOADS
|
|
1023
|
+
startCard("Smart Loads", "Devices controlled by the energy hub", "1 1 320px");
|
|
1024
|
+
|
|
1025
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 0 });
|
|
1026
|
+
|
|
1027
|
+
system.loads.forEach(function (load, index) {
|
|
1028
|
+
|
|
1029
|
+
const row = VGroup({ width: "100%", height: "auto", align: "left top", gap: 6 });
|
|
1030
|
+
that.elem.style.padding = "12px 0px";
|
|
1031
|
+
if (index > 0) that.elem.style.borderTop = "1px solid " + Ink(0.06);
|
|
1032
|
+
|
|
1033
|
+
startSpaceBetween();
|
|
1034
|
+
|
|
1035
|
+
HGroup({ width: "auto", height: "auto", align: "left center", gap: 10 });
|
|
1036
|
+
row.dot = Box({ width: 10, height: 10, round: 100, color: Ink(0.2) });
|
|
1037
|
+
row.dot.setMotion("background-color 0.3s");
|
|
1038
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
1039
|
+
Label({ text: load.title, fontSize: 15, textColor: Ink(0.9) });
|
|
1040
|
+
row.lblState = Label({ text: "", fontSize: 12, textColor: Ink(0.45) });
|
|
1041
|
+
endGroup();
|
|
1042
|
+
endGroup();
|
|
1043
|
+
|
|
1044
|
+
row.toggle = createToggle(function (self) {
|
|
1045
|
+
load.enabled = self.value;
|
|
1046
|
+
addEvent("Info", load.title + " " + ((self.value) ? "enabled" : "disabled"));
|
|
1047
|
+
renderLoads();
|
|
1048
|
+
});
|
|
1049
|
+
|
|
1050
|
+
endGroup();
|
|
1051
|
+
|
|
1052
|
+
row.chkSolar = CheckBox({
|
|
1053
|
+
labelText: "Only with excess solar",
|
|
1054
|
+
style: DARK_CHECK_STYLE,
|
|
1055
|
+
onChange: function (self) {
|
|
1056
|
+
if (isRendering) return;
|
|
1057
|
+
load.solarOnly = self.checked;
|
|
1058
|
+
addEvent("Info", load.title + ": only with excess solar " + ((self.checked) ? "on" : "off"));
|
|
1059
|
+
renderLoads();
|
|
1060
|
+
},
|
|
1061
|
+
});
|
|
1062
|
+
row.chkSolar.elem.style.marginLeft = "20px";
|
|
1063
|
+
|
|
1064
|
+
endGroup();
|
|
1065
|
+
|
|
1066
|
+
loadRows[load.key] = row;
|
|
1067
|
+
|
|
1068
|
+
});
|
|
1069
|
+
|
|
1070
|
+
endGroup();
|
|
1071
|
+
|
|
1072
|
+
endCard();
|
|
1073
|
+
|
|
1074
|
+
endGroup();
|
|
1075
|
+
|
|
1076
|
+
};
|
|
1077
|
+
|
|
1078
|
+
const initBottomRow = function () {
|
|
1079
|
+
|
|
1080
|
+
startRow();
|
|
1081
|
+
|
|
1082
|
+
// TARIFF AND SAVINGS
|
|
1083
|
+
startCard("Tariff & Savings", "Time-of-use prices of today", "1 1 380px");
|
|
1084
|
+
|
|
1085
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 6 });
|
|
1086
|
+
|
|
1087
|
+
startSpaceBetween();
|
|
1088
|
+
createSmallTitle("Now");
|
|
1089
|
+
lblTariffNow = Label({ text: "", fontSize: 13, round: 100, border: 1, padding: [10, 3] });
|
|
1090
|
+
endGroup();
|
|
1091
|
+
|
|
1092
|
+
// 24 hours
|
|
1093
|
+
HGroup({ width: "100%", height: 26, align: "left center", gap: 2 });
|
|
1094
|
+
for (let hour = 0; hour < 24; hour++) {
|
|
1095
|
+
const tariff = TARIFFS[getTariffId(hour * 60)];
|
|
1096
|
+
const cell = Box({ width: "auto", height: 26, round: 3, color: ChartBox.alpha(tariff.color, 0.35), border: 2, borderColor: "transparent" });
|
|
1097
|
+
cell.elem.style.flex = "1 1 0";
|
|
1098
|
+
cell.elem.title = formatMinute(hour * 60) + " · " + tariff.text + " " + tariff.price.toFixed(2) + " $/kWh";
|
|
1099
|
+
tariffCells.push(cell);
|
|
1100
|
+
}
|
|
1101
|
+
endGroup();
|
|
1102
|
+
|
|
1103
|
+
startSpaceBetween();
|
|
1104
|
+
["00", "06", "12", "18", "24"].forEach(function (text) { Label({ text: text, fontSize: 11, textColor: Ink(0.35) }); });
|
|
1105
|
+
endGroup();
|
|
1106
|
+
|
|
1107
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 14 });
|
|
1108
|
+
that.elem.style.flexWrap = "wrap";
|
|
1109
|
+
Object.keys(TARIFFS).forEach(function (id) {
|
|
1110
|
+
const tariff = TARIFFS[id];
|
|
1111
|
+
Label({ text: "<span style='color:" + tariff.color + "'>■</span> " + tariff.text + " " + tariff.price.toFixed(2) + " $", fontSize: 12, textColor: Ink(0.6) });
|
|
1112
|
+
});
|
|
1113
|
+
endGroup();
|
|
1114
|
+
|
|
1115
|
+
endGroup();
|
|
1116
|
+
|
|
1117
|
+
// Savings tiles
|
|
1118
|
+
HGroup({ width: "100%", height: "auto", align: "left top", gap: 10 });
|
|
1119
|
+
that.elem.style.flexWrap = "wrap";
|
|
1120
|
+
|
|
1121
|
+
[["savings", "Saved today", ACCENT_COLOR], ["co2", "CO₂ avoided", SOLAR_COLOR], ["import", "Grid import", GRID_COLOR], ["export", "Grid export", ACCENT_COLOR]].forEach(function (item) {
|
|
1122
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 2, padding: [12, 10], color: FIELD_COLOR, round: 10 });
|
|
1123
|
+
setFlex(that, "1 1 120px");
|
|
1124
|
+
Label({ text: item[1], fontSize: 12, textColor: Ink(0.5) });
|
|
1125
|
+
savingsLabels[item[0]] = Label({ text: "", fontSize: 20, textColor: item[2] });
|
|
1126
|
+
endGroup();
|
|
1127
|
+
});
|
|
1128
|
+
|
|
1129
|
+
endGroup();
|
|
1130
|
+
|
|
1131
|
+
endCard();
|
|
1132
|
+
|
|
1133
|
+
// EVENT LOG
|
|
1134
|
+
startCard("Event Log", "Last 10 events (simulated time)", "2 1 520px");
|
|
1135
|
+
|
|
1136
|
+
grpEventTable = HGroup({ width: "100%", height: "auto", align: "left top" });
|
|
1137
|
+
that.elem.style.overflowX = "auto";
|
|
1138
|
+
endGroup();
|
|
1139
|
+
|
|
1140
|
+
endCard();
|
|
1141
|
+
|
|
1142
|
+
endGroup();
|
|
1143
|
+
|
|
1144
|
+
};
|
|
1145
|
+
|
|
1146
|
+
// *** VALUE CONVERTERS:
|
|
1147
|
+
|
|
1148
|
+
const sliderToReserve = function (value) {
|
|
1149
|
+
return Math.round((10 + value * 0.8) / 5) * 5; // 10% - 90%
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
const reserveToSlider = function (reserve) {
|
|
1153
|
+
return (reserve - 10) / 0.8;
|
|
1154
|
+
};
|
|
1155
|
+
|
|
1156
|
+
const sliderToAmps = function (value) {
|
|
1157
|
+
return Math.round(6 + value / 100 * 26); // 6 A - 32 A
|
|
1158
|
+
};
|
|
1159
|
+
|
|
1160
|
+
const ampsToSlider = function (amps) {
|
|
1161
|
+
return (amps - 6) / 26 * 100;
|
|
1162
|
+
};
|
|
1163
|
+
|
|
1164
|
+
const getLimitText = function (amps) {
|
|
1165
|
+
return amps + " A · " + (amps * 230 / 1000).toFixed(1) + " kW";
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1168
|
+
// *** RENDER:
|
|
1169
|
+
|
|
1170
|
+
const renderAll = function () {
|
|
1171
|
+
renderControls();
|
|
1172
|
+
renderEv();
|
|
1173
|
+
renderLoads();
|
|
1174
|
+
renderLive();
|
|
1175
|
+
renderChart();
|
|
1176
|
+
renderEvents();
|
|
1177
|
+
};
|
|
1178
|
+
|
|
1179
|
+
// Every second
|
|
1180
|
+
const renderLive = function () {
|
|
1181
|
+
renderHeader();
|
|
1182
|
+
renderFlow();
|
|
1183
|
+
renderBattery();
|
|
1184
|
+
renderKpis();
|
|
1185
|
+
renderTariff();
|
|
1186
|
+
renderEvLive();
|
|
1187
|
+
renderLoads();
|
|
1188
|
+
if (simMinute % CHART_STEP == 0) renderChart();
|
|
1189
|
+
};
|
|
1190
|
+
|
|
1191
|
+
const renderHeader = function () {
|
|
1192
|
+
|
|
1193
|
+
lblClock.text = formatMinute(simMinute);
|
|
1194
|
+
const cloud = system.pv.cloud;
|
|
1195
|
+
const hour = simMinute / 60;
|
|
1196
|
+
const isDay = hour > 6.3 && hour < 19.7;
|
|
1197
|
+
const weather = (!isDay) ? "☾ Night" : (cloud > 0.8) ? "☀ Sunny" : (cloud > 0.5) ? "⛅ Partly cloudy" : "☁ Cloudy";
|
|
1198
|
+
lblWeather.text = weather + " · 1 s = 1 min (simulation)";
|
|
1199
|
+
|
|
1200
|
+
if (!system.gridOnline) {
|
|
1201
|
+
setPill(lblStatus, "● Power cut · Battery backup", ERROR_COLOR);
|
|
1202
|
+
} else if (system.now.grid < -0.05) {
|
|
1203
|
+
setPill(lblStatus, "● Online · Exporting to the grid", ACCENT_COLOR);
|
|
1204
|
+
} else if (system.now.grid > 0.05) {
|
|
1205
|
+
setPill(lblStatus, "● Online · Using the grid", GRID_COLOR);
|
|
1206
|
+
} else {
|
|
1207
|
+
setPill(lblStatus, "● Online · Self-powered", ACCENT_COLOR);
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
moreMenu.setItemEnabled("cut", system.gridOnline == 1);
|
|
1211
|
+
moreMenu.setItemEnabled("back", system.gridOnline == 0);
|
|
1212
|
+
|
|
1213
|
+
};
|
|
1214
|
+
|
|
1215
|
+
// Sets the dash animation of a line. direction: 1 (to the inverter), -1 (from the inverter)
|
|
1216
|
+
const setFlowLine = function (key, kw, direction) {
|
|
1217
|
+
const path = flow.svg.querySelector("#flow-" + key);
|
|
1218
|
+
const active = Math.abs(kw) >= 0.05;
|
|
1219
|
+
path.style.opacity = (active) ? 1 : 0;
|
|
1220
|
+
path.style.animationDuration = Math.max(0.35, Math.min(2.2, 2.4 - Math.abs(kw) * 0.28)).toFixed(2) + "s";
|
|
1221
|
+
path.style.animationDirection = (direction > 0) ? "normal" : "reverse";
|
|
1222
|
+
};
|
|
1223
|
+
|
|
1224
|
+
const setNodeText = function (key, value, sub) {
|
|
1225
|
+
flow.svg.querySelector("#value-" + key).textContent = value;
|
|
1226
|
+
flow.svg.querySelector("#sub-" + key).textContent = sub;
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
const renderFlow = function () {
|
|
1230
|
+
|
|
1231
|
+
const n = system.now;
|
|
1232
|
+
const b = system.battery;
|
|
1233
|
+
|
|
1234
|
+
setFlowLine("solar", n.solar, 1);
|
|
1235
|
+
setNodeText("solar", formatKw(n.solar), (n.solar > 0.05) ? Math.round(n.solar / system.pv.peakKw * 100) + "% of peak" : "No sun");
|
|
1236
|
+
|
|
1237
|
+
setFlowLine("grid", n.grid, (n.grid >= 0) ? 1 : -1);
|
|
1238
|
+
setNodeText("grid", (system.gridOnline) ? formatKw(n.grid) : "Offline", (!system.gridOnline) ? "Power cut" : (n.grid > 0.05) ? "Import" : (n.grid < -0.05) ? "Export" : "Idle");
|
|
1239
|
+
flow.svg.querySelector("#node-grid").setAttribute("stroke", (system.gridOnline) ? ChartBox.alpha(GRID_COLOR, 0.6) : ERROR_COLOR);
|
|
1240
|
+
|
|
1241
|
+
setFlowLine("home", n.home, -1);
|
|
1242
|
+
setNodeText("home", formatKw(n.home), system.loads.filter(function (l) { return l.running; }).length + " smart loads on");
|
|
1243
|
+
|
|
1244
|
+
setFlowLine("battery", n.battery, (n.battery > 0) ? -1 : 1);
|
|
1245
|
+
setNodeText("battery", Math.round(b.soc) + "%", (n.battery > 0.05) ? "Charging " + formatKw(n.battery) : (n.battery < -0.05) ? "Discharging " + formatKw(n.battery) : "Idle");
|
|
1246
|
+
const level = flow.svg.querySelector("#icon-battery .level");
|
|
1247
|
+
const levelHeight = 23 * b.soc / 100;
|
|
1248
|
+
level.setAttribute("height", levelHeight.toFixed(1));
|
|
1249
|
+
level.setAttribute("y", (12.5 - levelHeight).toFixed(1));
|
|
1250
|
+
level.setAttribute("fill", (b.soc <= system.reserve) ? WARNING_COLOR : BATTERY_COLOR);
|
|
1251
|
+
|
|
1252
|
+
setFlowLine("ev", n.ev, -1);
|
|
1253
|
+
setNodeText("ev", formatKw(n.ev), (system.ev.plugged) ? "Car " + Math.round(system.ev.carSoc) + "%" : "Unplugged");
|
|
1254
|
+
|
|
1255
|
+
flow.svg.querySelector("#hub-sub").textContent = system.inverter.efficiency + "% eff.";
|
|
1256
|
+
|
|
1257
|
+
};
|
|
1258
|
+
|
|
1259
|
+
const renderBattery = function () {
|
|
1260
|
+
|
|
1261
|
+
const b = system.battery;
|
|
1262
|
+
const kw = system.now.battery;
|
|
1263
|
+
const reserve = (system.mode == "backup") ? Math.max(80, system.reserve) : system.reserve;
|
|
1264
|
+
const color = (b.soc <= reserve) ? WARNING_COLOR : BATTERY_COLOR;
|
|
1265
|
+
|
|
1266
|
+
gaugeBattery.setValue(Math.round(b.soc));
|
|
1267
|
+
gaugeBattery.setBarColor(color);
|
|
1268
|
+
gaugeBattery.setMarkerValue(reserve);
|
|
1269
|
+
gaugeBattery.setSubText((kw > 0.05) ? "Charging" : (kw < -0.05) ? "Discharging" : "Idle");
|
|
1270
|
+
|
|
1271
|
+
batteryInfo.power.text = (kw > 0.05) ? "+" + formatKw(kw) : (kw < -0.05) ? "−" + formatKw(kw) : "0 kW";
|
|
1272
|
+
batteryInfo.power.textColor = (kw > 0.05) ? ACCENT_COLOR : (kw < -0.05) ? WARNING_COLOR : Ink(0.9);
|
|
1273
|
+
|
|
1274
|
+
let estimate = "—";
|
|
1275
|
+
if (kw > 0.05) estimate = "Full in " + formatDuration((100 - b.soc) / 100 * b.capacity / kw);
|
|
1276
|
+
if (kw < -0.05) estimate = "Reserve in " + formatDuration(Math.max(0, b.soc - reserve) / 100 * b.capacity / -kw);
|
|
1277
|
+
batteryInfo.time.text = estimate;
|
|
1278
|
+
batteryInfo.reserve.text = reserve + "%" + ((system.mode == "backup") ? " (backup)" : "");
|
|
1279
|
+
batteryInfo.temp.text = b.temp.toFixed(1) + " °C";
|
|
1280
|
+
batteryInfo.health.text = b.health + "% · " + b.cycles + " cycles";
|
|
1281
|
+
|
|
1282
|
+
setPill(batteryInfo.card.lblRight, (b.soc <= reserve) ? "Low" : (b.soc >= 99.5) ? "Full" : "Normal", (b.soc <= reserve) ? WARNING_COLOR : ACCENT_COLOR);
|
|
1283
|
+
|
|
1284
|
+
};
|
|
1285
|
+
|
|
1286
|
+
const formatDuration = function (hours) {
|
|
1287
|
+
if (!isFinite(hours)) return "—";
|
|
1288
|
+
const minutes = Math.round(hours * 60);
|
|
1289
|
+
return (minutes >= 60) ? Math.floor(minutes / 60) + " h " + (minutes % 60) + " min" : minutes + " min";
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1292
|
+
const renderKpis = function () {
|
|
1293
|
+
|
|
1294
|
+
const n = system.now;
|
|
1295
|
+
const h = system.history;
|
|
1296
|
+
const last = h.solar.length - 1;
|
|
1297
|
+
|
|
1298
|
+
kpiBoxList[0].setValueText(formatKw(n.solar));
|
|
1299
|
+
kpiBoxList[1].setValueText(formatKw(n.home + n.ev));
|
|
1300
|
+
kpiBoxList[2].setValueText(((n.grid > 0.05) ? "↓ " : (n.grid < -0.05) ? "↑ " : "") + ((system.gridOnline) ? formatKw(n.grid) : "Offline"));
|
|
1301
|
+
kpiBoxList[3].setValueText(h.selfUse[last] + "%");
|
|
1302
|
+
|
|
1303
|
+
kpiBoxList[0].setValues(h.solar);
|
|
1304
|
+
kpiBoxList[1].setValues(h.home);
|
|
1305
|
+
kpiBoxList[2].setValues(h.grid);
|
|
1306
|
+
kpiBoxList[3].setValues(h.selfUse);
|
|
1307
|
+
|
|
1308
|
+
};
|
|
1309
|
+
|
|
1310
|
+
const renderTariff = function () {
|
|
1311
|
+
|
|
1312
|
+
const tariffId = getTariffId(simMinute);
|
|
1313
|
+
const tariff = TARIFFS[tariffId];
|
|
1314
|
+
setPill(lblTariffNow, tariff.text + " · " + tariff.price.toFixed(2) + " $/kWh", tariff.color);
|
|
1315
|
+
|
|
1316
|
+
const hour = Math.floor(simMinute / 60);
|
|
1317
|
+
tariffCells.forEach(function (cell, index) {
|
|
1318
|
+
cell.borderColor = (index == hour) ? Ink(0.9) : "transparent";
|
|
1319
|
+
cell.opacity = (index < hour) ? 0.5 : 1;
|
|
1320
|
+
});
|
|
1321
|
+
|
|
1322
|
+
const t = system.today;
|
|
1323
|
+
savingsLabels.savings.text = "$" + t.savings.toFixed(2);
|
|
1324
|
+
savingsLabels.co2.text = t.co2.toFixed(1) + " kg";
|
|
1325
|
+
savingsLabels.import.text = t.import.toFixed(1) + " kWh";
|
|
1326
|
+
savingsLabels.export.text = t.export.toFixed(1) + " kWh";
|
|
1327
|
+
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1330
|
+
const renderChart = function () {
|
|
1331
|
+
|
|
1332
|
+
const c = system.chart;
|
|
1333
|
+
chartPower.whenReady(function () {
|
|
1334
|
+
chartPower.data.datasets[0].data = c.solar.slice();
|
|
1335
|
+
chartPower.data.datasets[1].data = c.consumption.slice();
|
|
1336
|
+
chartPower.data.datasets[2].data = c.battery.slice();
|
|
1337
|
+
chartPower.data.datasets[3].data = c.grid.slice();
|
|
1338
|
+
chartPower.update("none");
|
|
1339
|
+
});
|
|
1340
|
+
|
|
1341
|
+
// Energy mix: solar used directly = consumption - grid import - battery discharge
|
|
1342
|
+
const t = system.today;
|
|
1343
|
+
const fromBattery = t.discharge;
|
|
1344
|
+
const fromGrid = t.import;
|
|
1345
|
+
const fromSolar = Math.max(0, t.consumption - fromGrid - fromBattery);
|
|
1346
|
+
chartMix.whenReady(function () {
|
|
1347
|
+
chartMix.data.datasets[0].data = [round2(fromSolar), round2(fromBattery), round2(fromGrid)];
|
|
1348
|
+
chartMix.update();
|
|
1349
|
+
});
|
|
1350
|
+
|
|
1351
|
+
};
|
|
1352
|
+
|
|
1353
|
+
// Battery strategy controls
|
|
1354
|
+
const renderControls = function () {
|
|
1355
|
+
|
|
1356
|
+
isRendering = 1;
|
|
1357
|
+
|
|
1358
|
+
RadioButton.setValue("energyMode", system.mode, 1);
|
|
1359
|
+
lblReserve.text = system.reserve + "%";
|
|
1360
|
+
if (sliderToReserve(sliderReserve.getValue()) != system.reserve) sliderReserve.setValue(reserveToSlider(system.reserve));
|
|
1361
|
+
|
|
1362
|
+
const info = {
|
|
1363
|
+
self: "The battery is used down to the reserve. The reserve is kept for power cuts.",
|
|
1364
|
+
backup: "Backup keeps at least 80% charge. It charges from the grid when it is lower.",
|
|
1365
|
+
tou: "Charges from the grid at night (" + TARIFFS.night.price.toFixed(2) + " $), discharges at peak (" + TARIFFS.peak.price.toFixed(2) + " $) down to the reserve.",
|
|
1366
|
+
};
|
|
1367
|
+
lblModeInfo.text = info[system.mode];
|
|
1368
|
+
|
|
1369
|
+
isRendering = 0;
|
|
1370
|
+
|
|
1371
|
+
};
|
|
1372
|
+
|
|
1373
|
+
// EV settings (on change)
|
|
1374
|
+
const renderEv = function () {
|
|
1375
|
+
|
|
1376
|
+
const ev = system.ev;
|
|
1377
|
+
isRendering = 1;
|
|
1378
|
+
|
|
1379
|
+
if (toggleEv.value !== ev.enabled) toggleEv.setValue(ev.enabled);
|
|
1380
|
+
lblEvLimit.text = getLimitText(ev.limitA);
|
|
1381
|
+
if (sliderToAmps(sliderEvLimit.getValue()) != ev.limitA) sliderEvLimit.setValue(ampsToSlider(ev.limitA));
|
|
1382
|
+
chkSolarOnly.setChecked(ev.solarOnly, 1);
|
|
1383
|
+
const index = TARGET_SOC_LIST.indexOf(ev.targetSoc);
|
|
1384
|
+
if (index >= 0 && index != targetSelect.selectedIndex) targetSelect.setSelectedIndex(index);
|
|
1385
|
+
|
|
1386
|
+
btnPlug.setText((ev.plugged) ? "Test: Unplug the car" : "Test: Plug in the car");
|
|
1387
|
+
[toggleEv, sliderEvLimit, chkSolarOnly, targetSelect].forEach(function (obj) { setInteractive(obj, ev.plugged == 1); });
|
|
1388
|
+
|
|
1389
|
+
isRendering = 0;
|
|
1390
|
+
renderEvLive();
|
|
1391
|
+
|
|
1392
|
+
};
|
|
1393
|
+
|
|
1394
|
+
// EV state (every second)
|
|
1395
|
+
const renderEvLive = function () {
|
|
1396
|
+
|
|
1397
|
+
const ev = system.ev;
|
|
1398
|
+
const colors = { "Charging": EV_COLOR, "Charging with solar": SOLAR_COLOR, "Complete": ACCENT_COLOR, "Unplugged": "#898781" };
|
|
1399
|
+
setPill(lblEvState, ev.state, colors[ev.state] || WARNING_COLOR);
|
|
1400
|
+
|
|
1401
|
+
evProgress.setValue(Math.floor(ev.carSoc), 1);
|
|
1402
|
+
evProgress.setStatus((ev.state == "Complete") ? "success" : "normal");
|
|
1403
|
+
evProgress.setTitleText((ev.plugged) ? "Car battery · " + Math.round(ev.carSoc / 100 * ev.carCapacity) + " / " + ev.carCapacity + " kWh" : "No car connected");
|
|
1404
|
+
|
|
1405
|
+
const remaining = (ev.targetSoc - ev.carSoc) / 100 * ev.carCapacity;
|
|
1406
|
+
const kw = system.now.ev;
|
|
1407
|
+
lblEvSession.text = "Session: " + ev.sessionKwh.toFixed(1) + " kWh" +
|
|
1408
|
+
((kw > 0.05 && remaining > 0) ? " · Target in " + formatDuration(remaining / (kw * 0.92)) : "") +
|
|
1409
|
+
" · Today: " + system.today.ev.toFixed(1) + " kWh";
|
|
1410
|
+
|
|
1411
|
+
};
|
|
1412
|
+
|
|
1413
|
+
const renderLoads = function () {
|
|
1414
|
+
|
|
1415
|
+
isRendering = 1;
|
|
1416
|
+
|
|
1417
|
+
system.loads.forEach(function (load) {
|
|
1418
|
+
const row = loadRows[load.key];
|
|
1419
|
+
if (row.toggle.value !== load.enabled) row.toggle.setValue(load.enabled);
|
|
1420
|
+
row.chkSolar.setChecked(load.solarOnly, 1);
|
|
1421
|
+
setInteractive(row.chkSolar, load.enabled == 1);
|
|
1422
|
+
|
|
1423
|
+
let state = "Off", color = Ink(0.2);
|
|
1424
|
+
if (load.enabled && load.running) { state = "Running · " + load.kw + " kW"; color = (load.solarOnly) ? SOLAR_COLOR : HOME_COLOR; }
|
|
1425
|
+
else if (load.enabled && load.solarOnly) { state = "Waiting for excess solar (" + load.kw + " kW)"; color = WARNING_COLOR; }
|
|
1426
|
+
else if (load.enabled) { state = "On, not running now"; color = Ink(0.35); }
|
|
1427
|
+
row.lblState.text = state;
|
|
1428
|
+
row.dot.color = color;
|
|
1429
|
+
});
|
|
1430
|
+
|
|
1431
|
+
isRendering = 0;
|
|
1432
|
+
|
|
1433
|
+
};
|
|
1434
|
+
|
|
1435
|
+
const renderEvents = function () {
|
|
1436
|
+
|
|
1437
|
+
if (eventTable) eventTable.remove();
|
|
1438
|
+
|
|
1439
|
+
const previous = getDefaultContainerBox();
|
|
1440
|
+
setDefaultContainerBox(grpEventTable);
|
|
1441
|
+
|
|
1442
|
+
eventTable = TinyTable({
|
|
1443
|
+
columns: Theme.tableColumns(["TIME", "LEVEL", "MESSAGE"], ["12%", "14%", "73%"]),
|
|
1444
|
+
rows: system.events.slice(0, 10).map(function (e) { return [e.time, e.level, e.message]; }),
|
|
1445
|
+
allowHtml: 1, // (the texts are made by the panel, user texts are escaped)
|
|
1446
|
+
style: Theme.tableStyle({ headerColor: FIELD_COLOR, bodyColor: CARD_COLOR, borderColor: CARD_BORDER_COLOR }),
|
|
1447
|
+
onCellCreate: function (cell) {
|
|
1448
|
+
if (cell.columnIndex == 0) cell.label.textColor = Ink(0.5);
|
|
1449
|
+
if (cell.columnIndex == 1) cell.label.textColor = LEVEL_COLORS[cell.value] || Ink(0.8);
|
|
1450
|
+
},
|
|
1451
|
+
});
|
|
1452
|
+
Theme.fillTableWidth(eventTable);
|
|
1453
|
+
eventTable.elem.style.minWidth = "520px";
|
|
1454
|
+
|
|
1455
|
+
setDefaultContainerBox(previous);
|
|
1456
|
+
|
|
1457
|
+
};
|
|
1458
|
+
|
|
1459
|
+
// *** ACTIONS:
|
|
1460
|
+
|
|
1461
|
+
const onMoreMenuClick = function (key) {
|
|
1462
|
+
|
|
1463
|
+
switch (key) {
|
|
1464
|
+
|
|
1465
|
+
case "cut":
|
|
1466
|
+
Theme.confirm({
|
|
1467
|
+
titleText: "Test a Power Cut",
|
|
1468
|
+
messageText: "The grid will be offline. The battery powers the home, EV charging pauses and solar export stops.",
|
|
1469
|
+
confirmText: "Start Test",
|
|
1470
|
+
onAnswer: function (isConfirmed) {
|
|
1471
|
+
if (isConfirmed) setGridOnline(0);
|
|
1472
|
+
},
|
|
1473
|
+
});
|
|
1474
|
+
break;
|
|
1475
|
+
|
|
1476
|
+
case "back":
|
|
1477
|
+
setGridOnline(1);
|
|
1478
|
+
break;
|
|
1479
|
+
|
|
1480
|
+
case "cloud":
|
|
1481
|
+
passCloud();
|
|
1482
|
+
break;
|
|
1483
|
+
|
|
1484
|
+
case "csv":
|
|
1485
|
+
downloadReport();
|
|
1486
|
+
break;
|
|
1487
|
+
|
|
1488
|
+
case "copy":
|
|
1489
|
+
navigator.clipboard.writeText(system.inverter.serial).then(function () {
|
|
1490
|
+
addEvent("Info", "Serial number copied: " + system.inverter.serial);
|
|
1491
|
+
}).catch(function () {
|
|
1492
|
+
addEvent("Error", "Serial number could not be copied");
|
|
1493
|
+
});
|
|
1494
|
+
break;
|
|
1495
|
+
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
};
|
|
1499
|
+
|
|
1500
|
+
</script>
|
|
1501
|
+
|
|
1502
|
+
</head>
|
|
1503
|
+
<body>
|
|
1504
|
+
|
|
1505
|
+
<!-- HTML content -->
|
|
1506
|
+
|
|
1507
|
+
</body>
|
|
1508
|
+
</html>
|