Skip to content

Commit

Permalink
Added remove if directive for DirectiveEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJacky committed Aug 2, 2022
1 parent 2b800f4 commit 34fc0a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions frontend/src/views/domain/ngx_conf/directive/DirectiveEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ function onSave(idx: number) {
<h2>{{ $gettext('Directives') }}</h2>

<a-form-item v-for="(directive,index) in ngx_directives" @click="current_idx=index">
<code-editor v-if="directive.directive === If" v-model:content="directive.params"
defaultHeight="100px"/>
<div class="input-wrapper" v-else>
<a-input :addon-before="directive.directive" v-model:value="directive.params" @click="current_idx=k"
>
</a-input>

<div class="input-wrapper">
<code-editor v-if="directive.directive === If" v-model:content="directive.params"
defaultHeight="100px" style="width: 100%;"/>

<a-input v-else
:addon-before="directive.directive"
v-model:value="directive.params" @click="current_idx=index"/>

<a-popconfirm @confirm="remove(index)"
:title="$gettext('Are you sure you want to remove this directive?')"
:ok-text="$gettext('Yes')"
Expand Down Expand Up @@ -99,5 +102,6 @@ function onSave(idx: number) {
.input-wrapper {
display: flex;
gap: 10px;
align-items: center;
}
</style>
2 changes: 1 addition & 1 deletion frontend/version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.5.0","build_id":14,"total_build":84}
{"version":"1.5.0","build_id":15,"total_build":85}

0 comments on commit 34fc0a2

Please sign in to comment.