Repository: digitalocean/nginxconfig.io
File: src/nginxconfig/templates/domain_sections/logging.vue (Vue)

Code before:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->

<template>
    <div>
        <div class="field is-horizontal">
            <div class="field-label">
                <label class="label">access_log {{ $t('templates.domainSections.logging.byDomain') }}</label>
            </div>
            <div class="field-body">
                <div class="field">
                    <div :class="`control${accessLogChanged ? ' is-changed' : ''}`">
                        <div class="checkbox">
                            <PrettyCheck v-model="accessLog" class="p-default p-curve p-fill p-icon">
                                {{ $t('templates.domainSections.logging.enableForThisDomain') }}
                            </PrettyCheck>
                        </div>
                    </div>
                    <div v-if="$props.data.accessLog.computed" class="control field is-horizontal is-expanded">
                        <input
                            v-model="accessLogPath"
                            class="input"
                            type="text"
                            :placeholder="$props.data.accessLogPath.computed"
                        />
                    </div>
                </div>
            </div>
        </div>

        <div v-if="$props.data.accessLog.computed" class="field is-horizontal">
            <div class="field-label">
                <label class="label">access_log {{ $t('templates.domainSections.logging.arguments') }}</label>
            </div>
            <div class="field-body">
                <div class="field">
                    <div :class="`control${accessLogParametersChanged ? ' is-changed' : ''}`">
                        <input
                            v-model="accessLogParameters"
                            class="input"
                            type="text"
                            :placeholder="$props.data.accessLogParameters.default"
                        />
                    </div>

Review comment (suggestion):
(Not for this line) The parent `field is-horizontal` here likely needs a `is-aligned-top` added to the class list, and the `field-label` a `has-small-margin-top` to fix the alignment of the label with the checkbox still

Code after:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->

<template>
    <div>
        <div class="field is-horizontal is-aligned-top">
            <div class="field-label has-small-margin-top">
                <label class="label">access_log {{ $t('templates.domainSections.logging.byDomain') }}</label>
            </div>
            <div class="field-body">
                <div class="field">
                    <div :class="`control${accessLogEnabledChanged ? ' is-changed' : ''}`">
                        <div class="checkbox">
                            <PrettyCheck v-model="accessLogEnabled" class="p-default p-curve p-fill p-icon">
                                {{ $t('templates.domainSections.logging.enableForThisDomain') }}
                            </PrettyCheck>
                        </div>
                    </div>
                    <div v-if="$props.data.accessLogEnabled.computed" :class="`control field is-horizontal is-expanded${accessLogPathChanged ? ' is-changed' : ''}`">
                        <input
                            v-model="accessLogPath"
                            class="input"
                            type="text"
                            :placeholder="$props.data.accessLogPath.default"
                        />
                    </div>
                </div>
            </div>
        </div>

        <div v-if="$props.data.accessLogEnabled.computed" class="field is-horizontal">
            <div class="field-label">
                <label class="label">access_log {{ $t('templates.domainSections.logging.arguments') }}</label>
            </div>
            <div class="field-body">
                <div class="field">
                    <div :class="`control${accessLogParametersChanged ? ' is-changed' : ''}`">
                        <input
                            v-model="accessLogParameters"
                            class="input"
                            type="text"
                            :placeholder="$props.data.accessLogParameters.default"
                        />
                    </div>