chore: drop legacy editor (#1755)

* drop legacy editor

* remove unused components
This commit is contained in:
Hayden
2022-10-22 12:49:59 -08:00
committed by GitHub
parent fcc5d99d40
commit ce4315f971
8 changed files with 9 additions and 2021 deletions

View File

@@ -1,79 +0,0 @@
<template>
<div>
<v-checkbox
v-for="(option, index) in options"
:key="index"
v-model="option.value"
class="mb-n4 mt-n3"
dense
:label="option.text"
@change="emitValue()"
></v-checkbox>
<template v-if="importBackup">
<v-divider class="my-3"></v-divider>
<v-checkbox
v-model="forceImport"
class="mb-n4"
dense
:label="$t('settings.remove-existing-entries-matching-imported-entries')"
@change="emitValue()"
></v-checkbox>
</template>
</div>
</template>
<script lang="ts">
import { defineComponent, onMounted, useContext } from "@nuxtjs/composition-api";
const UPDATE_EVENT = "input";
export default defineComponent({
props: {
importBackup: {
type: Boolean,
default: false,
},
},
setup(_, context) {
const { i18n } = useContext();
const options = {
recipes: {
value: true,
text: i18n.t("general.recipes"),
},
users: {
value: true,
text: i18n.t("user.users"),
},
groups: {
value: true,
text: i18n.t("group.groups"),
},
}
const forceImport = false;
function emitValue() {
context.emit(UPDATE_EVENT, {
recipes: options.recipes.value,
settings: false,
themes: false,
pages: false,
users: options.users.value,
groups: options.groups.value,
notifications: false,
forceImport,
});
}
onMounted(() => {
emitValue();
});
return {
options,
forceImport,
emitValue,
};
},
});
</script>

View File

@@ -1,110 +0,0 @@
<template>
<div>
<BaseStatCard :icon="$globals.icons.bellAlert" :color="color">
<template #after-heading>
<div class="ml-auto text-right">
<h2 class="body-3 grey--text font-weight-light">
{{ $t("settings.events") }}
</h2>
<h3 class="display-2 font-weight-light text--primary">
<small> {{ total }} </small>
</h3>
</div>
</template>
<div class="d-flex row py-3 justify-end">
<v-btn class="mx-2" small color="error lighten-1" @click="$emit('delete-all')">
<v-icon left> {{ $globals.icons.notificationClearAll }} </v-icon> {{ $t("general.clear") }}
</v-btn>
</div>
<template #bottom>
<v-virtual-scroll height="290" item-height="70" :items="events">
<template #default="{ item }">
<v-list-item>
<v-list-item-avatar>
<v-icon large dark :color="icons[item.category].color">
{{ icons[item.category].icon }}
</v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title>
{{ item.title }}
</v-list-item-title>
<v-list-item-subtitle>
{{ item.text }}
</v-list-item-subtitle>
<v-list-item-subtitle>
{{ $d(Date.parse(item.timeStamp), "long") }}
</v-list-item-subtitle>
</v-list-item-content>
<v-list-item-action class="ml-auto">
<v-btn large icon @click="$emit('delete-item', item.id)">
<v-icon color="error">{{ $globals.icons.delete }}</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
</template>
</v-virtual-scroll>
</template>
</BaseStatCard>
</div>
</template>
<script lang="ts">
import { defineComponent } from "@nuxtjs/composition-api";
export default defineComponent({
layout: "admin",
props: {
events: {
type: Array,
required: true,
},
total: {
type: Number,
default: 0,
},
},
data() {
return {
color: "accent",
selectedId: "",
icons: {
general: {
icon: this.$globals.icons.information,
color: "info",
},
recipe: {
icon: this.$globals.icons.primary,
color: "primary",
},
backup: {
icon: this.$globals.icons.database,
color: "primary",
},
schedule: {
icon: this.$globals.icons.calendar,
color: "primary",
},
migration: {
icon: this.$globals.icons.backupRestore,
color: "primary",
},
user: {
icon: this.$globals.icons.user,
color: "accent",
},
group: {
icon: this.$globals.icons.group,
color: "accent",
},
},
};
},
});
</script>
<style scoped></style>