summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main-cron-warning.js11
-rw-r--r--src/main.js9
-rw-r--r--templates/part.content.warnings.php2
-rw-r--r--webpack.js6
4 files changed, 19 insertions, 9 deletions
diff --git a/src/main-cron-warning.js b/src/main-cron-warning.js
new file mode 100644
index 000000000..298fa3b61
--- /dev/null
+++ b/src/main-cron-warning.js
@@ -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'),
+ }],
+})
diff --git a/src/main.js b/src/main.js
index c7314d17b..97e48b442 100644
--- a/src/main.js
+++ b/src/main.js
@@ -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
diff --git a/templates/part.content.warnings.php b/templates/part.content.warnings.php
index db9b2f218..cc7890a87 100644
--- a/templates/part.content.warnings.php
+++ b/templates/part.content.warnings.php
@@ -1,6 +1,6 @@
<?php if ($_['warnings']['improperlyConfiguredCron']) {
- script('news', 'test')
+ script('news', 'nextcloud-news-cron-warning')
?>
<div></div>
<?php }; ?>
diff --git a/webpack.js b/webpack.js
index 25c295596..55e836ef5 100644
--- a/webpack.js
+++ b/webpack.js
@@ -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'],