Skip to content

Commit

Permalink
cleanup old cron stuff and make cron-warning.js part of build so it c…
Browse files Browse the repository at this point in the history
…an be committed

Signed-off-by: Devlin Junker <[email protected]>
  • Loading branch information
devlinjunker committed Oct 17, 2023
1 parent a240528 commit 7c5299d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
11 changes: 11 additions & 0 deletions src/main-cron-warning.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Send error to Vuex State for displaying in Vue Application
window.store.commit('SET_ERROR', {
toString: () => t('news', 'Ajax or webcron mode detected! Your feeds will not be updated!'),
links: [{
url: 'https://docs.nextcloud.org/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#cron',
text: t('news', 'How to set up the operating system cron'),
}, {
url: 'https://github.com/nextcloud/news-updater',
text: t('news', 'Install and set up a faster parallel updater that uses the News app\'s update API'),
}],
})
9 changes: 1 addition & 8 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,5 @@ export default new Vue({
render: (h) => h(App),
})

/**
* Closes warning messages generated by PHP code
*/
function closeCronWarning() {
document.getElementById('cron-warning').style.display = 'none'
}
// document.getElementById('close-cron-warning').onclick = closeCronWarning

// Make store accessible for setting cron warning (also for plugins in the future)
window.store = store
2 changes: 1 addition & 1 deletion templates/part.content.warnings.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php if ($_['warnings']['improperlyConfiguredCron']) {

script('news', 'test')
script('news', 'nextcloud-news-cron-warning')
?>
<div></div>
<?php }; ?>
6 changes: 6 additions & 0 deletions webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ webpackConfig.entry['admin-settings'] = path.join(
'main-admin.js',
)

webpackConfig.entry['cron-warning'] = path.join(
__dirname,
'src',
'main-cron-warning.js',
)

webpackConfig = merge(webpackConfig, {
resolve: {
extensions: ['.ts'],
Expand Down

0 comments on commit 7c5299d

Please sign in to comment.