Introduce Storybook and refactor Vue components (#524)

This commit is contained in:
andig 2020-12-23 17:56:26 +01:00 • committed by GitHub
parent 95cfe455b8
commit 2d3bf1bec9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 17513 additions and 8161 deletions

View file

@ -1,3 +1,5 @@
.cache
.storybook
.vscode .vscode
*.conf *.conf
*.Dockerfile *.Dockerfile
@ -5,7 +7,6 @@
*.sh *.sh
*.yaml *.yaml
Dockerfile Dockerfile
.cache
dist dist
node_modules node_modules
!entrypoint.sh !entrypoint.sh

4
.storybook/main.js Normal file
View file

@ -0,0 +1,4 @@
module.exports = {
stories: ["../assets/js/**/*.stories.mdx", "../assets/js/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-links", "@storybook/addon-essentials"],
};

View file

@ -0,0 +1,2 @@
<link href="/css/bootstrap.min.css" rel="stylesheet" />
<link href="/css/app.css" rel="stylesheet" />

4
.storybook/preview.js Normal file
View file

@ -0,0 +1,4 @@
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
}

View file

@ -2,40 +2,11 @@ import "popper.js";
import "bootstrap"; import "bootstrap";
import Vue from "vue"; import Vue from "vue";
import axios from "axios"; import axios from "axios";
import { library } from "@fortawesome/fontawesome-svg-core";
import { faSun } from "@fortawesome/free-solid-svg-icons/faSun";
import { faArrowUp } from "@fortawesome/free-solid-svg-icons/faArrowUp";
import { faArrowDown } from "@fortawesome/free-solid-svg-icons/faArrowDown";
import { faBatteryThreeQuarters } from "@fortawesome/free-solid-svg-icons/faBatteryThreeQuarters";
import { faTemperatureLow } from "@fortawesome/free-solid-svg-icons/faTemperatureLow";
import { faTemperatureHigh } from "@fortawesome/free-solid-svg-icons/faTemperatureHigh";
import { faThermometerHalf } from "@fortawesome/free-solid-svg-icons/faThermometerHalf";
import { faLeaf } from "@fortawesome/free-solid-svg-icons/faLeaf";
import { faChevronUp } from "@fortawesome/free-solid-svg-icons/faChevronUp";
import { faChevronDown } from "@fortawesome/free-solid-svg-icons/faChevronDown";
import { faExclamationTriangle } from "@fortawesome/free-solid-svg-icons/faExclamationTriangle";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import App from "./views/App"; import App from "./views/App";
import Toasts from "./components/Toasts"; import Toasts from "./components/Toasts";
import router from "./router"; import router from "./router";
import store from "./store"; import store from "./store";
library.add(
faSun,
faArrowUp,
faArrowDown,
faBatteryThreeQuarters,
faTemperatureLow,
faTemperatureHigh,
faThermometerHalf,
faLeaf,
faChevronUp,
faChevronDown,
faExclamationTriangle
);
Vue.component("fa-icon", FontAwesomeIcon);
const loc = window.location; const loc = window.location;
axios.defaults.baseURL = axios.defaults.baseURL =
loc.protocol + "//" + loc.hostname + (loc.port ? ":" + loc.port : "") + loc.pathname + "api"; loc.protocol + "//" + loc.hostname + (loc.port ? ":" + loc.port : "") + loc.pathname + "api";

View file

@ -0,0 +1,29 @@
import Loadpoint from "./Loadpoint.vue";
export default {
title: "Main/Loadpoint",
component: Loadpoint,
argTypes: {
mode: { control: { type: "inline-radio", options: ["off", "now", "minpv", "pv"] } },
climater: { control: { type: "inline-radio", options: ["on", "heating", "cooling"] } },
},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Loadpoint },
template: '<Loadpoint v-bind="$props"></Loadpoint>',
});
export const Base = Template.bind({});
Base.args = {
id: 0,
pvConfigured: true,
};
export const WithLevels = Template.bind({});
WithLevels.args = {
id: 0,
pvConfigured: true,
socLevels: [20, 50, 80, 100],
};

View file

@ -2,11 +2,11 @@
<div> <div>
<div class="row" v-if="multi"> <div class="row" v-if="multi">
<div class="col-12 col-md-4 d-md-flex mt-3 mt-md-5 align-items-end"> <div class="col-12 col-md-4 d-md-flex mt-3 mt-md-5 align-items-end">
<span class="h1 align-bottom">{{ state.title || "Ladepunkt" }}</span> <span class="h1 align-bottom">{{ title || "Ladepunkt" }}</span>
</div> </div>
<div class="col-12 col-md-8 d-none d-md-block mt-3 mt-md-5"> <div class="col-12 col-md-8 d-none d-md-block mt-3 mt-md-5">
<LoadpointDetails v-bind:state="state"></LoadpointDetails> <LoadpointDetails v-bind="details"> </LoadpointDetails>
</div> </div>
<div class="col-12 d-md-none"> <div class="col-12 d-md-none">
@ -14,17 +14,17 @@
<div class="col-12 mt-3"> <div class="col-12 mt-3">
<Mode <Mode
class="w-100" class="w-100"
v-bind:mode="state.mode" :mode="mode"
:pv="pv" :pvConfigured="pvConfigured"
v-on:updated="targetMode" v-on:updated="setTargetMode"
></Mode> ></Mode>
</div> </div>
<div class="col-12 mt-3" v-if="hasTargetSoC"> <div class="col-12 mt-3" v-if="hasTargetSoC">
<Soc <Soc
class="w-100" class="w-100"
v-bind:soc="state.targetSoC" :soc="targetSoC"
:levels="state.socLevels" :levels="socLevels"
v-on:updated="targetSoC" v-on:updated="setTargetSoC"
></Soc> ></Soc>
</div> </div>
</div> </div>
@ -32,23 +32,20 @@
</div> </div>
<div class="row d-none d-md-flex mt-5 py-3 pb-4 text-center bg-light" v-if="!multi"> <div class="row d-none d-md-flex mt-5 py-3 pb-4 text-center bg-light" v-if="!multi">
<div <div class="mt-3" :class="{ 'col-md-6': hasTargetSoC, 'col-md-12': !hasTargetSoC }">
class="mt-3"
v-bind:class="{ 'col-md-6': hasTargetSoC, 'col-md-12': !hasTargetSoC }"
>
<Mode <Mode
v-bind:mode="state.mode" :mode="mode"
:pv="pv" :pvConfigured="pvConfigured"
:caption="true" :caption="true"
v-on:updated="targetMode" v-on:updated="setTargetMode"
></Mode> ></Mode>
</div> </div>
<div class="col-md-6 mt-3" v-if="hasTargetSoC"> <div class="col-md-6 mt-3" v-if="hasTargetSoC">
<Soc <Soc
v-bind:soc="state.targetSoC" :soc="targetSoC"
:levels="state.socLevels" :levels="socLevels"
:caption="true" :caption="true"
v-on:updated="targetSoC" v-on:updated="setTargetSoC"
></Soc> ></Soc>
</div> </div>
</div> </div>
@ -57,35 +54,32 @@
<div class="col-12 mt-3"> <div class="col-12 mt-3">
<Mode <Mode
class="w-100" class="w-100"
v-bind:mode="state.mode" :mode="mode"
:pv="pv" :pvConfigured="pvConfigured"
v-on:updated="targetMode" v-on:updated="setTargetMode"
></Mode> ></Mode>
</div> </div>
<div class="col-12 mt-3" v-if="hasTargetSoC"> <div class="col-12 mt-3" v-if="hasTargetSoC">
<Soc <Soc
class="w-100" class="w-100"
v-bind:soc="state.targetSoC" :soc="targetSoC"
:levels="state.socLevels" :levels="socLevels"
v-on:updated="targetSoC" v-on:updated="setTargetSoC"
></Soc> ></Soc>
</div> </div>
</div> </div>
<div class="row" v-if="!multi"> <div class="row" v-if="!multi">
<div class="col-12 col-md-4 d-none d-md-flex mt-3 mt-md-5"> <div class="col-12 col-md-4 d-none d-md-flex mt-3 mt-md-5">
<span class="h1">{{ state.title || "Ladepunkt" }}</span> <span class="h1">{{ title || "Ladepunkt" }}</span>
</div> </div>
<div <div class="col-12 col-md-8 d-flex d-md-flex mt-3 mt-md-5 pt-3" v-if="remoteDisabled">
class="col-12 col-md-8 d-flex d-md-flex mt-3 mt-md-5 pt-3"
v-if="state.remoteDisabled"
>
<h5 class="w-100"> <h5 class="w-100">
<span class="badge badge-warning w-100" v-if="state.remoteDisabled == 'soft'"> <span class="badge badge-warning w-100" v-if="remoteDisabled == 'soft'">
{{ state.remoteDisabledSource }}: Adaptives PV-Laden deaktiviert {{ remoteDisabledSource }}: Adaptives PV-Laden deaktiviert
</span> </span>
<span class="badge badge-danger w-100" v-if="state.remoteDisabled == 'hard'"> <span class="badge badge-danger w-100" v-if="remoteDisabled == 'hard'">
{{ state.remoteDisabledSource }}: Deaktiviert {{ remoteDisabledSource }}: Deaktiviert
</span> </span>
</h5> </h5>
</div> </div>
@ -95,34 +89,41 @@
<div class="row"> <div class="row">
<div class="col-12 col-md-4 mt-3 mb-3 mb-md-0"> <div class="col-12 col-md-4 mt-3 mb-3 mb-md-0">
<Vehicle v-bind:state="state"></Vehicle> <Vehicle
:charging="charging"
:connected="connected"
:minSoC="minSoC"
:soc="soc"
:socCharge="socCharge"
:socTitle="socTitle"
></Vehicle>
</div> </div>
<div class="col-12 col-md-4 d-none d-md-block mt-3" v-if="multi"> <div class="col-12 col-md-4 d-none d-md-block mt-3" v-if="multi">
<div class="mb-2">Modus</div> <div class="mb-2">Modus</div>
<Mode <Mode
class="btn-group-sm" class="btn-group-sm"
v-bind:mode="state.mode" :mode="mode"
:pv="pv" :pvConfigured="pvConfigured"
v-on:updated="targetMode" v-on:updated="setTargetMode"
></Mode> ></Mode>
</div> </div>
<div class="col-12 col-md-4 d-none d-md-block mt-3" v-if="multi && hasTargetSoC"> <div class="col-12 col-md-4 d-none d-md-block mt-3" v-if="multi && hasTargetSoC">
<div class="mb-2">Ladeziel</div> <div class="mb-2">Ladeziel</div>
<Soc <Soc
class="btn-group-sm" class="btn-group-sm"
v-bind:soc="state.targetSoC" :soc="targetSoC"
:levels="state.socLevels" :levels="socLevels"
v-on:updated="targetSoC" v-on:updated="setTargetSoC"
></Soc> ></Soc>
</div> </div>
<div class="col-md-8 d-none d-md-block" v-if="!multi"> <div class="col-md-8 d-none d-md-block" v-if="!multi">
<LoadpointDetails v-bind:state="state"></LoadpointDetails> <LoadpointDetails v-bind="details"></LoadpointDetails>
</div> </div>
<div class="col-12 d-md-none"> <div class="col-12 d-md-none">
<LoadpointDetails v-bind:state="state"></LoadpointDetails> <LoadpointDetails v-bind="details"></LoadpointDetails>
</div> </div>
</div> </div>
</div> </div>
@ -138,28 +139,72 @@ import formatter from "../mixins/formatter";
export default { export default {
name: "Loadpoint", name: "Loadpoint",
props: ["state", "id", "pv", "multi"], props: {
id: Number,
multi: Boolean,
pvConfigured: Boolean,
// main
title: String,
mode: String,
targetSoC: Number,
socLevels: Array,
remoteDisabled: Boolean,
remoteDisabledSource: String,
chargeDuration: Number,
charging: Boolean,
// vehicle
connected: Boolean,
// charging: Boolean,
socTitle: String,
socCharge: Number,
minSoC: Number,
// details
chargePower: Number,
chargedEnergy: Number,
// chargeDuration: Number,
soc: Boolean,
climater: String,
range: Number,
chargeEstimate: Number,
},
components: { LoadpointDetails, Soc, Mode, Vehicle }, components: { LoadpointDetails, Soc, Mode, Vehicle },
mixins: [formatter], mixins: [formatter],
data: function () { data: function () {
return { return {
tickerHandle: null, tickerHandle: null,
chargeDurationDisplayed: null,
}; };
}, },
computed: { computed: {
details: function () {
return {
connected: this.connected,
minSoC: this.minSoC,
socCharge: this.socCharge,
climater: this.climater,
chargePower: this.chargePower,
chargedEnergy: this.chargedEnergy,
range: this.range,
chargeDuration: this.chargeDurationDisplayed,
chargeEstimate: this.chargeEstimate,
};
},
hasTargetSoC: function () { hasTargetSoC: function () {
return this.state.socLevels != null && this.state.socLevels.length > 0; return this.socLevels != null && this.socLevels.length > 0;
}, },
}, },
watch: { watch: {
"state.chargeDuration": function () { chargeDuration: function () {
window.clearInterval(this.tickerHandle); window.clearInterval(this.tickerHandle);
// only ticker if actually charging // only ticker if actually charging
if (this.state.charging && this.state.chargeDuration >= 0) { if (this.charging && this.chargeDuration >= 0) {
this.chargeDurationDisplayed = this.chargeDuration;
this.tickerHandle = window.setInterval( this.tickerHandle = window.setInterval(
function () { function () {
// eslint-disable-next-line vue/no-mutating-props this.chargeDurationDisplayed += 1;
this.state.chargeDuration += 1;
}.bind(this), }.bind(this),
1000 1000
); );
@ -170,24 +215,24 @@ export default {
api: function (func) { api: function (func) {
return "loadpoints/" + this.id + "/" + func; return "loadpoints/" + this.id + "/" + func;
}, },
targetMode: function (mode) { setTargetMode: function (mode) {
axios axios
.post(this.api("mode") + "/" + mode) .post(this.api("mode") + "/" + mode)
.then( .then(
function (response) { function (response) {
// eslint-disable-next-line vue/no-mutating-props // eslint-disable-next-line vue/no-mutating-props
this.state.mode = response.data.mode; this.mode = response.data.mode;
}.bind(this) }.bind(this)
) )
.catch(window.toasts.error); .catch(window.toasts.error);
}, },
targetSoC: function (soc) { setTargetSoC: function (soc) {
axios axios
.post(this.api("targetsoc") + "/" + soc) .post(this.api("targetsoc") + "/" + soc)
.then( .then(
function (response) { function (response) {
// eslint-disable-next-line vue/no-mutating-props // eslint-disable-next-line vue/no-mutating-props
this.state.targetSoC = response.data.targetSoC; this.targetSoC = response.data.targetSoC;
}.bind(this) }.bind(this)
) )
.catch(window.toasts.error); .catch(window.toasts.error);

View file

@ -0,0 +1,55 @@
import LoadpointDetails from "./LoadpointDetails.vue";
export default {
title: "Main/LoadpointDetails",
component: LoadpointDetails,
argTypes: {
climater: { control: { type: "inline-radio", options: ["on", "heating", "cooling"] } },
},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { LoadpointDetails },
template: '<LoadpointDetails v-bind="$props"></LoadpointDetails>',
});
export const Base = Template.bind({});
Base.args = {};
export const Charging = Template.bind({});
Charging.args = {
chargePower: 2800,
chargedEnergy: 11e3,
chargeDuration: 95 * 60,
};
export const Vehicle = Template.bind({});
Vehicle.args = {
chargePower: 2800,
chargedEnergy: 11e3,
chargeDuration: 95 * 60,
soc: true,
chargeEstimate: 5 * 3600,
};
export const VehicleRange = Template.bind({});
VehicleRange.args = {
chargePower: 2800,
chargedEnergy: 11e3,
chargeDuration: 95 * 60,
soc: true,
range: 240.123,
chargeEstimate: 5 * 3600,
};
export const VehicleClimater = Template.bind({});
VehicleClimater.args = {
chargePower: 2800,
chargedEnergy: 11e3,
chargeDuration: 95 * 60,
soc: true,
range: 240.123,
chargeEstimate: 5 * 3600,
climater: "on",
};

View file

@ -6,36 +6,36 @@
<fa-icon <fa-icon
class="text-primary ml-1" class="text-primary ml-1"
icon="temperature-low" icon="temperature-low"
v-if="state.climater == 'heating'" v-if="climater == 'heating'"
></fa-icon> ></fa-icon>
<fa-icon <fa-icon
class="text-primary ml-1" class="text-primary ml-1"
icon="temperature-high" icon="temperature-high"
v-if="state.climater == 'cooling'" v-if="climater == 'cooling'"
></fa-icon> ></fa-icon>
<fa-icon <fa-icon
class="text-primary ml-1" class="text-primary ml-1"
icon="thermometer-half" icon="thermometer-half"
v-if="state.climater == 'on'" v-if="climater == 'on'"
></fa-icon> ></fa-icon>
</div> </div>
<h2 class="value"> <h2 class="value">
{{ fmt(state.chargePower) }} {{ fmt(chargePower) }}
<small class="text-muted">{{ fmtUnit(state.chargePower) }}W</small> <small class="text-muted">{{ fmtUnit(chargePower) }}W</small>
</h2> </h2>
</div> </div>
<div class="col-6 col-md-3 mt-3"> <div class="col-6 col-md-3 mt-3">
<div class="mb-2 value">Geladen</div> <div class="mb-2 value">Geladen</div>
<h2 class="value"> <h2 class="value">
{{ fmt(state.chargedEnergy) }} {{ fmt(chargedEnergy) }}
<small class="text-muted">{{ fmtUnit(state.chargedEnergy) }}Wh</small> <small class="text-muted">{{ fmtUnit(chargedEnergy) }}Wh</small>
</h2> </h2>
</div> </div>
<div class="col-6 col-md-3 mt-3" v-if="state.range >= 0"> <div class="col-6 col-md-3 mt-3" v-if="range >= 0">
<div class="mb-2 value">Reichweite</div> <div class="mb-2 value">Reichweite</div>
<h2 class="value"> <h2 class="value">
{{ state.range }} {{ Math.round(range) }}
<small class="text-muted">km</small> <small class="text-muted">km</small>
</h2> </h2>
</div> </div>
@ -43,36 +43,36 @@
<div class="col-6 col-md-3 mt-3" v-else> <div class="col-6 col-md-3 mt-3" v-else>
<div class="mb-2 value">Dauer</div> <div class="mb-2 value">Dauer</div>
<h2 class="value"> <h2 class="value">
{{ fmtShortDuration(state.chargeDuration) }} {{ fmtShortDuration(chargeDuration) }}
<small class="text-muted">{{ fmtShortDurationUnit(state.chargeDuration) }}</small> <small class="text-muted">{{ fmtShortDurationUnit(chargeDuration) }}</small>
</h2> </h2>
</div> </div>
<div class="col-6 col-md-3 mt-3" v-if="state.soc"> <div class="col-6 col-md-3 mt-3" v-if="soc">
<div class="mb-2 value">Restzeit</div> <div class="mb-2 value">Restzeit</div>
<h2 class="value"> <h2 class="value">
{{ fmtShortDuration(state.chargeEstimate) }} {{ fmtShortDuration(chargeEstimate) }}
<small class="text-muted">{{ fmtShortDurationUnit(state.chargeEstimate) }}</small> <small class="text-muted">{{ fmtShortDurationUnit(chargeEstimate) }}</small>
</h2> </h2>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import "../icons";
import formatter from "../mixins/formatter"; import formatter from "../mixins/formatter";
export default { export default {
name: "LoadpointDetails", name: "LoadpointDetails",
props: ["state"], props: {
mixins: [formatter], chargePower: Number,
computed: { chargedEnergy: Number,
minSoCActive: function () { chargeDuration: Number,
return ( soc: Boolean,
this.state.connected && climater: String,
this.state.minSoC > 0 && range: Number,
this.state.socCharge < this.state.minSoC chargeEstimate: Number,
);
},
}, },
mixins: [formatter],
}; };
</script> </script>

View file

@ -0,0 +1,25 @@
import Mode from "./Mode.vue";
export default {
title: "Main/Mode",
component: Mode,
argTypes: {
mode: { control: { type: "inline-radio", options: ["off", "now", "minpv", "pv"] } },
},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Mode },
template: '<Mode v-bind="$props"></Mode>',
});
export const Base = Template.bind({});
Base.args = {};
export const CaptionAndPV = Template.bind({});
CaptionAndPV.args = {
caption: true,
pvConfigured: true,
mode: "pv",
};

View file

@ -6,22 +6,27 @@
> >
Modus Modus
</label> </label>
<label class="btn btn-outline-primary" :class="{ active: mode == 'off', first: !caption }">
<input type="radio" value="off" v-on:click="setTargetMode('off')" />Stop
</label>
<label class="btn btn-outline-primary" :class="{ active: mode == 'now' }">
<input type="radio" value="now" v-on:click="setTargetMode('now')" />Sofort
</label>
<label <label
class="btn btn-outline-primary" class="btn btn-outline-primary"
v-bind:class="{ active: mode == 'off', first: !caption }" :class="{ active: mode == 'minpv' }"
v-if="pvConfigured"
> >
<input type="radio" value="off" v-on:click="targetMode('off')" />Stop <input type="radio" value="minpv" v-on:click="setTargetMode('minpv')" />
</label>
<label class="btn btn-outline-primary" v-bind:class="{ active: mode == 'now' }">
<input type="radio" value="now" v-on:click="targetMode('now')" />Sofort
</label>
<label class="btn btn-outline-primary" v-bind:class="{ active: mode == 'minpv' }" v-if="pv">
<input type="radio" value="minpv" v-on:click="targetMode('minpv')" />
<span class="d-inline d-lg-none">Min</span> <span class="d-inline d-lg-none">Min</span>
<span class="d-none d-lg-inline">Min + PV</span> <span class="d-none d-lg-inline">Min + PV</span>
</label> </label>
<label class="btn btn-outline-primary" v-bind:class="{ active: mode == 'pv' }" v-if="pv"> <label
<input type="radio" value="pv" v-on:click="targetMode('pv')" /> class="btn btn-outline-primary"
:class="{ active: mode == 'pv' }"
v-if="pvConfigured"
>
<input type="radio" value="pv" v-on:click="setTargetMode('pv')" />
<span class="d-inline d-md-none">PV</span> <span class="d-inline d-md-none">PV</span>
<span class="d-none d-md-inline">Nur PV</span> <span class="d-none d-md-inline">Nur PV</span>
</label> </label>
@ -31,9 +36,13 @@
<script> <script>
export default { export default {
name: "Mode", name: "Mode",
props: ["mode", "pv", "caption"], props: {
mode: String,
pvConfigured: Boolean,
caption: Boolean,
},
methods: { methods: {
targetMode: function (mode) { setTargetMode: function (mode) {
this.$emit("updated", mode); this.$emit("updated", mode);
}, },
}, },

View file

@ -0,0 +1,62 @@
import Site from "./Site.vue";
export default {
title: "Main/Site",
component: Site,
argTypes: {},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Site },
template: '<Site v-bind="$props"></Site>',
});
export const Base = Template.bind({});
Base.args = {
gridConfigured: true,
pvConfigured: true,
gridPower: 100,
pvPower: 100,
batteryConfigured: true,
batteryPower: 100,
batterySoC: 0,
loadpoints: [],
};
export const Single = Template.bind({});
Single.args = {
gridConfigured: true,
pvConfigured: true,
gridPower: 100,
pvPower: 100,
batteryConfigured: true,
batteryPower: 100,
batterySoC: 0,
loadpoints: [
{
title: "Ladepunkt 1",
socLevels: [20, 50, 80, 100],
},
],
};
export const Multi = Template.bind({});
Multi.args = {
gridConfigured: true,
pvConfigured: true,
gridPower: 100,
pvPower: 100,
batteryConfigured: true,
batteryPower: 100,
batterySoC: 0,
loadpoints: [
{
title: "Ladepunkt 1",
socLevels: [20, 50, 80, 100],
},
{
title: "Ladepunkt 2",
},
],
};

View file

@ -2,10 +2,18 @@
<div> <div>
<div class="row"> <div class="row">
<div class="d-none d-md-flex col-12 col-md-4 mt-md-4 align-items-end"> <div class="d-none d-md-flex col-12 col-md-4 mt-md-4 align-items-end">
<p class="h1">{{ state.title || "Home" }}</p> <p class="h1">{{ title || "Home" }}</p>
</div> </div>
<div class="col-12 col-md-8 mt-md-4" v-if="multi"> <div class="col-12 col-md-8 mt-md-4" v-if="multi">
<SiteDetails v-bind:state="state"></SiteDetails> <SiteDetails
:gridConfigured="gridConfigured"
:gridPower="gridPower"
:pvConfigured="pvConfigured"
:pvPower="pvPower"
:batteryConfigured="batteryConfigured"
:batteryPower="batteryPower"
:batterySoC="batterySoC"
></SiteDetails>
</div> </div>
</div> </div>
@ -14,17 +22,25 @@
<div class="row" v-if="!multi"> <div class="row" v-if="!multi">
<div class="d-none d-md-block col-md-4"></div> <div class="d-none d-md-block col-md-4"></div>
<div class="col-12 col-md-8"> <div class="col-12 col-md-8">
<SiteDetails v-bind:state="state"></SiteDetails> <SiteDetails
:gridConfigured="gridConfigured"
:gridPower="gridPower"
:pvConfigured="pvConfigured"
:pvPower="pvPower"
:batteryConfigured="batteryConfigured"
:batteryPower="batteryPower"
:batterySoC="batterySoC"
></SiteDetails>
</div> </div>
</div> </div>
<Loadpoint <Loadpoint
v-for="(loadpoint, id) in state.loadpoints" v-for="(loadpoint, id) in loadpoints"
v-bind:id="id" v-bind="loadpoint"
:id="id"
:key="id" :key="id"
:state="loadpoint"
:pv="state.gridConfigured"
:multi="multi" :multi="multi"
:pvConfigured="pvConfigured"
> >
</Loadpoint> </Loadpoint>
</div> </div>
@ -37,13 +53,25 @@ import formatter from "../mixins/formatter";
export default { export default {
name: "Site", name: "Site",
props: ["state"], props: {
title: String,
loadpoints: Array,
// details
gridConfigured: Boolean,
gridPower: Number,
pvConfigured: Boolean,
pvPower: Number,
batteryConfigured: Boolean,
batteryPower: Number,
batterySoC: Number,
},
components: { SiteDetails, Loadpoint }, components: { SiteDetails, Loadpoint },
mixins: [formatter], mixins: [formatter],
computed: { computed: {
multi: function () { multi: function () {
// TODO fix compact // TODO fix compact
return this.state.loadpoints.length > 1 /* || app.compact*/; return this.loadpoints.length > 1 /* || app.compact*/;
}, },
}, },
}; };

View file

@ -0,0 +1,32 @@
import SiteDetails from "./SiteDetails.vue";
export default {
title: "Main/SiteDetails",
component: SiteDetails,
argTypes: {},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { SiteDetails },
template: '<SiteDetails v-bind="$props"></SiteDetails>',
});
export const GridAndPV = Template.bind({});
GridAndPV.args = {
gridConfigured: true,
pvConfigured: true,
gridPower: 100,
pvPower: 100,
};
export const WithBattery = Template.bind({});
WithBattery.args = {
gridConfigured: true,
pvConfigured: true,
batteryConfigured: true,
gridPower: 100,
pvPower: 100,
batteryPower: 100,
batterySoC: 0,
};

View file

@ -1,74 +1,75 @@
<template> <template>
<div class="row"> <div class="row">
<div class="col-6 col-md-3 mt-3" v-if="state.gridConfigured"> <div class="col-6 col-md-3 mt-3" v-if="gridConfigured">
<div class="mb-2 value" v-if="state.gridPower > 0"> <div class="mb-2 value" v-if="gridPower > 0">
Bezug <fa-icon icon="arrow-down" class="text-primary"></fa-icon> Bezug <fa-icon icon="arrow-down" class="text-primary" />
</div> </div>
<div class="mb-2 value" v-else> <div class="mb-2 value" v-else>
Einspeisung <fa-icon icon="arrow-up" class="text-primary"></fa-icon> Einspeisung <fa-icon icon="arrow-up" class="text-primary"></fa-icon>
</div> </div>
<h2 class="value"> <h2 class="value">
{{ fmt(state.gridPower) }} {{ fmt(gridPower) }}
<small class="text-muted">{{ fmtUnit(state.gridPower) }}W</small> <small class="text-muted">{{ fmtUnit(gridPower) }}W</small>
</h2> </h2>
</div> </div>
<div class="col-6 col-md-3 mt-3" v-if="state.pvConfigured"> <div class="col-6 col-md-3 mt-3" v-if="pvConfigured">
<div class="mb-2 value"> <div class="mb-2 value">
Erzeugung Erzeugung
<fa-icon <fa-icon
icon="sun" icon="sun"
v-bind:class="{ :class="{
'text-primary': state.pvPower < 0, 'text-primary': pvPower < 0,
'text-muted': state.pvPower >= 0, 'text-muted': pvPower >= 0,
}" }"
></fa-icon> ></fa-icon>
</div> </div>
<h2 class="value"> <h2 class="value">
{{ fmt(state.pvPower) }} {{ fmt(pvPower) }}
<small class="text-muted">{{ fmtUnit(state.pvPower) }}W</small> <small class="text-muted">{{ fmtUnit(pvPower) }}W</small>
</h2> </h2>
</div> </div>
<div class="d-md-block col-6 col-md-3 mt-3" v-if="state.batteryConfigured"> <div class="d-md-block col-6 col-md-3 mt-3" v-if="batteryConfigured">
<div class="mb-2 value"> <div class="mb-2 value">
Batterie Batterie
<fa-icon <fa-icon class="text-primary" icon="arrow-down" v-if="batteryPower < 0"></fa-icon>
class="text-primary" <fa-icon class="text-primary" icon="arrow-up" v-if="batteryPower > 0"></fa-icon>
icon="arrow-down"
v-if="state.batteryPower < 0"
></fa-icon>
<fa-icon
class="text-primary"
icon="arrow-up"
v-if="state.batteryPower > 0"
></fa-icon>
</div> </div>
<h2 class="value"> <h2 class="value">
{{ fmt(state.batteryPower) }} {{ fmt(batteryPower) }}
<small class="text-muted">{{ fmtUnit(state.batteryPower) }}W</small> <small class="text-muted">{{ fmtUnit(batteryPower) }}W</small>
</h2> </h2>
</div> </div>
<div class="col-6 col-md-3 mt-3" v-if="state.batteryConfigured"> <div class="col-6 col-md-3 mt-3" v-if="batteryConfigured">
<div class="mb-2 value"> <div class="mb-2 value">
SoC SoC
<fa-icon <fa-icon
icon="battery-three-quarters" icon="battery-three-quarters"
v-bind:class="{ :class="{
'text-primary': state.batteryPower > 0, 'text-primary': batteryPower > 0,
'text-muted': state.batteryPower < 0, 'text-muted': batteryPower < 0,
}" }"
></fa-icon> ></fa-icon>
</div> </div>
<h2 class="value">{{ state.batterySoC || 0 }} <small class="text-muted">%</small></h2> <h2 class="value">{{ batterySoC }} <small class="text-muted">%</small></h2>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import "../icons";
import formatter from "../mixins/formatter"; import formatter from "../mixins/formatter";
export default { export default {
name: "SiteDetails", name: "SiteDetails",
props: ["state"], props: {
gridConfigured: Boolean,
gridPower: Number,
pvConfigured: Boolean,
pvPower: Number,
batteryConfigured: Boolean,
batteryPower: Number,
batterySoC: Number,
},
mixins: [formatter], mixins: [formatter],
}; };
</script> </script>

View file

@ -0,0 +1,26 @@
import Soc from "./Soc.vue";
export default {
title: "Main/Soc",
component: Soc,
argTypes: {},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Soc },
template: '<Soc v-bind="$props"></Soc>',
});
export const Base = Template.bind({});
Base.args = {
soc: 80,
levels: [20, 50, 80, 100],
};
export const Caption = Template.bind({});
Caption.args = {
caption: true,
soc: 80,
levels: [20, 50, 80, 100],
};

View file

@ -7,11 +7,11 @@
class="btn btn-outline-primary" class="btn btn-outline-primary"
v-for="(level, id) in levelsOrDefault" v-for="(level, id) in levelsOrDefault"
:key="id" :key="id"
v-bind:level="level" :level="level"
:id="id" :id="id"
:class="{ active: soc == level, first: !caption && id == 0 }" :class="{ active: soc == level, first: !caption && id == 0 }"
> >
<input type="radio" v-bind:value="level" v-on:click="targetSoC(level)" />{{ level }}% <input type="radio" :value="level" v-on:click="setTargetSoC(level)" />{{ level }}%
</label> </label>
</div> </div>
</template> </template>
@ -19,7 +19,11 @@
<script> <script>
export default { export default {
name: "Soc", name: "Soc",
props: ["soc", "caption", "levels"], props: {
soc: Number,
caption: Boolean,
levels: Array,
},
computed: { computed: {
levelsOrDefault: function () { levelsOrDefault: function () {
if (this.levels == null || this.levels.length == 0) { if (this.levels == null || this.levels.length == 0) {
@ -29,7 +33,7 @@ export default {
}, },
}, },
methods: { methods: {
targetSoC: function (mode) { setTargetSoC: function (mode) {
this.$emit("updated", mode); this.$emit("updated", mode);
}, },
}, },

View file

@ -1,5 +1,5 @@
<template> <template>
<div class="toast" data-delay="10000" v-bind:data-autohide="true"> <div class="toast" data-delay="10000" :data-autohide="true">
<div class="toast-header"> <div class="toast-header">
<strong class="mr-auto" v-if="item.type != 'warn'" <strong class="mr-auto" v-if="item.type != 'warn'"
><fa-icon class="text-danger" icon="exclamation-triangle"></fa-icon> Error</strong ><fa-icon class="text-danger" icon="exclamation-triangle"></fa-icon> Error</strong
@ -18,10 +18,11 @@
</template> </template>
<script> <script>
import "../icons";
import $ from "jquery"; import $ from "jquery";
export default { export default {
name: "MessageToast", name: "ToastMessage",
props: ["item"], props: ["item"],
mounted: function () { mounted: function () {
const id = "#message-id-" + this.item.id; const id = "#message-id-" + this.item.id;

View file

@ -0,0 +1,22 @@
import Toasts from "./Toasts.vue";
export default {
title: "Main/Toasts",
component: Toasts,
argTypes: {},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Toasts },
template: '<Toasts v-bind="$props"></Toasts>',
});
export const Base = Template.bind({});
Base.args = {
items: {
id: 1,
message: "Evil warning",
type: "warn",
},
};

View file

@ -1,22 +1,25 @@
<template> <template>
<div aria-atomic="true" style="position: absolute; top: 4rem; right: 0.5rem"> <div aria-atomic="true" style="position: absolute; top: 4rem; right: 0.5rem">
<!-- Position it --> <!-- Position it -->
<MessageToast <ToastMessage
v-for="item in items" v-for="item in items"
v-bind:item="item" :item="item"
:id="'message-id-' + item.id" :id="'message-id-' + item.id"
:key="item.id" :key="item.id"
> >
</MessageToast> </ToastMessage>
</div> </div>
</template> </template>
<script> <script>
import MessageToast from "./MessageToast"; import "../icons";
import ToastMessage from "./ToastMessage";
export default { export default {
name: "Toasts", name: "Toasts",
components: { MessageToast }, components: { ToastMessage },
props: ["items", "count"], props: {
items: Object,
},
}; };
</script> </script>

View file

@ -0,0 +1,37 @@
import Vehicle from "./Vehicle.vue";
export default {
title: "Main/Vehicle",
component: Vehicle,
argTypes: {},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Vehicle },
template: '<Vehicle v-bind="$props"></Vehicle>',
});
export const Base = Template.bind({});
Base.args = {
soc: false,
socTitle: "Mein Auto",
connected: true,
};
export const Car = Template.bind({});
Car.args = {
soc: true,
socTitle: "Mein Auto",
connected: true,
socCharge: 15,
};
export const CarWithMin = Template.bind({});
CarWithMin.args = {
soc: true,
socTitle: "Mein Auto",
connected: true,
socCharge: 15,
minSoC: 30,
};

View file

@ -1,31 +1,31 @@
<template> <template>
<div> <div>
<div class="mb-2">{{ state.socTitle || "Fahrzeug" }}</div> <div class="mb-2">{{ socTitle || "Fahrzeug" }}</div>
<div class="progress" style="height: 24px; font-size: 100%; margin-top: 16px"> <div class="progress" style="height: 24px; font-size: 100%; margin-top: 16px">
<div <div
class="progress-bar" class="progress-bar"
role="progressbar" role="progressbar"
v-bind:class="{ :class="{
'progress-bar-striped': state.charging, 'progress-bar-striped': charging,
'progress-bar-animated': state.charging, 'progress-bar-animated': charging,
'bg-light': !state.connected, 'bg-light': !connected,
'text-secondary': !state.connected, 'text-secondary': !connected,
'bg-warning': state.connected && minSoCActive, 'bg-warning': connected && minSoCActive,
}" }"
v-bind:style="{ width: socChargeDisplayWidth + '%' }" :style="{ width: socChargeDisplayWidth + '%' }"
> >
{{ socChargeDisplayValue }} {{ socChargeDisplayValue }}
</div> </div>
<div <div
class="progress-bar" class="progress-bar"
role="progressbar" role="progressbar"
v-bind:class="{ :class="{
'progress-bar-striped': state.charging, 'progress-bar-striped': charging,
'progress-bar-animated': state.charging, 'progress-bar-animated': charging,
'bg-warning': true, 'bg-warning': true,
'bg-muted': true, 'bg-muted': true,
}" }"
v-bind:style="{ width: minSoCRemainingDisplayWidth + '%' }" :style="{ width: minSoCRemainingDisplayWidth + '%' }"
v-if="minSoCActive && socChargeDisplayWidth < 100" v-if="minSoCActive && socChargeDisplayWidth < 100"
></div> ></div>
</div> </div>
@ -35,38 +35,45 @@
<script> <script>
export default { export default {
name: "Vehicle", name: "Vehicle",
props: ["state"], props: {
socTitle: String,
connected: Boolean,
charging: Boolean,
soc: Boolean,
socCharge: Number,
minSoC: Number,
},
computed: { computed: {
socChargeDisplayWidth: function () { socChargeDisplayWidth: function () {
if (this.state.soc && this.state.socCharge >= 0) { if (this.soc && this.socCharge >= 0) {
return this.state.socCharge; return this.socCharge;
} }
return 100; return 100;
}, },
socChargeDisplayValue: function () { socChargeDisplayValue: function () {
// no soc or no soc value // no soc or no soc value
if (!this.state.soc || this.state.socCharge < 0) { if (!this.soc || this.socCharge < 0) {
let chargeStatus = "getrennt"; let chargeStatus = "getrennt";
if (this.state.charging) { if (this.charging) {
chargeStatus = "laden"; chargeStatus = "laden";
} else if (this.state.connected) { } else if (this.connected) {
chargeStatus = "verbunden"; chargeStatus = "verbunden";
} }
return chargeStatus; return chargeStatus;
} }
// percent value if enough space // percent value if enough space
let socCharge = this.state.socCharge; let socCharge = this.socCharge;
if (socCharge >= 10) { if (socCharge >= 10) {
socCharge += "%"; socCharge += "%";
} }
return socCharge; return socCharge;
}, },
minSoCActive: function () { minSoCActive: function () {
return this.state.minSoC > 0 && this.state.socCharge < this.state.minSoC; return this.minSoC > 0 && this.socCharge < this.minSoC;
}, },
minSoCRemainingDisplayWidth: function () { minSoCRemainingDisplayWidth: function () {
return this.state.minSoC - this.state.socCharge; return this.minSoC - this.socCharge;
}, },
}, },
}; };

View file

@ -0,0 +1,22 @@
import Version from "./Version.vue";
export default {
title: "Main/Version",
component: Version,
argTypes: {},
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { Version },
template: '<Version v-bind="$props"></Version>',
});
export const Base = Template.bind({});
Base.args = {
installed: "0.36",
available: "0.40",
// soc: false,
// socTitle: "Mein Auto",
// connected: true,
};

View file

@ -2,13 +2,12 @@
<div class="collapse" ref="bar"> <div class="collapse" ref="bar">
<div class="row p-3 bg-warning"> <div class="row p-3 bg-warning">
<div class="col-12"> <div class="col-12">
Neue Version verfügbar! Installiert: {{ installed }}. Verfügbar: Neue Version verfügbar! Installiert: {{ installed }}. Verfügbar: {{ available }}.
{{ state.availableVersion }}.
<b <b
class="px-3" class="px-3"
data-toggle="collapse" data-toggle="collapse"
data-target="#release-notes" data-target="#release-notes"
v-if="state.releaseNotes" v-if="releaseNotes"
> >
<a href="#" class="text-body"> <a href="#" class="text-body">
Release notes Release notes
@ -18,9 +17,7 @@
</b> </b>
<b class="px-3"> <b class="px-3">
<a <a
v-bind:href=" :href="'https://github.com/andig/evcc/releases/tag/' + available"
'https://github.com/andig/evcc/releases/tag/' + state.availableVersion
"
class="text-body" class="text-body"
> >
Download <fa-icon icon="chevron-down"></fa-icon> Download <fa-icon icon="chevron-down"></fa-icon>
@ -39,20 +36,24 @@
</div> </div>
</div> </div>
<div class="row p-3 bg-light collapse" id="release-notes" ref="notes"> <div class="row p-3 bg-light collapse" id="release-notes" ref="notes">
<div class="col-12" v-html="state.releaseNotes"></div> <div class="col-12" v-html="releaseNotes"></div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import "../icons";
import $ from "jquery"; import $ from "jquery";
export default { export default {
name: "Version", name: "Version",
props: ["installed"], props: {
installed: String,
available: String,
releaseNotes: String,
},
data: function () { data: function () {
return { return {
state: this.$root.$data.store.state,
notesShown: false, notesShown: false,
}; };
}, },
@ -72,11 +73,11 @@ export default {
); );
}, },
watch: { watch: {
"state.availableVersion": function () { available: function () {
if ( if (
this.installed != window.evcc.version && // go template parsed? this.installed != "[[.Version]]" && // go template parsed?
this.installed != "0.0.1-alpha" && // make used? this.installed != "0.0.1-alpha" && // make used?
this.state.availableVersion != this.installed this.available != this.installed
) { ) {
$(this.$refs.bar).collapse("show"); $(this.$refs.bar).collapse("show");
} }

30
assets/js/icons.js Normal file
View file

@ -0,0 +1,30 @@
import Vue from "vue";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { library } from "@fortawesome/fontawesome-svg-core";
import { faSun } from "@fortawesome/free-solid-svg-icons/faSun";
import { faArrowUp } from "@fortawesome/free-solid-svg-icons/faArrowUp";
import { faArrowDown } from "@fortawesome/free-solid-svg-icons/faArrowDown";
import { faBatteryThreeQuarters } from "@fortawesome/free-solid-svg-icons/faBatteryThreeQuarters";
import { faTemperatureLow } from "@fortawesome/free-solid-svg-icons/faTemperatureLow";
import { faTemperatureHigh } from "@fortawesome/free-solid-svg-icons/faTemperatureHigh";
import { faThermometerHalf } from "@fortawesome/free-solid-svg-icons/faThermometerHalf";
import { faLeaf } from "@fortawesome/free-solid-svg-icons/faLeaf";
import { faChevronUp } from "@fortawesome/free-solid-svg-icons/faChevronUp";
import { faChevronDown } from "@fortawesome/free-solid-svg-icons/faChevronDown";
import { faExclamationTriangle } from "@fortawesome/free-solid-svg-icons/faExclamationTriangle";
library.add(
faSun,
faArrowUp,
faArrowDown,
faBatteryThreeQuarters,
faTemperatureLow,
faTemperatureHigh,
faThermometerHalf,
faLeaf,
faChevronUp,
faChevronDown,
faExclamationTriangle
);
Vue.component("fa-icon", FontAwesomeIcon);

View file

@ -31,13 +31,19 @@
</div> </div>
</nav> </nav>
<Version :installed="installed" id="version-bar"></Version> <Version
id="version-bar"
:installed="installedVersion"
:available="store.state.availableVersion"
:releaseNotes="store.state.releaseNotes"
></Version>
<router-view></router-view> <router-view></router-view>
</div> </div>
</template> </template>
<script> <script>
import "../icons";
import Version from "../components/Version"; import Version from "../components/Version";
import store from "../store"; import store from "../store";
@ -48,7 +54,7 @@ export default {
return { return {
compact: false, compact: false,
store: this.$root.$data.store, store: this.$root.$data.store,
installed: window.evcc.version, installedVersion: window.evcc.version,
}; };
}, },
methods: { methods: {

View file

@ -1,11 +1,11 @@
<template> <template>
<div class="container"> <div class="container">
<!-- <h1 class="display-4 pt-3 mx-auto text-center">Konfiguration</h1> <!-- <h1 class="display-4 pt-3 mx-auto text-center">Konfiguration</h1>
<p class="lead mx-auto text-center">Details der Fahrzeug-, Wallbox- und Zählerkonfiguration.</p> --> <p class="lead mx-auto text-center">Details der Fahrzeug-, Wallbox- und Zählerkonfiguration.</p> -->
<div class="row mt-4 border-bottom"> <div class="row mt-4 border-bottom">
<div class="col-12"> <div class="col-12">
<p class="h1">{{ state.title || "Home" }}</p> <p class="h1">{{ title || "Home" }}</p>
</div> </div>
</div> </div>
@ -13,24 +13,24 @@
<div class="col-md-4"></div> <div class="col-md-4"></div>
<div class="col-6 col-md-2 py-3"> <div class="col-6 col-md-2 py-3">
Netzzähler: Netzzähler:
<span class="text-primary" v-if="state.gridConfigured">✓</span> <span class="text-primary" v-if="gridConfigured">✓</span>
<span class="text-primary" v-else>&mdash;</span> <span class="text-primary" v-else>&mdash;</span>
</div> </div>
<div class="col-6 col-md-2 py-3"> <div class="col-6 col-md-2 py-3">
PV Zähler: PV Zähler:
<span class="text-primary" v-if="state.pvConfigured">✓</span> <span class="text-primary" v-if="pvConfigured">✓</span>
<span class="text-primary" v-else>&mdash;</span> <span class="text-primary" v-else>&mdash;</span>
</div> </div>
<div class="col-6 col-md-2 py-3"> <div class="col-6 col-md-2 py-3">
Batteriezähler: Batteriezähler:
<span class="text-primary" v-if="state.batteryConfigured">✓</span> <span class="text-primary" v-if="batteryConfigured">✓</span>
<span class="text-primary" v-else>&mdash;</span> <span class="text-primary" v-else>&mdash;</span>
</div> </div>
</div> </div>
<div <div
v-for="(loadpoint, id) in state.loadpoints" v-for="(loadpoint, id) in loadpoints"
v-bind:loadpoint="loadpoint" :loadpoint="loadpoint"
:key="id" :key="id"
:id="'loadpoint-' + id" :id="'loadpoint-' + id"
> >
@ -87,9 +87,7 @@
export default { export default {
name: "Config", name: "Config",
data: function () { data: function () {
return { return this.$root.$data.store.state; // global state
state: this.$root.$data.store.state, // global state
};
}, },
}; };
</script> </script>

View file

@ -1,6 +1,6 @@
<template> <template>
<div class="container"> <div class="container">
<Site v-bind:state="state" v-if="configured"></Site> <Site v-bind="state" v-if="configured"></Site>
<div v-else> <div v-else>
<div class="row py-5"> <div class="row py-5">
<div class="col12"> <div class="col12">
@ -86,9 +86,7 @@ export default {
name: "Main", name: "Main",
components: { Site }, components: { Site },
data: function () { data: function () {
return { return this.$root.$data.store; // global state
state: this.$root.$data.store.state, // global state
};
}, },
computed: { computed: {
configured: function () { configured: function () {

10188
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -7,13 +7,21 @@
"build": "rimraf dist; parcel build assets/* --public-url ./dist/", "build": "rimraf dist; parcel build assets/* --public-url ./dist/",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"lint": "prettier assets --write && eslint assets/**/*.js assets/**/*.vue --fix", "lint": "prettier assets --write && eslint assets/**/*.js assets/**/*.vue --fix",
"storybook": "start-storybook -p 6006 -s assets,node_modules/bootstrap/dist",
"build-storybook": "build-storybook",
"fix-audit": "npm-force-resolutions" "fix-audit": "npm-force-resolutions"
}, },
"author": "", "author": "",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.12.9",
"@storybook/addon-actions": "^6.1.10",
"@storybook/addon-essentials": "^6.1.10",
"@storybook/addon-links": "^6.1.10",
"@storybook/vue": "^6.1.10",
"@vue/component-compiler-utils": "^3.2.0", "@vue/component-compiler-utils": "^3.2.0",
"@vue/eslint-config-standard": "^5.1.2", "@vue/eslint-config-standard": "^5.1.2",
"babel-loader": "^8.2.2",
"eslint": "^7.14.0", "eslint": "^7.14.0",
"eslint-config-prettier": "^6.15.0", "eslint-config-prettier": "^6.15.0",
"eslint-plugin-import": "^2.22.1", "eslint-plugin-import": "^2.22.1",
@ -22,12 +30,11 @@
"eslint-plugin-promise": "^4.2.1", "eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.1.0", "eslint-plugin-standard": "^4.1.0",
"eslint-plugin-vue": "^7.1.0", "eslint-plugin-vue": "^7.1.0",
"husky": "^4.3.0",
"lint-staged": "^10.5.1",
"npm-force-resolutions": "0.0.3", "npm-force-resolutions": "0.0.3",
"parcel-bundler": "^1.12.4", "parcel-bundler": "^1.12.4",
"prettier": "^2.2.0", "prettier": "^2.2.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"vue-loader": "^15.9.5",
"vue-template-compiler": "^2.6.12" "vue-template-compiler": "^2.6.12"
}, },
"engines": { "engines": {
@ -52,18 +59,5 @@
}, },
"resolutions": { "resolutions": {
"node-forge": "0.10.0" "node-forge": "0.10.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"assets/**/*.{js,vue,json}": [
"eslint --fix"
],
"assets/**/*.{html,js,vue,json,css}": [
"prettier --write"
]
} }
} }

File diff suppressed because it is too large Load diff