Use NoteCard component in BackgroundJob settings

Fix #33880

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
Carl Schwan 2022-09-07 14:03:48 +02:00
parent 58706dd5aa
commit 0b77607362
No known key found for this signature in database
GPG key ID: C3AA6B3A5EFA7AC5
3 changed files with 17 additions and 15 deletions

View file

@ -25,26 +25,26 @@
:description="t('settings', 'For the server to work properly, it\'s important to configure background jobs correctly. Cron is the recommended setting. Please see the documentation for more information.')"
:doc-url="backgroundJobsDocUrl">
<template v-if="lastCron !== 0">
<span v-if="oldExecution" class="error">
<NcNoteCard v-if="oldExecution" type="error">
{{ t('settings', 'Last job execution ran {time}. Something seems wrong.', {time: relativeTime}) }}
</span>
</NcNoteCard>
<span v-else-if="longExecutionNotCron" class="warning">
<NcNoteCard v-else-if="longExecutionNotCron" type="warning">
{{ t('settings', "Some jobs have not been executed since {maxAgeRelativeTime}. Please consider increasing the execution frequency.", {maxAgeRelativeTime}) }}
</span>
</NcNoteCard>
<span v-else-if="longExecutionCron" class="warning">
<NcNoteCard v-else-if="longExecutionCron" type="warning">
{{ t('settings', "Some jobs have not been executed since {maxAgeRelativeTime}. Please consider switching to system cron.", {maxAgeRelativeTime}) }}
</span>
</NcNoteCard>
<span v-else>
<NcNoteCard v-else type="success">
{{ t('settings', 'Last job ran {relativeTime}.', {relativeTime}) }}
</span>
</NcNoteCard>
</template>
<span v-else class="error">
<NcNoteCard v-else type="error">
{{ t('settings', 'Background job did not run yet!') }}
</span>
</NcNoteCard>
<NcCheckboxRadioSwitch type="radio"
:checked.sync="backgroundJobsMode"
@ -86,8 +86,9 @@
<script>
import { loadState } from '@nextcloud/initial-state'
import { showError } from '@nextcloud/dialogs'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch'
import NcSettingsSection from '@nextcloud/vue/dist/Components/NcSettingsSection'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcSettingsSection from '@nextcloud/vue/dist/Components/NcSettingsSection.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
import moment from '@nextcloud/moment'
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
@ -106,6 +107,7 @@ export default {
components: {
NcCheckboxRadioSwitch,
NcSettingsSection,
NcNoteCard,
},
data() {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long