-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Config UI: visualize Messaging #25768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 89 commits
Commits
Show all changes
123 commits
Select commit
Hold shift + click to select a range
018d87f
publish
Maschga 18ca2cf
migrate to json
Maschga 11002da
lowercase
Maschga 5fba740
add messaging types
Maschga 87cabc6
rework modal
Maschga 9a5a25f
add service types
Maschga 069b341
wip
Maschga de557af
add forms
Maschga c2a4118
wip
Maschga 01b7724
lint
Maschga aa19a5f
Merge branch 'master' into config-ui/messaging
naltatis dd4d8d1
component per service
Maschga 0d78279
move to json handler
Maschga 02fcf54
Merge branch 'config-ui/messaging' of https://github.com/Maschga/evcc…
Maschga 399d44b
create messaging folder
Maschga cb6ec11
component for event
Maschga 8e277a7
remove debug
Maschga fe1f83d
add disabled property
Maschga e32e010
show number of enabled events
Maschga 1ba382d
use dropdown button
Maschga d7d8bf0
lint
Maschga 94fba21
fix messaging configured tag
Maschga d23dae3
add translations to services tab
Maschga 663b35b
wip
Maschga 93db3b3
add translations to events tab
Maschga eba6f1f
lint
Maschga caf292d
capitalize
Maschga 534cdab
use only enabled events
Maschga 91aae78
fix bad syntax
Maschga a7dbafe
Merge branch 'master' into config-ui/messaging
Maschga bbc27b8
remove debug
Maschga c8a182c
fix configured tag
Maschga 3b43fa9
wip: tests
Maschga 8863bf3
show amount in tags
Maschga 1d4f33d
wip: tests
Maschga 4fc2c20
add examples
Maschga 493ab67
lint
Maschga f221692
wip: tests
Maschga 73fac35
fix
Maschga adfeede
normalize messaging custom send
Maschga 5b18678
wip: tests
Maschga 9903ff9
fix test
Maschga 4a6e3bc
porcelain
Maschga 8d5ddee
wip
Maschga 419adbe
fix test
Maschga 64dabc7
wip
Maschga 1d35a51
test: validate events
Maschga 91e7108
rename nfty to ntfy
Maschga f308324
Merge branch 'master' into config-ui/messaging
Maschga 4209ee5
Merge branch 'master' into config-ui/messaging
Maschga 4ae4baf
Update assets/js/components/Config/Messaging/Services/CustomService.vue
Maschga 07d4904
use flat types
Maschga 6d21ada
enabled => disabled
Maschga 14d118e
redact mechanism
Maschga 8168774
use MessagingFormRow
Maschga 59d612a
remove "messaging"
Maschga f559f1b
add rows prop
Maschga 890661e
fix
Maschga 0f0a08d
refactor email service
Maschga 4fc4d7d
move file
Maschga 4cb92c1
telegram: parse chats to number
Maschga f33673a
Merge branch 'master' into config-ui/messaging
Maschga d3e9343
fix
Maschga 8ade466
better redact; fix
Maschga b858165
add ntfy authtoken
Maschga 98bcc0a
fix: redact
Maschga 9fd85f7
add planoverrun event
Maschga 15cf241
use checked
Maschga 267c635
fix
Maschga aaacb28
custom service: make send an object
Maschga f47769e
email migration: split uri
Maschga fa04d0b
test: redact password
Maschga 0d618bf
lint
Maschga e7f525d
refactor migration
Maschga 37558e6
lint
Maschga 9b9521a
ntfy migration: split uri
Maschga a03338f
lint
Maschga 0f8c68e
use v-models, events
Maschga 0fbc425
install js-yaml
Maschga c78250e
use js-yaml; add format and save button
Maschga eecac47
fix
Maschga 29a0e7d
Merge branch 'master' into config-ui/messaging
Maschga 58bd61c
use textarea() for accessToken and refreshToken
Maschga 0a02c0f
revert
Maschga 66a2209
fix
Maschga 61986c5
add newline
Maschga 3ef36b5
add license Python-2.0
Maschga 5084b46
Merge branch 'master' into config-ui/messaging
Maschga 219cabf
Merge branch 'master' into config-ui/messaging
naltatis 616a2b5
small ui improvements; completed i18n; rows handling; fixed help link…
naltatis 99b17b7
Merge branch 'master' into config-ui/messaging
naltatis f96b234
uninstall js-yaml; parse send to string; remove format-button
Maschga d737c74
fix
Maschga 633a131
porcelain
Maschga 3f7522a
fix ntfy
Maschga ab8bc62
fix telegram
Maschga e6d3533
fix pushover
Maschga 0f051f8
fix custom
Maschga d6b52dd
fix strings
Maschga 5af93bc
porcelain
Maschga 4cf7515
Merge branch 'master' into config-ui/messaging
Maschga 0d5d573
fix email
Maschga ec1f0cf
fix email
Maschga 808812e
improve messaging tags
Maschga 5a09466
syntax
Maschga 89d2774
merge: preserve slices
Maschga 9619cb4
Merge branch 'master' into config-ui/messaging
Maschga e4dbe0b
add test: add and remove service
Maschga 7895c1f
ntfy: add urls
Maschga f457c10
fix/finalize redaction
Maschga 110e9a6
sourcery review
Maschga 6cd5628
fix
Maschga 7a377cf
simplify redact
naltatis b7fa5a7
simplify custom
naltatis 8c06415
simplify mail
naltatis 60b4564
simplify services
naltatis 9b27a5a
simplfy tempalte; reduce const use, keep type safety
naltatis e3b1638
compacter e2e test
naltatis a2a896e
revert js-yaml
naltatis 9437c6d
revert js-yaml
naltatis 7d70fb2
Merge remote-tracking branch 'origin/master' into config-ui/messaging
naltatis 8b47aef
Merge branch 'master' into config-ui/messaging
Maschga 65b28e3
wip
Maschga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| <template> | ||
| <div> | ||
| <div class="d-flex align-items-center mb-3"> | ||
| <div class="form-switch me-2"> | ||
| <input | ||
| :checked="!disabled" | ||
| class="form-check-input" | ||
| type="checkbox" | ||
| role="switch" | ||
| :data-testid="`event-${type}-switch`" | ||
| tabindex="0" | ||
| @change="updateDisabled(($event.target as HTMLInputElement).checked)" | ||
| /> | ||
| </div> | ||
| <h6 class="my-0">{{ $t(`config.messaging.event.${type}.title`) }}</h6> | ||
| </div> | ||
| <div class="container"></div> | ||
| <div class="row mb-3"> | ||
| <div class="col-2 col-form-label"> | ||
| <label :for="formId('title')"> Title </label> | ||
| </div> | ||
| <div class="col-10"> | ||
| <PropertyField | ||
| :id="formId('title')" | ||
| :model-value="title" | ||
| :data-testid="`event-${type}-title`" | ||
| type="String" | ||
| :disabled="disabled" | ||
| required | ||
| @change="updateTitle($event.target.value)" | ||
| /> | ||
| </div> | ||
| </div> | ||
| <div class="row"> | ||
| <div class="col-2 col-form-label"> | ||
| <label :for="formId('message')"> Message </label> | ||
| </div> | ||
| <div class="col-10"> | ||
| <PropertyField | ||
| :id="formId('message')" | ||
| :model-value="message" | ||
| :data-testid="`event-${type}-message`" | ||
| type="String" | ||
| property="eventMessage" | ||
| :disabled="disabled" | ||
| required | ||
| rows | ||
| @change="updateMessage($event.target.value)" | ||
| /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script lang="ts"> | ||
| import type { PropType } from "vue"; | ||
| import { MESSAGING_EVENTS } from "@/types/evcc"; | ||
| import PropertyField from "../PropertyField.vue"; | ||
|
|
||
| export default { | ||
| name: "EventItem", | ||
| components: { PropertyField }, | ||
| props: { | ||
| type: { type: String as PropType<MESSAGING_EVENTS>, required: true }, | ||
| disabled: { type: Boolean, required: true }, | ||
| title: { type: String, required: true }, | ||
| message: { type: String, required: true }, | ||
| }, | ||
| emits: ["update:disabled", "update:title", "update:message"], | ||
| mounted() { | ||
| if (!this.title) { | ||
| this.updateTitle(this.$t(`config.messaging.event.${this.type}.titleDefault`)); | ||
| } | ||
|
|
||
| if (!this.message || this.message === "") { | ||
| let p = {}; | ||
|
|
||
| switch (this.type) { | ||
| case MESSAGING_EVENTS.ASLEEP: | ||
| p = { vehicleName: "{{ if .vehicleTitle }}{{ .vehicleTitle }} {{ end }}" }; | ||
| break; | ||
| case MESSAGING_EVENTS.CONNECT: | ||
| p = { pvPower: "${pvPower:%.1fk}" }; | ||
| break; | ||
| case MESSAGING_EVENTS.DISCONNECT: | ||
| p = { connectedDuration: "${connectedDuration}" }; | ||
| break; | ||
| case MESSAGING_EVENTS.SOC: | ||
| p = { vehicleSoc: "${vehicleSoc:%.0f}" }; | ||
| break; | ||
| case MESSAGING_EVENTS.START: | ||
| p = { mode: "${mode}" }; | ||
| break; | ||
| case MESSAGING_EVENTS.STOP: | ||
| p = { | ||
| chargedEnergy: "${chargedEnergy:%.1fk}", | ||
| chargeDuration: "${chargeDuration}", | ||
| }; | ||
| break; | ||
| case MESSAGING_EVENTS.PLANOVERRUN: | ||
| p = { | ||
| vehicleTitle: "{{ if .vehicleTitle }} {{ .vehicleTitle }} {{end}}", | ||
| }; | ||
| break; | ||
| } | ||
|
|
||
| this.updateMessage(this.$t(`config.messaging.event.${this.type}.messageDefault`, p)); | ||
| } | ||
| }, | ||
| methods: { | ||
| formId(name: string) { | ||
| return `messaging-event-${this.type}-${name}`; | ||
| }, | ||
| updateDisabled(newValue: boolean) { | ||
| this.$emit("update:disabled", !newValue); | ||
| }, | ||
| updateTitle(newValue: string) { | ||
| this.$emit("update:title", newValue); | ||
| }, | ||
| updateMessage(newValue: string) { | ||
| this.$emit("update:message", newValue); | ||
| }, | ||
| }, | ||
| }; | ||
| </script> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.