feat: force auth for particular event types
This commit is contained in:
parent
58723a387f
commit
a8a2ef5e27
3 changed files with 54 additions and 8 deletions
|
|
@ -343,7 +343,7 @@
|
|||
color="secodary"
|
||||
class="q-ml-md q-mr-md"
|
||||
v-model="relay.config.requireAuthEvents"
|
||||
>For Events</q-toggle
|
||||
>For All Events</q-toggle
|
||||
>
|
||||
</div>
|
||||
<div class="col-5 col-sm-5">
|
||||
|
|
@ -388,11 +388,43 @@
|
|||
>
|
||||
{{ e }}
|
||||
</q-chip>
|
||||
<!-- <q-badge color="secondary" class="q-ml-sm" multi-line>
|
||||
{{ relay.config.skipedAuthEvents }}
|
||||
</q-badge> -->
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
class="row items-center no-wrap q-mb-md q-mt-md"
|
||||
>
|
||||
<div class="col-3 q-pr-lg">Force Auth For Events:</div>
|
||||
<div class="col-1">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
v-model.trim="forceEventKind"
|
||||
type="number"
|
||||
min="0"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<q-btn
|
||||
unelevated
|
||||
color="secondary"
|
||||
icon="add"
|
||||
@click="addForceAuthForEvent()"
|
||||
></q-btn>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<q-chip
|
||||
v-for="e in relay.config.forcedAuthEvents"
|
||||
:key="e"
|
||||
removable
|
||||
@remove="removeForceAuthForEvent(e)"
|
||||
color="primary"
|
||||
text-color="white"
|
||||
>
|
||||
{{ e }}
|
||||
</q-chip>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator></q-separator>
|
||||
<div class="row items-center no-wrap q-mb-md q-mt-md">
|
||||
<div class="col-3 q-pr-lg">Full Storage Action:</div>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ async function relayDetails(path) {
|
|||
description: ''
|
||||
}
|
||||
},
|
||||
skipEventKind: 0
|
||||
skipEventKind: 0,
|
||||
forceEventKind: 0
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -141,6 +142,18 @@ async function relayDetails(path) {
|
|||
value = +eventKind
|
||||
this.relay.config.skipedAuthEvents =
|
||||
this.relay.config.skipedAuthEvents.filter(e => e !== value)
|
||||
},
|
||||
addForceAuthForEvent: function () {
|
||||
value = +this.forceEventKind
|
||||
if (this.relay.config.forcedAuthEvents.indexOf(value) != -1) {
|
||||
return
|
||||
}
|
||||
this.relay.config.forcedAuthEvents.push(value)
|
||||
},
|
||||
removeSkipAuthForEvent: function (eventKind) {
|
||||
value = +eventKind
|
||||
this.relay.config.forcedAuthEvents =
|
||||
this.relay.config.forcedAuthEvents.filter(e => e !== value)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue