mirror of
https://github.com/gotson/komga.git
synced 2025-12-20 23:45:11 +01:00
parent
fa65e94ae6
commit
b599b72c48
2 changed files with 28 additions and 0 deletions
|
|
@ -41,6 +41,19 @@
|
|||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
|
||||
<v-menu offset-y v-if="libraryId !== 0">
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn icon v-on="on">
|
||||
<v-icon>mdi-dots-vertical</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item @click="analyze()">
|
||||
<v-list-item-title>Analyze</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-toolbar>
|
||||
|
||||
<v-container fluid class="px-6">
|
||||
|
|
@ -242,6 +255,9 @@ export default Vue.extend({
|
|||
} else {
|
||||
return 'All libraries'
|
||||
}
|
||||
},
|
||||
analyze () {
|
||||
this.$komgaLibraries.analyzeLibrary(this.libraryId)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -56,4 +56,16 @@ export default class KomgaLibrariesService {
|
|||
throw new Error(msg)
|
||||
}
|
||||
}
|
||||
|
||||
async analyzeLibrary (libraryId: number) {
|
||||
try {
|
||||
await this.http.post(`${API_LIBRARIES}/${libraryId}/analyze`)
|
||||
} catch (e) {
|
||||
let msg = `An error occurred while trying to analyze library`
|
||||
if (e.response.data.message) {
|
||||
msg += `: ${e.response.data.message}`
|
||||
}
|
||||
throw new Error(msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue