forked from evcc-io/evcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix-12640
* master: (43 commits) Translations update from Hosted Weblate (evcc-io#13257) sungrow charger: fix product name sungrow charger: fix default id InfluxDB: fix vehicle limit soc data type chore: speed-up post lint (evcc-io#13340) Custom vehicle: add FinishTimer (evcc-io#13338) chore: make generate organize imports (evcc-io#13337) Easee: change default timeout to 20s (evcc-io#13321) Chore: playwright sharding (evcc-io#13318) SmartCostLimit: allow negative limits (evcc-io#13317) Kia: fix status Easee: validate charger phases (evcc-io#13238) chore: switch to actions/cache (evcc-io#13308) Chore: docs test pr (evcc-io#13309) chore: create doc issue on pr merge Add Sungrow AC011E-01 charger (evcc-io#13247) Volkszaehler: fix uuids starting with 0 Fix limiting PV current when scaling phases up (evcc-io#13295) chore: avoid warning (evcc-io#13253) solax charger: fix enable/enabled ...
- Loading branch information
Showing
102 changed files
with
20,487 additions
and
1,615 deletions.
There are no files selected for viewing
This file contains 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 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,42 @@ | ||
name: Create Documentation Issue | ||
|
||
on: | ||
pull_request_target: | ||
types: [closed] | ||
branches: [master] | ||
|
||
jobs: | ||
check-label-and-create-issue: | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.merged == true | ||
steps: | ||
- name: Check for 'needs documentation' label | ||
id: check-label | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GH_TOKEN }} | ||
script: | | ||
const { data: labels } = await github.rest.issues.listLabelsOnIssue({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number | ||
}); | ||
const hasLabel = labels.some(label => label.name === 'needs documentation'); | ||
return hasLabel; | ||
result-encoding: string | ||
|
||
- name: Create Docs Issue | ||
if: steps.check-label.outputs.result == 'true' | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GH_TOKEN }} | ||
script: | | ||
const title = `Document: ${context.payload.pull_request.title}`; | ||
const body = `We need to document the new feature introduced in this PR: ${context.payload.pull_request.html_url}`; | ||
await github.rest.issues.create({ | ||
owner: 'evcc-io', | ||
repo: 'docs', | ||
title: title, | ||
body: body | ||
}); |
This file contains 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 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 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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,58 @@ | ||
import { reactive, watch } from "vue"; | ||
import api from "./api"; | ||
import Modal from "bootstrap/js/dist/modal"; | ||
|
||
const auth = reactive({ | ||
configured: true, | ||
loggedIn: false, | ||
}); | ||
|
||
export async function updateAuthStatus() { | ||
try { | ||
const res = await api.get("/auth/status", { | ||
validateStatus: (code) => [200, 501].includes(code), | ||
}); | ||
if (res.status === 501) { | ||
auth.configured = false; | ||
} | ||
if (res.status === 200) { | ||
auth.configured = true; | ||
auth.loggedIn = res.data === true; | ||
} | ||
} catch (e) { | ||
console.log("unable to fetch auth status", e); | ||
} | ||
} | ||
|
||
export async function logout() { | ||
try { | ||
await api.post("/auth/logout"); | ||
await updateAuthStatus(); | ||
} catch (e) { | ||
console.log("unable to logout", e); | ||
} | ||
} | ||
|
||
export function isLoggedIn() { | ||
return auth.loggedIn; | ||
} | ||
|
||
export function isConfigured() { | ||
return auth.configured; | ||
} | ||
|
||
export function openLoginModal() { | ||
const modal = Modal.getOrCreateInstance(document.getElementById("loginModal")); | ||
modal.show(); | ||
} | ||
|
||
// show/hide password modal based on auth status | ||
watch( | ||
() => auth.configured, | ||
(configured) => { | ||
const modal = Modal.getOrCreateInstance(document.getElementById("passwordModal")); | ||
configured ? modal.hide() : modal.show(); | ||
} | ||
); | ||
|
||
export default auth; |
This file contains 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.