Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(global): basic form layout #3121

Open
wants to merge 2 commits into
base: c/tongtech
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/components/ListenerDrawer/ListenerDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
destroy-on-close
>
<el-form
label-position="top"
require-asterisk-position="right"
class="tong-form"
label-width="200px"
:rules="listenerFormRules"
:model="listenerRecord"
:validate-on-rule-change="false"
Expand Down Expand Up @@ -65,7 +65,6 @@
<el-col :span="12">
<el-form-item :label="tl('maxConn')" prop="max_connections">
<Oneof
class="in-one-row"
v-model="listenerRecord.max_connections"
:items="[{ type: 'number' }, { symbols: [INFINITY_VALUE], type: 'enum' }]"
/>
Expand Down Expand Up @@ -137,7 +136,6 @@
<el-col v-if="!typesWithoutMaxConnectionRate.includes(listenerRecord.type)" :span="12">
<el-form-item :label="t('Gateway.maxConnRate')" prop="max_conn_rate">
<Oneof
class="in-one-row"
v-model="listenerRecord.max_conn_rate"
:items="[{ type: 'rate' }, { symbols: [INFINITY_VALUE], type: 'enum' }]"
/>
Expand All @@ -146,7 +144,6 @@
<el-col :span="12">
<el-form-item :label="t('Gateway.maxMsgPubRate')" prop="messages_rate">
<Oneof
class="in-one-row"
v-model="listenerRecord.messages_rate"
:items="[{ type: 'rate' }, { symbols: [INFINITY_VALUE], type: 'enum' }]"
/>
Expand All @@ -155,7 +152,6 @@
<el-col :span="12">
<el-form-item :label="t('Gateway.maxMsgPubTraffic')" prop="bytes_rate">
<Oneof
class="in-one-row"
v-model="listenerRecord.bytes_rate"
:items="[
{
Expand Down
59 changes: 57 additions & 2 deletions src/style/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,20 @@ p.description {
margin-top: 30px;
}
}
.part-header-container {
display: flex;
align-items: center;
justify-content: flex-start;
line-height: 1.6;
padding-top: 8px;
padding-bottom: 16px;
.part-header {
margin-top: 0;
margin-bottom: 0;
padding-right: 12px;
text-align: right;
}
}

.bold {
font-weight: 600;
Expand Down Expand Up @@ -495,8 +509,20 @@ input:disabled {
}
}
.el-card {
&.app-card {
margin-bottom: 24px;
&.app-card,
&.ft-card {
margin-bottom: 16px;
}
.el-card__body >.el-form:not(.search-wrapper) {
padding-top: 8px;
margin-bottom: -16px;
}
&.ft-card {
.el-card__body {
display: flex;
justify-content: center;
align-items: center;
}
}
.el-tabs.detail-tabs {
.el-tabs__header {
Expand All @@ -507,6 +533,11 @@ input:disabled {
}
}
}
.el-dialog__body {
>.el-form {
margin-bottom: -24px;
}
}
.block-title {
margin-top: 0;
margin-bottom: 0;
Expand Down Expand Up @@ -995,3 +1026,27 @@ code {
.chart-tooltip {
border-radius: 0 !important;
}
.el-form.tong-form {
.el-col-12,
.el-col-8 {
width: 100%;
max-width: 100%;
flex-basis: 100%;
}
.el-col-12:not(.custom-col-24).dividing-line-below::after {
width: 100%;
}
&.el-form--label-right {
.el-form-item__label {
text-align: right;
}
}
.advanced-settings-btn {
margin-top: 0;
margin-bottom: 24px;
margin-left: 200px;
}
.btn-container {
margin-top: 0;
}
}
31 changes: 15 additions & 16 deletions src/style/normalize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -987,25 +987,24 @@

/* Dialog */
.el-dialog {
.el-dialog__header {
padding: 16px;
margin-right: 0;
border-bottom: 1px solid var(--color-grey-6);
}
.el-dialog__headerbtn {
top: 3px;
}
.el-dialog__body {
padding: 20px 16px;
}
.el-dialog__footer {
padding: 12px 16px;
border-top: 1px solid var(--color-grey-6);
}
&.dialog-with-divider {
.el-dialog__headerbtn {
height: 50px;
}

.el-dialog__header {
padding: 16px 24px;
margin-right: 0;
border-bottom: 1px solid var(--color-border-card);

}

.el-dialog__body {
padding: 24px;
}

.el-dialog__footer {
padding: 12px 16px;
border-top: 1px solid var(--color-border-card);
}
}
}
1 change: 0 additions & 1 deletion src/style/schemaForm.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.schema-form {
padding-bottom: 24px;
&.is-loading {
min-height: 400px;
.el-skeleton {
Expand Down
67 changes: 27 additions & 40 deletions src/views/AdvancedMQTT/AutoSub.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
:rules="subsRules"
:model="subsInput"
ref="subsForm"
label-position="top"
require-asterisk-position="right"
@keyup.enter="submitSubs(isEdit)"
class="tong-form"
label-width="160px"
>
<el-form-item :label="$t('Base.topic')" prop="topic">
<el-input v-model="subsInput.topic" />
Expand All @@ -68,44 +68,31 @@
<el-option v-for="item in QoSOptions" :key="item" :value="item" />
</el-select>
</el-form-item>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item :label="$t('Clients.noLocal')" prop="nl">
<el-select v-model="subsInput.nl">
<el-option
v-for="{ value, label } in noLocalOpts"
:label="label"
:value="value"
:key="value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('Clients.retainAsPublished')" prop="rap">
<el-select v-model="subsInput.rap">
<el-option
v-for="{ value, label } in retainAsPublishedOpts"
:label="label"
:value="value"
:key="value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('Clients.retainHandling')" prop="rh">
<el-select v-model="subsInput.rh">
<el-option
v-for="item in retainHandlingOpts"
:label="item"
:value="item"
:key="item"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item :label="$t('Clients.noLocal')" prop="nl">
<el-select v-model="subsInput.nl">
<el-option
v-for="{ value, label } in noLocalOpts"
:label="label"
:value="value"
:key="value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Clients.retainAsPublished')" prop="rap">
<el-select v-model="subsInput.rap">
<el-option
v-for="{ value, label } in retainAsPublishedOpts"
:label="label"
:value="value"
:key="value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('Clients.retainHandling')" prop="rh">
<el-select v-model="subsInput.rh">
<el-option v-for="item in retainHandlingOpts" :label="item" :value="item" :key="item" />
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="closeDialog()">{{ $t('Base.cancel') }}</el-button>
Expand Down
4 changes: 2 additions & 2 deletions src/views/AdvancedMQTT/Rewrite.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
ref="rewriteForm"
:model="rewriteInput"
:rules="rewriteRules"
label-position="top"
require-asterisk-position="right"
@keyup.enter="submitRewrite(isEdit)"
class="tong-form"
label-width="160px"
>
<el-form-item :label="tl('action')" prop="action">
<el-select v-model="rewriteInput.action">
Expand Down
72 changes: 37 additions & 35 deletions src/views/Auth/AuthnCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@
</template>
</el-radio-group>
<p class="item-description">{{ mechanismDesc }}</p>
<div class="step-btn">
<el-button @click="cancelCreate()">
{{ $t('Base.cancel') }}
</el-button>
<el-button type="primary" @click="handleNext">
{{ $t('Base.nextStep') }}
</el-button>
</div>
</div>
<!-- Backend -->
<div v-if="step === 1" class="create-form">
Expand Down Expand Up @@ -114,18 +106,6 @@
})
}}
</p>
<div class="step-btn">
<el-button @click="handleBack">
{{ $t('Base.backStep') }}
</el-button>
<el-button
type="primary"
@click="handleNext"
:disabled="needSelectInSecondStep && !backend"
>
{{ $t('Base.nextStep') }}
</el-button>
</div>
</div>
<!-- Config -->
<div v-else-if="step === 2">
Expand Down Expand Up @@ -168,23 +148,45 @@
{{ isWork ? $t('Auth.testSuccess') : $t('Auth.testFailed') }}
</div>
</div>
<div class="step-btn">
<!-- <el-button @click="handleTest">
</div>
</el-card>
<el-card class="ft-card">
<template v-if="step === 0">
<el-button @click="cancelCreate()">
{{ $t('Base.cancel') }}
</el-button>
<el-button type="primary" @click="handleNext">
{{ $t('Base.nextStep') }}
</el-button>
</template>
<template v-if="step === 1">
<el-button @click="handleBack">
{{ $t('Base.backStep') }}
</el-button>
<el-button
type="primary"
@click="handleNext"
:disabled="needSelectInSecondStep && !backend"
>
{{ $t('Base.nextStep') }}
</el-button>
</template>
<template v-else-if="step === 2">
<!-- <el-button @click="handleTest">
{{ $t('Base.test') }}
</el-button> -->
<el-button @click="handleBack">
{{ $t('Base.backStep') }}
</el-button>
<el-button
type="primary"
:disabled="!$hasPermission('post')"
:loading="saveLoading"
@click="handleCreate"
>
{{ $t('Base.create') }}
</el-button>
</div>
</div>
<el-button @click="handleBack">
{{ $t('Base.backStep') }}
</el-button>
<el-button
type="primary"
:disabled="!$hasPermission('post')"
:loading="saveLoading"
@click="handleCreate"
>
{{ $t('Base.create') }}
</el-button>
</template>
</el-card>
</div>
</template>
Expand Down
8 changes: 5 additions & 3 deletions src/views/Auth/AuthnDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@
ref="formCom"
/>
<jwt-config ref="formCom" v-else v-model="configData" is-edit />
<!-- <el-button @click="handleTest">
{{ $t('Base.test') }}
</el-button> -->
</el-card>
<el-card class="ft-card">
<el-button @click="$router.push('/authentication')" v-if="!gateway">
{{ $t('Base.cancel') }}
</el-button>
Expand All @@ -117,9 +122,6 @@
>
{{ $t('Base.update') }}
</el-button>
<!-- <el-button @click="handleTest">
{{ $t('Base.test') }}
</el-button> -->
</el-card>
</el-tab-pane>
<el-tab-pane
Expand Down
Loading