diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2020-03-09 23:45:02 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-03-09 23:45:02 +0300 |
commit | 3b7aff51b8f2478188e72500845943549485d79d (patch) | |
tree | 6254595dc2119380b2b91578c7b63b710ae73a60 /src | |
parent | 3b097a510562d0ca8447fb6a1ddc9fa8ed536a45 (diff) |
Add eslint
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'src')
-rw-r--r-- | src/App.vue | 51 | ||||
-rw-r--r-- | src/components/BruteForceItem.vue | 34 | ||||
-rw-r--r-- | src/main.js | 17 |
3 files changed, 55 insertions, 47 deletions
diff --git a/src/App.vue b/src/App.vue index 293b2b2..c438f5c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -22,23 +22,32 @@ <template> <div id="bruteforcesettings" class="section"> <h2>{{ t('bruteforcesettings', 'Brute-force IP whitelist') }}</h2> - <p class="settings-hint">{{ t('bruteforcesettings', 'To whitelist IP ranges from the brute-force protection specify them below. Note that any whitelisted IP can perform authentication attempts without any throttling. For security reasons, it is recommended to whitelist as few hosts as possible or ideally even none at all.') }}</p> + <p class="settings-hint"> + {{ t('bruteforcesettings', 'To whitelist IP ranges from the brute-force protection specify them below. Note that any whitelisted IP can perform authentication attempts without any throttling. For security reasons, it is recommended to whitelist as few hosts as possible or ideally even none at all.') }} + </p> <table id="whitelist-list"> <tbody> <BruteForceItem v-for="item in items" :key="item.id" :item="item" - @delete="deleteWhitelist" - /> + @delete="deleteWhitelist" /> </tbody> </table> - <br/> + <br> <h3>{{ t('bruteforcesettings', 'Add new whitelist') }}</h3> <form @submit.prevent="addWhitelist"> - <input type="text" id="ip" name="ip" placeholder="2001:db8::" v-model="newWhitelist.ip">/ - <input type="number" id="mask" name="mask" placeholder="64" v-model="newWhitelist.mask"> + <input id="ip" + v-model="newWhitelist.ip" + type="text" + name="ip" + placeholder="2001:db8::">/ + <input id="mask" + v-model="newWhitelist.mask" + type="number" + name="mask" + placeholder="64"> <input type="submit" class="button" :value="t('bruteforcesettings', 'Add')"> </form> </div> @@ -51,45 +60,45 @@ import BruteForceItem from './components/BruteForceItem' export default { name: 'App', components: { - BruteForceItem + BruteForceItem, }, data: function() { return { items: [], newWhitelist: { ip: '', - mask: '' - } - }; + mask: '', + }, + } }, beforeMount: function() { Axios.get(OC.generateUrl('apps/bruteforcesettings/ipwhitelist')) .then((response) => { - this.items = response.data; - }); + this.items = response.data + }) }, methods: { deleteWhitelist(id) { - Axios.delete(OC.generateUrl('apps/bruteforcesettings/ipwhitelist/{id}', {id: id})) + Axios.delete(OC.generateUrl('apps/bruteforcesettings/ipwhitelist/{id}', { id: id })) .then((response) => { - this.items = this.items.filter(item => item.id !== id); - }); + this.items = this.items.filter(item => item.id !== id) + }) }, addWhitelist() { Axios.post( OC.generateUrl('apps/bruteforcesettings/ipwhitelist'), { ip: this.newWhitelist.ip, - mask: this.newWhitelist.mask + mask: this.newWhitelist.mask, }) .then((response) => { - this.items.push(response.data); + this.items.push(response.data) - this.newWhitelist.ip = ''; - this.newWhitelist.mask = ''; + this.newWhitelist.ip = '' + this.newWhitelist.mask = '' } - ); - } + ) + }, }, } </script> diff --git a/src/components/BruteForceItem.vue b/src/components/BruteForceItem.vue index dfcc53d..9f9af00 100644 --- a/src/components/BruteForceItem.vue +++ b/src/components/BruteForceItem.vue @@ -22,32 +22,32 @@ --> <template> <tr> - <td><span>{{ip}}/{{mask}}</span></td> + <td><span>{{ ip }}/{{ mask }}</span></td> <td class="action-column"> <span> - <a class="icon-delete has-tooltip" :title="t('bruteforcesettings', 'Delete')" @click="$emit('delete', id)"></a> + <a class="icon-delete has-tooltip" :title="t('bruteforcesettings', 'Delete')" @click="$emit('delete', id)" /> </span> </td> </tr> </template> <script> - export default { - name: 'BruteForceItem', - props: { - item: { - type: Object, - required: true - } +export default { + name: 'BruteForceItem', + props: { + item: { + type: Object, + required: true, }, - data: function() { - return { - id: this.item.id, - ip: this.item.ip, - mask: this.item.mask, - }; - }, - } + }, + data: function() { + return { + id: this.item.id, + ip: this.item.ip, + mask: this.item.mask, + } + }, +} </script> <style> diff --git a/src/main.js b/src/main.js index 528c0d9..89d0959 100644 --- a/src/main.js +++ b/src/main.js @@ -20,16 +20,15 @@ * */ -import Vue from 'vue'; -import App from './App.vue'; +import Vue from 'vue' +import App from './App.vue' -Vue.prototype.t = t; -Vue.prototype.oc_defaults = oc_defaults; -Vue.prototype.OC = OC; +Vue.prototype.t = t +Vue.prototype.oc_defaults = oc_defaults +Vue.prototype.OC = OC const app = new Vue({ - render: h => h(App) -}).$mount('#bruteforcesettings'); - -export { app }; + render: h => h(App), +}).$mount('#bruteforcesettings') +export { app } |