2020-02-07 19:15:08 +09:00
|
|
|
<template>
|
2021-08-05 00:15:51 +09:00
|
|
|
<div class="vtaihdtm">
|
2021-08-16 15:21:58 +09:00
|
|
|
<div class="body">
|
|
|
|
<div class="search">
|
|
|
|
<MkInput v-model="query" :debounce="true" type="search" class="_inputNoTopMargin _inputNoBottomMargin" :placeholder="$ts.search">
|
|
|
|
<template #prefix><i class="fas fa-search"></i></template>
|
|
|
|
</MkInput>
|
2021-08-05 00:15:51 +09:00
|
|
|
</div>
|
2021-08-16 15:21:58 +09:00
|
|
|
<div class="list">
|
|
|
|
<MkFolder>
|
|
|
|
<template #header>{{ $ts._docs.generalTopics }}</template>
|
|
|
|
<div class="docs">
|
|
|
|
<MkA v-for="doc in docs.filter(doc => doc.path.startsWith('general/'))" :key="doc.path" :to="`/docs/${doc.path}`" class="doc">
|
|
|
|
<div class="title">{{ doc.title }}</div>
|
|
|
|
<div class="summary">{{ doc.summary }}</div>
|
|
|
|
<div class="read">{{ $ts._docs.continueReading }}</div>
|
|
|
|
</MkA>
|
|
|
|
</div>
|
|
|
|
</MkFolder>
|
|
|
|
<MkFolder>
|
|
|
|
<template #header>{{ $ts._docs.features }}</template>
|
|
|
|
<div class="docs">
|
|
|
|
<MkA v-for="doc in docs.filter(doc => doc.path.startsWith('features/'))" :key="doc.path" :to="`/docs/${doc.path}`" class="doc">
|
|
|
|
<div class="title">{{ doc.title }}</div>
|
|
|
|
<div class="summary">{{ doc.summary }}</div>
|
|
|
|
<div class="read">{{ $ts._docs.continueReading }}</div>
|
|
|
|
</MkA>
|
|
|
|
</div>
|
|
|
|
</MkFolder>
|
|
|
|
<MkFolder>
|
|
|
|
<template #header>{{ $ts._docs.advancedTopics }}</template>
|
|
|
|
<div class="docs">
|
|
|
|
<MkA v-for="doc in docs.filter(doc => doc.path.startsWith('advanced/'))" :key="doc.path" :to="`/docs/${doc.path}`" class="doc">
|
|
|
|
<div class="title">{{ doc.title }}</div>
|
|
|
|
<div class="summary">{{ doc.summary }}</div>
|
|
|
|
<div class="read">{{ $ts._docs.continueReading }}</div>
|
|
|
|
</MkA>
|
|
|
|
</div>
|
|
|
|
</MkFolder>
|
|
|
|
<MkFolder>
|
|
|
|
<template #header>{{ $ts._docs.admin }}</template>
|
|
|
|
<div class="docs">
|
|
|
|
<MkA v-for="doc in docs.filter(doc => doc.path.startsWith('admin/'))" :key="doc.path" :to="`/docs/${doc.path}`" class="doc">
|
|
|
|
<div class="title">{{ doc.title }}</div>
|
|
|
|
<div class="summary">{{ doc.summary }}</div>
|
|
|
|
<div class="read">{{ $ts._docs.continueReading }}</div>
|
|
|
|
</MkA>
|
|
|
|
</div>
|
|
|
|
</MkFolder>
|
2021-08-05 00:15:51 +09:00
|
|
|
</div>
|
2021-08-16 15:21:58 +09:00
|
|
|
</div>
|
2020-02-07 19:15:08 +09:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 20:12:00 +09:00
|
|
|
import { defineComponent } from 'vue';
|
2021-03-23 17:30:14 +09:00
|
|
|
import { url, lang } from '@client/config';
|
2021-04-10 12:54:12 +09:00
|
|
|
import * as symbols from '@client/symbols';
|
2021-08-05 00:15:51 +09:00
|
|
|
import MkFolder from '@client/components/ui/folder.vue';
|
|
|
|
import MkInput from '@client/components/ui/input.vue';
|
2020-02-07 19:15:08 +09:00
|
|
|
|
2020-10-17 20:12:00 +09:00
|
|
|
export default defineComponent({
|
2021-08-05 00:15:51 +09:00
|
|
|
components: {
|
|
|
|
MkFolder,
|
|
|
|
MkInput,
|
|
|
|
},
|
|
|
|
|
2020-02-07 19:15:08 +09:00
|
|
|
data() {
|
|
|
|
return {
|
2021-04-10 12:54:12 +09:00
|
|
|
[symbols.PAGE_INFO]: {
|
2020-12-26 10:47:36 +09:00
|
|
|
title: this.$ts.help,
|
2021-04-20 23:22:59 +09:00
|
|
|
icon: 'fas fa-question-circle'
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
2020-02-07 19:43:37 +09:00
|
|
|
docs: [],
|
2021-08-05 00:15:51 +09:00
|
|
|
query: null,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
query() {
|
|
|
|
fetch(`${url}/docs.json?lang=${lang}&q=${this.query}`).then(res => res.json()).then(docs => {
|
|
|
|
this.docs = docs;
|
|
|
|
});
|
2020-02-07 19:15:08 +09:00
|
|
|
}
|
|
|
|
},
|
2020-02-07 19:43:37 +09:00
|
|
|
|
|
|
|
created() {
|
2021-08-05 16:04:31 +09:00
|
|
|
fetch(`${url}/docs.json?lang=ja-JP`).then(res => res.json()).then(jaDocs => {
|
|
|
|
fetch(`${url}/docs.json?lang=${lang}`).then(res => res.json()).then(docs => {
|
|
|
|
this.docs = jaDocs.map(doc => {
|
|
|
|
const exist = docs.find(d => d.path === doc.path);
|
|
|
|
return exist || doc;
|
|
|
|
});
|
|
|
|
});
|
2020-02-07 19:43:37 +09:00
|
|
|
});
|
|
|
|
},
|
2020-02-07 19:15:08 +09:00
|
|
|
});
|
|
|
|
</script>
|
2021-08-05 00:15:51 +09:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.vtaihdtm {
|
|
|
|
background: var(--panel);
|
|
|
|
|
2021-08-16 15:21:58 +09:00
|
|
|
> .body {
|
|
|
|
max-width: 900px;
|
|
|
|
margin: 0 auto;
|
2021-08-05 00:15:51 +09:00
|
|
|
|
2021-08-16 15:21:58 +09:00
|
|
|
> .search {
|
2021-08-05 00:15:51 +09:00
|
|
|
padding: 16px;
|
2021-08-16 15:21:58 +09:00
|
|
|
}
|
2021-08-05 00:15:51 +09:00
|
|
|
|
2021-08-16 15:21:58 +09:00
|
|
|
> .list {
|
|
|
|
padding: 0 16px;
|
2021-08-05 00:15:51 +09:00
|
|
|
|
2021-08-16 15:21:58 +09:00
|
|
|
.docs {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
|
|
|
|
grid-gap: 12px;
|
|
|
|
margin: 0 0 16px 0;
|
2021-08-05 00:15:51 +09:00
|
|
|
|
2021-08-16 15:21:58 +09:00
|
|
|
> .doc {
|
|
|
|
display: inline-block;
|
|
|
|
padding: 16px;
|
|
|
|
border: solid 1px var(--divider);
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
border: solid 1px var(--accent);
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .title {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .summary {
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
font-size: 0.9em;
|
|
|
|
}
|
2021-08-05 00:15:51 +09:00
|
|
|
|
2021-08-16 15:21:58 +09:00
|
|
|
> .read {
|
|
|
|
color: var(--link);
|
|
|
|
font-size: 0.9em;
|
|
|
|
}
|
|
|
|
}
|
2021-08-05 00:15:51 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|