-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Optimizer: enable by default #28213
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
Merged
Merged
Optimizer: enable by default #28213
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2990bd1
Optimizer: enable by default
andig 1f961ca
Merge branch 'master' into feat/optimizer-2
naltatis 21def1d
add optimizer setting
naltatis 57cab79
update description
naltatis 271b347
optimizer.evcc.io
naltatis 9b39b70
drop dirty checking
naltatis 1568e4e
external > evcc
naltatis 570196f
fmt
naltatis 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| <template> | ||
| <GenericModal | ||
| id="optimizerModal" | ||
| :title="$t('config.optimizer.title')" | ||
| config-modal-name="optimizer" | ||
| data-testid="optimizer-modal" | ||
| > | ||
| <p> | ||
| {{ $t("config.optimizer.description") }} | ||
| <a :href="docsLink" target="_blank">{{ $t("config.general.docsLink") }}</a> | ||
| </p> | ||
| <ErrorMessage :error="error" /> | ||
| <div class="form-check form-switch my-3"> | ||
| <input | ||
| id="optimizerEnabled" | ||
| :checked="enabled" | ||
| class="form-check-input" | ||
| type="checkbox" | ||
| role="switch" | ||
| @change="change" | ||
| /> | ||
| <div class="form-check-label"> | ||
| <label for="optimizerEnabled"> | ||
| {{ $t("config.optimizer.enable") }} | ||
| </label> | ||
| </div> | ||
| </div> | ||
| </GenericModal> | ||
| </template> | ||
|
|
||
| <script lang="ts"> | ||
| import { defineComponent } from "vue"; | ||
| import GenericModal from "../Helper/GenericModal.vue"; | ||
| import ErrorMessage from "../Helper/ErrorMessage.vue"; | ||
| import api from "@/api"; | ||
| import store from "@/store"; | ||
| import { docsPrefix } from "@/i18n"; | ||
| import type { AxiosError } from "axios"; | ||
|
|
||
| export default defineComponent({ | ||
| name: "OptimizerModal", | ||
| components: { GenericModal, ErrorMessage }, | ||
| emits: ["changed"], | ||
| data() { | ||
| return { | ||
| error: null as string | null, | ||
| }; | ||
| }, | ||
| computed: { | ||
| enabled(): boolean { | ||
| return !!store.state?.optimizer; | ||
| }, | ||
| docsLink(): string { | ||
| return `${docsPrefix()}/docs/features/optimizer`; | ||
| }, | ||
| }, | ||
| methods: { | ||
| async change(e: Event) { | ||
| try { | ||
| this.error = null; | ||
| await api.post(`config/optimizer/${(e.target as HTMLInputElement).checked}`); | ||
| this.$emit("changed"); | ||
| } catch (err) { | ||
| const e = err as AxiosError<{ error: string }>; | ||
| this.error = e.response?.data?.error || e.message; | ||
| } | ||
| }, | ||
| }, | ||
| }); | ||
| </script> | ||
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,18 @@ | ||
| <template> | ||
| <svg :style="svgStyle" viewBox="0 0 24 24"> | ||
| <path | ||
| fill="currentColor" | ||
| d="M3.75 19.75q-.325-.325-.325-.75t.325-.75L9.8 12.2q.15-.15.325-.213t.375-.062q.2 0 .375.062t.325.213l3.3 3.3l6.4-7.2q.275-.325.713-.325t.737.3q.275.275.287.663t-.262.687L15.2 17.7q-.15.175-.337.263t-.388.087q-.2 0-.387-.075t-.338-.225L10.5 14.5l-5.25 5.25q-.325.325-.75.325t-.75-.325ZM4 13.3q-.125 0-.25-.063t-.2-.212l-.5-1.075l-1.075-.5q-.15-.075-.213-.2T1.7 11q0-.125.063-.25t.212-.2l1.075-.5l.5-1.075q.075-.15.2-.212T4 8.7q.125 0 .25.063t.2.212l.5 1.075l1.075.5q.275.125.275.45t-.275.45l-1.075.5l-.5 1.075q-.075.15-.2.212T4 13.3Zm11-2q-.125 0-.25-.063t-.2-.212l-.5-1.075l-1.075-.5q-.15-.075-.212-.2T12.7 9q0-.125.063-.25t.212-.2l1.075-.5l.5-1.075q.075-.15.2-.212T15 6.7q.125 0 .25.063t.2.212l.5 1.075l1.075.5q.15.075.213.2T17.3 9q0 .125-.063.25t-.212.2l-1.075.5l-.5 1.075q-.075.15-.2.213T15 11.3Zm-6.5-3q-.125 0-.25-.075T8.05 8L7.4 6.6L6 5.95q-.15-.075-.225-.2T5.7 5.5q0-.125.075-.25T6 5.05l1.4-.65l.65-1.4q.075-.15.2-.225T8.5 2.7q.125 0 .25.075t.2.225l.65 1.4l1.4.65q.15.075.225.2t.075.25q0 .125-.075.25t-.225.2l-1.4.65L8.95 8q-.075.15-.2.225T8.5 8.3Z" | ||
| /> | ||
| </svg> | ||
| </template> | ||
|
|
||
| <script lang="ts"> | ||
| import { defineComponent } from "vue"; | ||
| import icon from "@/mixins/icon"; | ||
|
|
||
| export default defineComponent({ | ||
| name: "Optimizer", | ||
| mixins: [icon], | ||
| }); | ||
| </script> |
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
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
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
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
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
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
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.