%PDF- %PDF-
Direktori : /www/varak.net/nextcloud.varak.net/apps/notifications/js/ |
Current File : /www/varak.net/nextcloud.varak.net/apps/notifications/js/notifications-admin-settings.mjs.map |
{"version":3,"file":"notifications-admin-settings.mjs","sources":["../src/views/AdminSettings.vue","../src/adminSettings.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<NcSettingsSection :name=\"t('notifications', 'Notifications defaults')\"\n\t\t:description=\"t('notifications', 'Configure the default notification settings for new users')\">\n\t\t<p>\n\t\t\t<label for=\"notify_setting_batchtime\" class=\"notification-frequency__label\">\n\t\t\t\t{{ t('notifications', 'Send email reminders about unhandled notifications after:') }}\n\t\t\t</label>\n\t\t\t<select id=\"notify_setting_batchtime\"\n\t\t\t\tv-model=\"config.setting_batchtime\"\n\t\t\t\tclass=\"notification-frequency__select\"\n\t\t\t\t@change=\"updateSettings()\">\n\t\t\t\t<option v-for=\"option in batchtime_options\" :key=\"option.value\" :value=\"option.value\">\n\t\t\t\t\t{{ option.text }}\n\t\t\t\t</option>\n\t\t\t</select>\n\t\t</p>\n\n\t\t<NcCheckboxRadioSwitch :checked.sync=\"config.sound_notification\"\n\t\t\t@update:checked=\"updateSettings\">\n\t\t\t{{ t('notifications', 'Play sound when a new notification arrives') }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<NcCheckboxRadioSwitch :checked.sync=\"config.sound_talk\"\n\t\t\t@update:checked=\"updateSettings\">\n\t\t\t{{ t('notifications', 'Play sound when a call started (requires Nextcloud Talk)') }}\n\t\t</NcCheckboxRadioSwitch>\n\t</NcSettingsSection>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { loadState } from '@nextcloud/initial-state'\nimport { showSuccess, showError } from '@nextcloud/dialogs'\nimport NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'\nimport NcSettingsSection from '@nextcloud/vue/dist/Components/NcSettingsSection.js'\n\nconst EmailFrequency = {\n\tEMAIL_SEND_OFF: 0,\n\tEMAIL_SEND_HOURLY: 1,\n\tEMAIL_SEND_3HOURLY: 2,\n\tEMAIL_SEND_DAILY: 3,\n\tEMAIL_SEND_WEEKLY: 4,\n}\n\nexport default {\n\tname: 'AdminSettings',\n\tcomponents: {\n\t\tNcCheckboxRadioSwitch,\n\t\tNcSettingsSection,\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tbatchtime_options: [\n\t\t\t\t{ text: t('notifications', 'Never'), value: EmailFrequency.EMAIL_SEND_OFF },\n\t\t\t\t{ text: t('notifications', '1 hour'), value: EmailFrequency.EMAIL_SEND_HOURLY },\n\t\t\t\t{ text: t('notifications', '3 hours'), value: EmailFrequency.EMAIL_SEND_3HOURLY },\n\t\t\t\t{ text: t('notifications', '1 day'), value: EmailFrequency.EMAIL_SEND_DAILY },\n\t\t\t\t{ text: t('notifications', '1 week'), value: EmailFrequency.EMAIL_SEND_WEEKLY },\n\t\t\t],\n\t\t\tconfig: loadState('notifications', 'config'),\n\t\t}\n\t},\n\n\tmethods: {\n\t\tasync updateSettings() {\n\t\t\ttry {\n\t\t\t\tconst form = new FormData()\n\t\t\t\tform.append('batchSetting', this.config.setting_batchtime)\n\t\t\t\tform.append('soundNotification', this.config.sound_notification ? 'yes' : 'no')\n\t\t\t\tform.append('soundTalk', this.config.sound_talk ? 'yes' : 'no')\n\t\t\t\tawait axios.post(generateOcsUrl('apps/notifications/api/v2/settings/admin'), form)\n\t\t\t\tshowSuccess(t('notifications', 'Your settings have been updated.'))\n\t\t\t} catch (error) {\n\t\t\t\tshowError(t('notifications', 'An error occurred while updating your settings.'))\n\t\t\t\tconsole.error(error)\n\t\t\t}\n\t\t},\n\t},\n}\n\n</script>\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport Vue from 'vue'\nimport AdminSettings from './views/AdminSettings.vue'\n\n// Styles\nimport '@nextcloud/dialogs/style.css'\n\nVue.prototype.t = t\nVue.prototype.n = n\n\nexport default new Vue({\n\tel: '#notifications-admin-settings',\n\trender: h => h(AdminSettings),\n})\n"],"names":["EmailFrequency","_sfc_main","NcCheckboxRadioSwitch","NcSettingsSection","loadState","form","axios","generateOcsUrl","showSuccess","error","showError","Vue","h","AdminSettings"],"mappings":";8NAyCA,MAAAA,EAAA,CACA,eAAA,EACA,kBAAA,EACA,mBAAA,EACA,iBAAA,EACA,kBAAA,CACA,EAEAC,EAAA,CACA,KAAA,gBACA,WAAA,CACA,sBAAAC,EACA,kBAAAC,CACA,EAEA,MAAA,CACA,MAAA,CACA,kBAAA,CACA,CAAA,KAAA,EAAA,gBAAA,OAAA,EAAA,MAAAH,EAAA,cAAA,EACA,CAAA,KAAA,EAAA,gBAAA,QAAA,EAAA,MAAAA,EAAA,iBAAA,EACA,CAAA,KAAA,EAAA,gBAAA,SAAA,EAAA,MAAAA,EAAA,kBAAA,EACA,CAAA,KAAA,EAAA,gBAAA,OAAA,EAAA,MAAAA,EAAA,gBAAA,EACA,CAAA,KAAA,EAAA,gBAAA,QAAA,EAAA,MAAAA,EAAA,iBAAA,CACA,EACA,OAAAI,EAAA,gBAAA,QAAA,CACA,CACA,EAEA,QAAA,CACA,MAAA,gBAAA,CACA,GAAA,CACA,MAAAC,EAAA,IAAA,SACAA,EAAA,OAAA,eAAA,KAAA,OAAA,iBAAA,EACAA,EAAA,OAAA,oBAAA,KAAA,OAAA,mBAAA,MAAA,IAAA,EACAA,EAAA,OAAA,YAAA,KAAA,OAAA,WAAA,MAAA,IAAA,EACA,MAAAC,EAAA,KAAAC,EAAA,0CAAA,EAAAF,CAAA,EACAG,EAAA,EAAA,gBAAA,kCAAA,CAAA,CACA,OAAAC,EAAA,CACAC,EAAA,EAAA,gBAAA,iDAAA,CAAA,EACA,QAAA,MAAAD,CAAA,CACA,CACA,CACA,CACA,ylDCzEAE,EAAI,UAAU,EAAI,EAClBA,EAAI,UAAU,EAAI,EAEH,IAAIA,EAAI,CACtB,GAAI,gCACJ,OAAQC,GAAKA,EAAEC,CAAa,CAC7B,CAAC"}