Compare commits

...

2 Commits

Author SHA1 Message Date
e82a388d1e Don't show resolution badge on narrow images 2021-10-22 10:21:35 -04:00
bf02e571b3 Forgot to add that file two commits ago 2021-10-22 09:44:56 -04:00
8 changed files with 87 additions and 16 deletions

View File

@ -0,0 +1,58 @@
{
"index": {
"refresh_interval": "30s",
"codec": "best_compression",
"number_of_replicas": 0
},
"analysis": {
"tokenizer": {
"path_tokenizer": {
"type": "path_hierarchy",
"delimiter": "/"
},
"tag_tokenizer": {
"type": "path_hierarchy",
"delimiter": "."
},
"my_nGram_tokenizer": {
"type": "nGram",
"min_gram": 3,
"max_gram": 3
}
},
"analyzer": {
"path_analyzer": {
"tokenizer": "path_tokenizer",
"filter": [
"lowercase"
]
},
"tag_analyzer": {
"tokenizer": "tag_tokenizer",
"filter": [
"lowercase"
]
},
"case_insensitive_kw_analyzer": {
"tokenizer": "keyword",
"filter": [
"lowercase"
]
},
"my_nGram": {
"tokenizer": "my_nGram_tokenizer",
"filter": [
"lowercase",
"asciifolding"
]
},
"content_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
"asciifolding"
]
}
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -51,6 +51,7 @@ export interface EsHit {
duration: number duration: number
tag: string[] tag: string[]
checksum: string checksum: string
thumbnail: string
} }
_props: { _props: {
isSubDocument: boolean isSubDocument: boolean
@ -61,6 +62,8 @@ export interface EsHit {
isPlayableImage: boolean isPlayableImage: boolean
isAudio: boolean isAudio: boolean
hasThumbnail: boolean hasThumbnail: boolean
tnW: number
tnH: number
} }
highlight: { highlight: {
name: string[] | undefined, name: string[] | undefined,
@ -131,6 +134,8 @@ class Sist2Api {
if ("thumbnail" in hit._source) { if ("thumbnail" in hit._source) {
hit._props.hasThumbnail = true; hit._props.hasThumbnail = true;
hit._props.tnW = Number(hit._source.thumbnail.split(",")[0]);
hit._props.tnH = Number(hit._source.thumbnail.split(",")[1]);
} }
switch (mimeCategory) { switch (mimeCategory) {

View File

@ -15,11 +15,15 @@
<span class="badge badge-resolution">{{ humanTime(doc._source.duration) }}</span> <span class="badge badge-resolution">{{ humanTime(doc._source.duration) }}</span>
</div> </div>
<div v-if="doc._props.isImage && !hover" class="card-img-overlay" :class="{'small-badge': smallBadge}"> <div
v-if="doc._props.isImage && !hover && doc._props.tnW / doc._props.tnH < 5"
class="card-img-overlay"
:class="{'small-badge': smallBadge}">
<span class="badge badge-resolution">{{ `${doc._source.width}x${doc._source.height}` }}</span> <span class="badge badge-resolution">{{ `${doc._source.width}x${doc._source.height}` }}</span>
</div> </div>
<div v-if="(doc._props.isVideo || doc._props.isGif) && doc._source.duration > 0 && !hover" class="card-img-overlay" <div v-if="(doc._props.isVideo || doc._props.isGif) && doc._source.duration > 0 && !hover"
class="card-img-overlay"
:class="{'small-badge': smallBadge}"> :class="{'small-badge': smallBadge}">
<span class="badge badge-resolution">{{ humanTime(doc._source.duration) }}</span> <span class="badge badge-resolution">{{ humanTime(doc._source.duration) }}</span>
</div> </div>
@ -39,7 +43,8 @@
</div> </div>
<!-- Audio player--> <!-- Audio player-->
<audio v-if="doc._props.isAudio" ref="audio" preload="none" class="audio-fit fit" controls :type="doc._source.mime" <audio v-if="doc._props.isAudio" ref="audio" preload="none" class="audio-fit fit" controls
:type="doc._source.mime"
:src="`f/${doc._id}`" :src="`f/${doc._id}`"
@play="onAudioPlay()"></audio> @play="onAudioPlay()"></audio>

View File

@ -21,6 +21,9 @@ export default {
if (mutation.type === "setUiMimeMap") { if (mutation.type === "setUiMimeMap") {
const mimeMap = mutation.payload.slice(); const mimeMap = mutation.payload.slice();
const elem = document.getElementById("mimeTree");
console.log(elem);
this.mimeTree = new InspireTree({ this.mimeTree = new InspireTree({
selection: { selection: {
mode: 'checkbox' mode: 'checkbox'

View File

@ -31,7 +31,7 @@
</b-row> </b-row>
</b-col> </b-col>
<b-col> <b-col>
<b-tabs> <b-tabs justified>
<b-tab :title="$t('mimeTypes')"> <b-tab :title="$t('mimeTypes')">
<MimePicker></MimePicker> <MimePicker></MimePicker>
</b-tab> </b-tab>
@ -43,13 +43,13 @@
</b-row> </b-row>
</b-card> </b-card>
<template v-if="docs.length === 0 && !uiLoading"> <div v-show="docs.length === 0 && !uiLoading">
<Preloader v-if="searchBusy" class="mt-3"></Preloader> <Preloader v-if="searchBusy" class="mt-3"></Preloader>
<ResultsCard></ResultsCard> <ResultsCard></ResultsCard>
</template> </div>
<div v-else> <div v-if="docs.length > 0">
<ResultsCard></ResultsCard> <ResultsCard></ResultsCard>
<DocCardWall v-if="optDisplay==='grid'" :docs="docs" :append="appendFunc"></DocCardWall> <DocCardWall v-if="optDisplay==='grid'" :docs="docs" :append="appendFunc"></DocCardWall>
@ -113,10 +113,6 @@ export default Vue.extend({
}, 350, {leading: false}); }, 350, {leading: false});
Sist2Api.getMimeTypes().then(mimeMap => {
this.$store.commit("setUiMimeMap", mimeMap);
});
this.$store.dispatch("loadFromArgs", this.$route).then(() => { this.$store.dispatch("loadFromArgs", this.$route).then(() => {
this.$store.subscribe(() => this.$store.dispatch("updateArgs", this.$router)); this.$store.subscribe(() => this.$store.dispatch("updateArgs", this.$router));
this.$store.subscribe((mutation) => { this.$store.subscribe((mutation) => {
@ -142,9 +138,13 @@ export default Vue.extend({
sist2.getSist2Info().then(data => { sist2.getSist2Info().then(data => {
this.setSist2Info(data); this.setSist2Info(data);
this.setIndices(data.indices); this.setIndices(data.indices);
this.uiLoading = false;
Sist2Api.getMimeTypes().then(mimeMap => {
this.$store.commit("setUiMimeMap", mimeMap);
this.uiLoading = false;
this.search(true); this.search(true);
});
}).catch(() => { }).catch(() => {
this.showErrorToast(); this.showErrorToast();
}); });

File diff suppressed because one or more lines are too long