Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
FGRCL committed Jun 28, 2023
1 parent e58903f commit a1651db
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
17 changes: 8 additions & 9 deletions src/components/inputs/CheckboxList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,29 @@
</template>

<script lang="ts">
import {Component, Mixins, Prop} from "vue-property-decorator";
import BaseMixin from "../mixins/base";
import {computed} from "vue";
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '../mixins/base'
import { computed } from 'vue'
@Component
export default class CheckboxList extends Mixins(BaseMixin) {
@Prop({required: true})
declare readonly options: {label: string, value: string}[]
@Prop({ required: true })
declare readonly options: { label: string; value: string }[]
@Prop({type: Boolean, required: false, default: false})
@Prop({ type: Boolean, required: false, default: false })
declare readonly selectAll: boolean
private selectedCheckboxes: string[] = []
private selectAllIndeterminate: boolean = false
selectAllModel = computed<boolean>({
get: this.getSelectAll,
set: this.setSelectAll
set: this.setSelectAll,
})
getSelectAll(): boolean {
this.selectAllIndeterminate = false
if (0 < this.selectedCheckboxes.length && this.selectedCheckboxes.length < this.options.length){
if (0 < this.selectedCheckboxes.length && this.selectedCheckboxes.length < this.options.length) {
this.selectAllIndeterminate = true
return false
}
Expand Down
31 changes: 18 additions & 13 deletions src/components/settings/SettingsGeneralTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@
<checkbox-list
:options="backupableNamespaces"
select-all
@update:selectedCheckboxes="onSelectBackupCheckboxes">
</checkbox-list>
@update:selectedCheckboxes="onSelectBackupCheckboxes"></checkbox-list>
</v-row>
<v-row>
<v-col class="text-center">
Expand Down Expand Up @@ -217,8 +216,7 @@
<checkbox-list
:options="restoreableNamespaces"
select-all
@update:selectedCheckboxes="onSelectRestoreCheckboxes">
</checkbox-list>
@update:selectedCheckboxes="onSelectRestoreCheckboxes"></checkbox-list>
</v-row>
<v-row>
<v-col class="text-center">
Expand All @@ -241,7 +239,7 @@ import SettingsRow from '@/components/settings/SettingsRow.vue'
import Panel from '@/components/ui/Panel.vue'
import Vue from 'vue'
import { mdiCloseThick, mdiHelpCircle } from '@mdi/js'
import CheckboxList from "@/components/inputs/CheckboxList.vue";
import CheckboxList from '@/components/inputs/CheckboxList.vue'
@Component({
components: { Panel, SettingsRow, CheckboxList },
Expand Down Expand Up @@ -528,7 +526,7 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
}
async resetMainsail() {
await this.refreshBackupTargets();
await this.refreshBackupTargets()
this.backupCheckboxes = []
this.dialogResetMainsail = true
Expand All @@ -553,21 +551,23 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
this.backupableNamespaces = []
if (this.availableNamespaces.includes('mainsail')) {
await this.refreshMainsailKeys()
this.backupableNamespaces.push(...this.mainsailKeys.map((k) => ({
label: k.label,
value: k.name
})))
this.backupableNamespaces.push(
...this.mainsailKeys.map((k) => ({
label: k.label,
value: k.name,
}))
)
}
if (this.availableNamespaces.includes('timelapse')) {
this.backupableNamespaces.push({
value: 'timelapase',
label: this.$t('Settings.GeneralTab.DbTimelapseSettings').toString()
label: this.$t('Settings.GeneralTab.DbTimelapseSettings').toString(),
})
}
if (this.availableNamespaces.includes('webcams')) {
this.backupableNamespaces.push({
value: 'webcams',
label: this.$t('Settings.GeneralTab.DbWebcams').toString()
label: this.$t('Settings.GeneralTab.DbWebcams').toString(),
})
}
}
Expand Down Expand Up @@ -597,7 +597,12 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
Object.keys(this.restoreObjects).forEach((tmp: string) => {
const namespace = this.availableKeys.find((namespace) => namespace.name === tmp)
const tmpNamespace = namespace ? { value: namespace.name, label: namespace.label} : { value: tmp, label: tmp }
const tmpNamespace = namespace
? {
value: namespace.name,
label: namespace.label,
}
: { value: tmp, label: tmp }
this.restoreableNamespaces.push(tmpNamespace)
})
Expand Down

0 comments on commit a1651db

Please sign in to comment.