Skip to content

Commit

Permalink
Use NoteCard component in BackgroundJob settings
Browse files Browse the repository at this point in the history
Fix #33880

Signed-off-by: Carl Schwan <[email protected]>
  • Loading branch information
CarlSchwan committed Sep 8, 2022
1 parent 58706dd commit 0b77607
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
26 changes: 14 additions & 12 deletions apps/settings/src/components/BasicSettings/BackgroundJob.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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'
Expand All @@ -106,6 +107,7 @@ export default {
components: {
NcCheckboxRadioSwitch,
NcSettingsSection,
NcNoteCard,
},

data() {
Expand Down
Loading

0 comments on commit 0b77607

Please sign in to comment.