-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
7,192 additions
and
7,322 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<template> | ||
<div :id="id" class="cursor text-secondary"> | ||
<b-icon icon="layout-three-columns"></b-icon> | ||
<b-popover triggers="hover" :target="id" placement="top"> | ||
<b-form-group class="mb-0"> | ||
<b-button size="sm" variant="light" class="w-100 text-left p-0" @click="selectedFields=fields;raiseModelChange();"><i :id="id" class="fas fa-eraser ml-0 mr-2"></i>Select All</b-button> | ||
<b-form-checkbox v-for="d in fields" v-model="selectedFields" :key="d.key" :value="d" @change="raiseModelChange">{{ d.label }}</b-form-checkbox> | ||
</b-form-group> | ||
</b-popover> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
props:["value", "name", "fields"], | ||
model: { | ||
prop: "value", | ||
event: "change" | ||
}, | ||
data () { | ||
return { | ||
id: `grid_colums_selector_${Math.floor(Math.random() * 99)}`, | ||
selectedFields: [], | ||
} | ||
}, | ||
mounted(){ | ||
//get selected fields from localstorage | ||
let v = this.$storage.local.get(`columns.${this.name}`); | ||
if(!v) this.selectedFields = this.fields; | ||
else { | ||
this.selectedFields = this.fields.filter(d => { | ||
return v.includes(`${d.key}|`); | ||
}) | ||
} | ||
this.raiseModelChange(); //v-model emit event | ||
}, | ||
methods: { | ||
raiseModelChange() { | ||
// selected fileds | ||
let r = []; | ||
this.fields.forEach(el => { | ||
if(this.selectedFields.includes(el)) r.push(el) | ||
}); | ||
// save to localstorage / clean-up localstorage | ||
if(r.length ==0 || this.selectedFields == this.fields ) this.$storage.local.delete(`columns.${this.name}`); | ||
else { | ||
let v = ""; | ||
this.selectedFields.forEach(d => { | ||
v += `${d.key}|`; | ||
}) | ||
this.$storage.local.set(`columns.${this.name}`, v); | ||
} | ||
this.$emit("change", r) | ||
} | ||
} | ||
} | ||
</script> |
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,64 @@ | ||
<template> | ||
<div class="row"> | ||
<div v-if="!noNamespace" class="col-sm-2"><b-form-select v-model="selectedNamespace" :options="namespaces()" size="sm" @input="dispatchInput"></b-form-select></div> | ||
<div class="col-sm-2 float-left"> | ||
<div class="input-group input-group-sm" > | ||
<b-form-input v-model="keyword" class="form-control float-right" placeholder="Search" @input="$emit('keyword',keyword)"></b-form-input> | ||
<div class="input-group-append"><button type="submit" class="btn btn-default" @click="dispatchInput"><i class="fas fa-search"></i></button></div> | ||
</div> | ||
</div> | ||
<div v-if="!noLabelSelector" class="col-sm-8"><b-form-tags no-outer-focus class="form-labels-filter" size="sm" v-model="selectedLabels" @input="dispatchInput" tag-variant="info" separator=" ," placeholder="Enter new label selector"></b-form-tags></div> | ||
</div> | ||
</template> | ||
<style scoped> | ||
.form-labels-filter { border: 0; border-bottom: 1px solid #ced4da; background: transparent; padding-left: 0; } | ||
.form-labels-filter >>> span { font-weight: 400; line-height: 1.1; font-size: .9rem;} | ||
.form-labels-filter >>> li { border-radius: .5rem;} | ||
</style> | ||
<script> | ||
export default { | ||
props: { | ||
noLabelSelector: Boolean, | ||
noNamespace: Boolean | ||
}, | ||
data () { | ||
return { | ||
keyword: "" | ||
} | ||
}, | ||
computed: { | ||
selectedLabels: { | ||
get () { | ||
return this.labelSelector() | ||
}, | ||
set (value) { | ||
this.labelSelector(value) | ||
} | ||
}, | ||
selectedNamespace: { | ||
get () { | ||
return this.selectNamespace() | ||
}, | ||
set (value) { | ||
this.selectNamespace(value) | ||
} | ||
} | ||
}, | ||
created(){ | ||
this.$nuxt.$on("context-selected", this.dispatchInput); | ||
if(this.currentContext()) this.dispatchInput(); | ||
}, | ||
methods: { | ||
dispatchInput() { | ||
this.$emit("input", { | ||
namespace: this.noNamespace? "": this.selectedNamespace, | ||
labelSelector: this.noLabelSelector ? "": this.labelSelector().length>0? this.labelSelector().reduce( (accumulator, d) => { return `${accumulator}&${d}`;}): "", | ||
keyword: this.keyword, | ||
}); | ||
} | ||
}, | ||
beforeDestroy(){ | ||
this.$nuxt.$off("context-selected"); | ||
} | ||
} | ||
</script> |
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.