diff options
author | Julien Veyssier <eneiluj@posteo.net> | 2020-08-06 10:43:26 +0200 |
---|---|---|
committer | Jan C. Borchardt <hey@jancborchardt.net> | 2020-08-20 00:21:08 +0200 |
commit | 70d1d1997af5fe8d18f2d0ed06680bdbef76e304 (patch) | |
tree | 57c8e87b0737778e9fcd86a25e7b3627430c1785 /apps/weather_status/src/weather-status.js | |
parent | d8bdb439a4ed31bc3d13d11fef6c046118867d08 (diff) | |
download | nextcloud-server-70d1d1997af5fe8d18f2d0ed06680bdbef76e304.tar.gz nextcloud-server-70d1d1997af5fe8d18f2d0ed06680bdbef76e304.zip |
new weather status used in dashboard
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Diffstat (limited to 'apps/weather_status/src/weather-status.js')
-rw-r--r-- | apps/weather_status/src/weather-status.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/apps/weather_status/src/weather-status.js b/apps/weather_status/src/weather-status.js new file mode 100644 index 00000000000..0e7c5690b90 --- /dev/null +++ b/apps/weather_status/src/weather-status.js @@ -0,0 +1,28 @@ +import Vue from 'vue' +import { getRequestToken } from '@nextcloud/auth' +import { generateUrl } from '@nextcloud/router' +import App from './App' + +// eslint-disable-next-line camelcase +__webpack_nonce__ = btoa(getRequestToken()) + +// Correct the root of the app for chunk loading +// eslint-disable-next-line +__webpack_public_path__ = generateUrl('/apps/weather_status/js/') + +Vue.prototype.t = t + +document.addEventListener('DOMContentLoaded', function() { + if (!OCA.Dashboard) { + return + } + + OCA.Dashboard.registerStatus('weather', (el) => { + const Dashboard = Vue.extend(App) + return new Dashboard({ + propsData: { + inline: true, + }, + }).$mount(el) + }) +}) |