aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/src/components/model/Orphans.vue
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard/src/components/model/Orphans.vue')
-rw-r--r--dashboard/src/components/model/Orphans.vue79
1 files changed, 79 insertions, 0 deletions
diff --git a/dashboard/src/components/model/Orphans.vue b/dashboard/src/components/model/Orphans.vue
new file mode 100644
index 00000000..b3c1c524
--- /dev/null
+++ b/dashboard/src/components/model/Orphans.vue
@@ -0,0 +1,79 @@
+<template>
+ <div>
+ <div class="alert alert-dismissable alert-warning">
+ <button type="button" class="close" data-dismiss="alert" @click="showOrphan = false; $emit('close')">×</button>
+ <h4>Warning!</h4>
+ <p>
+ Some metarules or categories are orphan, please check them and delete them if necessary.
+ <a
+ href
+ @click.prevent="showOrphan = true"
+ v-show="!showOrphan"
+ >Show orphans</a>
+ <a href @click.prevent="showOrphan = false" v-show="showOrphan">Hide orphans</a>
+ </p>
+ </div>
+
+ <div class="row" v-show="showOrphan">
+ <div class="list-group col-lg-3" v-if="orphanMetaRules.length">
+ <h3 class="list-group-item active">Orphan Meta rules</h3>
+ <div v-for="metaRule in orphanMetaRules" class="list-group-item" :key="metaRule.id">
+ <h4 class="list-group-item-heading inline">{{ metaRule.name }}</h4>
+ <button
+ type="button"
+ class="fa fa-trash pull-right btn btn-dark btn-sm"
+ @click="removeMetarule(metaRule)"
+ title="Remove Meta rule"
+ ></button>
+ <p class="list-group-item-text">{{ metaRule.description }}</p>
+ </div>
+ </div>
+
+ <OrphanCategory
+ v-if="orphanSubjectCategories.length"
+ type="subject"
+ :categories="orphanSubjectCategories"
+ ></OrphanCategory>
+ <OrphanCategory
+ v-if="orphanObjectCategories.length"
+ type="object"
+ :categories="orphanObjectCategories"
+ ></OrphanCategory>
+ <OrphanCategory
+ v-if="orphanActionCategories.length"
+ type="action"
+ :categories="orphanActionCategories"
+ ></OrphanCategory>
+ </div>
+ </div>
+</template>
+
+<script>
+import ModelService from "./../../services/Model.service.js";
+import OrphanCategory from "./OrphanCategory.vue";
+
+export default {
+ props: {
+ orphanMetaRules: Array,
+ orphanSubjectCategories: Array,
+ orphanObjectCategories: Array,
+ orphanActionCategories: Array
+ },
+ components: {
+ OrphanCategory,
+ },
+ data() {
+ return {
+ showOrphan: false,
+ allowAlert: true
+ };
+ },
+ methods: {
+ removeMetarule(metarule) {
+ if (confirm("Are you sure to remove this Meta Rule?")) {
+ ModelService.removeMetaRule(metarule);
+ }
+ }
+ }
+};
+</script> \ No newline at end of file