mirror of
https://github.com/simon987/sist2.git
synced 2025-04-19 10:16:42 +00:00
Rework sist2-admin UI
This commit is contained in:
parent
b833acf522
commit
70242846ae
@ -9,13 +9,18 @@
|
|||||||
@input="frontend.jobs = $event; $emit('input')"
|
@input="frontend.jobs = $event; $emit('input')"
|
||||||
>
|
>
|
||||||
<div v-for="job in jobs" :key="job.name">
|
<div v-for="job in jobs" :key="job.name">
|
||||||
<b-form-checkbox :disabled="job.status !== 'indexed'" :value="job.name">[{{ job.name }}]</b-form-checkbox>
|
<b-form-checkbox :disabled="job.status !== 'indexed'"
|
||||||
|
:value="job.name">
|
||||||
|
<template #default><span
|
||||||
|
:title="job.status !== 'indexed' ? $t('jobOptions.notIndexed') : ''"
|
||||||
|
>[{{ job.name }}]</span></template>
|
||||||
|
</b-form-checkbox>
|
||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
</b-form-checkbox-group>
|
</b-form-checkbox-group>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<span class="text-muted">{{ $t('jobOptions.noJobAvailable') }}</span>
|
<span class="text-muted">{{ $t('jobOptions.noJobAvailable') }}</span>
|
||||||
<router-link to="/">{{$t("create")}}</router-link>
|
<router-link to="/">{{ $t("create") }}</router-link>
|
||||||
</div>
|
</div>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
</div>
|
</div>
|
||||||
@ -29,13 +34,20 @@ export default {
|
|||||||
props: ["frontend"],
|
props: ["frontend"],
|
||||||
mounted() {
|
mounted() {
|
||||||
Sist2AdminApi.getJobs().then(resp => {
|
Sist2AdminApi.getJobs().then(resp => {
|
||||||
this.jobs = resp.data;
|
this._jobs = resp.data;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
jobs() {
|
||||||
|
return this._jobs
|
||||||
|
.filter(job => job.index_options.search_backend === this.frontend.web_options.search_backend)
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
|
_jobs: null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<h4>{{ $t("webOptions.title") }}</h4>
|
||||||
|
<b-card>
|
||||||
<label>{{ $t("webOptions.lang") }}</label>
|
<label>{{ $t("webOptions.lang") }}</label>
|
||||||
<b-form-select v-model="options.lang" :options="['en', 'fr', 'zh-CN']" @change="update()"></b-form-select>
|
<b-form-select v-model="options.lang" :options="['en', 'fr', 'zh-CN', 'pl', 'de']"
|
||||||
|
@change="update()"></b-form-select>
|
||||||
|
|
||||||
<label>{{ $t("webOptions.bind") }}</label>
|
<label>{{ $t("webOptions.bind") }}</label>
|
||||||
<b-form-input v-model="options.bind" @change="update()"></b-form-input>
|
<b-form-input v-model="options.bind" @change="update()"></b-form-input>
|
||||||
@ -15,9 +17,11 @@
|
|||||||
|
|
||||||
<label>{{ $t("webOptions.tagAuth") }}</label>
|
<label>{{ $t("webOptions.tagAuth") }}</label>
|
||||||
<b-form-input v-model="options.tag_auth" @change="update()"></b-form-input>
|
<b-form-input v-model="options.tag_auth" @change="update()"></b-form-input>
|
||||||
|
</b-card>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<h5>Auth0 options</h5>
|
<h4>Auth0 options</h4>
|
||||||
|
<b-card>
|
||||||
<label>{{ $t("webOptions.auth0Audience") }}</label>
|
<label>{{ $t("webOptions.auth0Audience") }}</label>
|
||||||
<b-form-input v-model="options.auth0_audience" @change="update()"></b-form-input>
|
<b-form-input v-model="options.auth0_audience" @change="update()"></b-form-input>
|
||||||
|
|
||||||
@ -29,13 +33,12 @@
|
|||||||
|
|
||||||
<label>{{ $t("webOptions.auth0PublicKey") }}</label>
|
<label>{{ $t("webOptions.auth0PublicKey") }}</label>
|
||||||
<b-textarea rows="10" v-model="options.auth0_public_key" @change="update()"></b-textarea>
|
<b-textarea rows="10" v-model="options.auth0_public_key" @change="update()"></b-textarea>
|
||||||
|
</b-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import sist2AdminApi from "@/Sist2AdminApi";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "WebOptions",
|
name: "WebOptions",
|
||||||
props: ["options", "frontendName"],
|
props: ["options", "frontendName"],
|
||||||
@ -48,10 +51,6 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
update() {
|
update() {
|
||||||
if (!this.options.es_url.startsWith("https")) {
|
|
||||||
this.options.es_insecure_ssl = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$emit("change", this.options);
|
this.$emit("change", this.options);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,10 @@ export default {
|
|||||||
searchBackendTitle: "search backend configuration",
|
searchBackendTitle: "search backend configuration",
|
||||||
newBackendName: "New search backend name",
|
newBackendName: "New search backend name",
|
||||||
|
|
||||||
selectJobs: "Select jobs",
|
frontendTab: "Frontend",
|
||||||
|
backendTab: "Backend",
|
||||||
|
|
||||||
|
selectJobs: "Available jobs",
|
||||||
webOptions: {
|
webOptions: {
|
||||||
title: "Web options",
|
title: "Web options",
|
||||||
lang: "UI Language",
|
lang: "UI Language",
|
||||||
@ -109,12 +112,13 @@ export default {
|
|||||||
keepNLogs: "Keep last N log files. Set to -1 to keep all logs.",
|
keepNLogs: "Keep last N log files. Set to -1 to keep all logs.",
|
||||||
deleteNow: "Delete now",
|
deleteNow: "Delete now",
|
||||||
scheduleEnabled: "Enable scheduled re-scan",
|
scheduleEnabled: "Enable scheduled re-scan",
|
||||||
noJobAvailable: "No jobs available.",
|
noJobAvailable: "No jobs available for this search backend.",
|
||||||
|
notIndexed: "Has not been indexed yet",
|
||||||
noBackendError: "You must select a search backend to run this job",
|
noBackendError: "You must select a search backend to run this job",
|
||||||
desktopNotifications: "Desktop notifications"
|
desktopNotifications: "Desktop notifications"
|
||||||
},
|
},
|
||||||
frontendOptions: {
|
frontendOptions: {
|
||||||
title: "Frontend options",
|
title: "Advanced options",
|
||||||
noJobSelectedWarning: "You must select at least one job to start this frontend"
|
noJobSelectedWarning: "You must select at least one job to start this frontend"
|
||||||
},
|
},
|
||||||
notifications: {
|
notifications: {
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
</small>
|
</small>
|
||||||
</b-card-title>
|
</b-card-title>
|
||||||
|
|
||||||
|
<!-- Action buttons-->
|
||||||
<div class="mb-3" v-if="!loading">
|
<div class="mb-3" v-if="!loading">
|
||||||
<b-button class="mr-1" :disabled="frontend.running || !valid" variant="success" @click="start()">{{
|
<b-button class="mr-1" :disabled="frontend.running || !valid" variant="success" @click="start()">{{
|
||||||
$t("start")
|
$t("start")
|
||||||
@ -23,10 +24,26 @@
|
|||||||
<b-button variant="danger" @click="deleteFrontend()">{{ $t("delete") }}</b-button>
|
<b-button variant="danger" @click="deleteFrontend()">{{ $t("delete") }}</b-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<b-progress v-if="loading" striped animated value="100"></b-progress>
|
<b-progress v-if="loading" striped animated value="100"></b-progress>
|
||||||
<b-card-body v-else>
|
<b-card-body v-else>
|
||||||
|
|
||||||
|
<h4>{{ $t("backendOptions.title") }}</h4>
|
||||||
|
<b-card>
|
||||||
|
<b-alert v-if="!valid" variant="warning" show>{{ $t("frontendOptions.noJobSelectedWarning") }}</b-alert>
|
||||||
|
|
||||||
|
<SearchBackendSelect :value="frontend.web_options.search_backend"
|
||||||
|
@change="onBackendSelect($event)"></SearchBackendSelect>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<JobCheckboxGroup :frontend="frontend" @input="update()"></JobCheckboxGroup>
|
||||||
|
</b-card>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<WebOptions :options="frontend.web_options" :frontend-name="$route.params.name"
|
||||||
|
@change="update()"></WebOptions>
|
||||||
|
<br/>
|
||||||
|
|
||||||
<h4>{{ $t("frontendOptions.title") }}</h4>
|
<h4>{{ $t("frontendOptions.title") }}</h4>
|
||||||
<b-card>
|
<b-card>
|
||||||
<b-form-checkbox v-model="frontend.auto_start" @change="update()">
|
<b-form-checkbox v-model="frontend.auto_start" @change="update()">
|
||||||
@ -38,32 +55,8 @@
|
|||||||
|
|
||||||
<label>{{ $t("customUrl") }}</label>
|
<label>{{ $t("customUrl") }}</label>
|
||||||
<b-form-input v-model="frontend.custom_url" @change="update()" placeholder="http://"></b-form-input>
|
<b-form-input v-model="frontend.custom_url" @change="update()" placeholder="http://"></b-form-input>
|
||||||
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
<b-alert v-if="!valid" variant="warning" show>{{ $t("frontendOptions.noJobSelectedWarning") }}</b-alert>
|
|
||||||
|
|
||||||
<JobCheckboxGroup :frontend="frontend" @input="update()"></JobCheckboxGroup>
|
|
||||||
</b-card>
|
|
||||||
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
<h4>{{ $t("webOptions.title") }}</h4>
|
|
||||||
<b-card>
|
|
||||||
<WebOptions :options="frontend.web_options" :frontend-name="$route.params.name"
|
|
||||||
@change="update()"></WebOptions>
|
|
||||||
</b-card>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<h4>{{ $t("backendOptions.title") }}</h4>
|
|
||||||
<b-card>
|
|
||||||
<SearchBackendSelect :value="frontend.web_options.search_backend"
|
|
||||||
@change="onBackendSelect($event)"></SearchBackendSelect>
|
|
||||||
</b-card>
|
</b-card>
|
||||||
</b-card-body>
|
</b-card-body>
|
||||||
|
|
||||||
|
|
||||||
</b-card>
|
</b-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -137,6 +130,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onBackendSelect(backend) {
|
onBackendSelect(backend) {
|
||||||
this.frontend.web_options.search_backend = backend;
|
this.frontend.web_options.search_backend = backend;
|
||||||
|
this.frontend.jobs = [];
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<b-tabs content-class="mt-3">
|
||||||
|
<b-tab :title="$t('backendTab')">
|
||||||
|
|
||||||
|
<b-card>
|
||||||
|
<b-card-title>{{ $t("searchBackends") }}</b-card-title>
|
||||||
|
|
||||||
|
<b-row>
|
||||||
|
<b-col>
|
||||||
|
<b-input v-model="newBackendName" :placeholder="$t('newBackendName')"></b-input>
|
||||||
|
</b-col>
|
||||||
|
<b-col>
|
||||||
|
<b-button variant="primary" @click="createBackend()"
|
||||||
|
:disabled="!backendNameValid(newBackendName)">
|
||||||
|
{{ $t("create") }}
|
||||||
|
</b-button>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<b-progress v-if="backendsLoading" striped animated value="100"></b-progress>
|
||||||
|
<b-list-group v-else>
|
||||||
|
<SearchBackendListItem v-for="backend in backends"
|
||||||
|
:key="backend.name" :backend="backend"></SearchBackendListItem>
|
||||||
|
</b-list-group>
|
||||||
|
|
||||||
|
</b-card>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
<b-card>
|
<b-card>
|
||||||
<b-card-title>{{ $t("jobs") }}</b-card-title>
|
<b-card-title>{{ $t("jobs") }}</b-card-title>
|
||||||
<b-row>
|
<b-row>
|
||||||
@ -28,9 +58,8 @@
|
|||||||
<JobListItem v-for="job in jobs" :key="job.name" :job="job"></JobListItem>
|
<JobListItem v-for="job in jobs" :key="job.name" :job="job"></JobListItem>
|
||||||
</b-list-group>
|
</b-list-group>
|
||||||
</b-card>
|
</b-card>
|
||||||
|
</b-tab>
|
||||||
<br/>
|
<b-tab :title="$t('frontendTab')">
|
||||||
|
|
||||||
<b-card>
|
<b-card>
|
||||||
|
|
||||||
<b-card-title>{{ $t("frontends") }}</b-card-title>
|
<b-card-title>{{ $t("frontends") }}</b-card-title>
|
||||||
@ -56,33 +85,8 @@
|
|||||||
</b-list-group>
|
</b-list-group>
|
||||||
|
|
||||||
</b-card>
|
</b-card>
|
||||||
|
</b-tab>
|
||||||
<br/>
|
</b-tabs>
|
||||||
|
|
||||||
<b-card>
|
|
||||||
<b-card-title>{{ $t("searchBackends") }}</b-card-title>
|
|
||||||
|
|
||||||
<b-row>
|
|
||||||
<b-col>
|
|
||||||
<b-input v-model="newBackendName" :placeholder="$t('newBackendName')"></b-input>
|
|
||||||
</b-col>
|
|
||||||
<b-col>
|
|
||||||
<b-button variant="primary" @click="createBackend()"
|
|
||||||
:disabled="!backendNameValid(newBackendName)">
|
|
||||||
{{ $t("create") }}
|
|
||||||
</b-button>
|
|
||||||
</b-col>
|
|
||||||
</b-row>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<b-progress v-if="backendsLoading" striped animated value="100"></b-progress>
|
|
||||||
<b-list-group v-else>
|
|
||||||
<SearchBackendListItem v-for="backend in backends"
|
|
||||||
:key="backend.name" :backend="backend"></SearchBackendListItem>
|
|
||||||
</b-list-group>
|
|
||||||
|
|
||||||
</b-card>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -24,13 +24,6 @@
|
|||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<h4>{{ $t("scanOptions.title") }}</h4>
|
|
||||||
<b-card>
|
|
||||||
<ScanOptions :options="job.scan_options" @change="update()"></ScanOptions>
|
|
||||||
</b-card>
|
|
||||||
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
<h4>{{ $t("backendOptions.title") }}</h4>
|
<h4>{{ $t("backendOptions.title") }}</h4>
|
||||||
<b-card>
|
<b-card>
|
||||||
<b-alert v-if="!valid" variant="warning" show>{{ $t("jobOptions.noBackendError") }}</b-alert>
|
<b-alert v-if="!valid" variant="warning" show>{{ $t("jobOptions.noBackendError") }}</b-alert>
|
||||||
@ -38,6 +31,13 @@
|
|||||||
@change="onBackendSelect($event)"></SearchBackendSelect>
|
@change="onBackendSelect($event)"></SearchBackendSelect>
|
||||||
</b-card>
|
</b-card>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<h4>{{ $t("scanOptions.title") }}</h4>
|
||||||
|
<b-card>
|
||||||
|
<ScanOptions :options="job.scan_options" @change="update()"></ScanOptions>
|
||||||
|
</b-card>
|
||||||
|
|
||||||
</b-card-body>
|
</b-card-body>
|
||||||
|
|
||||||
</b-card>
|
</b-card>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user