feat: disable inputs in realtime and graphql connections when active (#1870)

This commit is contained in:
Akash Hamirwasia 2021-10-12 21:19:29 +05:30 committed by GitHub
parent b8ffa872c7
commit b7ccb9a34c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 1 deletions

View file

@ -20,6 +20,7 @@
focus-visible:bg-transparent focus-visible:border-dividerDark
"
:placeholder="$t('request.url')"
:disabled="connected"
@keyup.enter="onConnectClick"
/>
<ButtonPrimary

View file

@ -34,6 +34,7 @@
focus-visible:border-dividerDark
"
:placeholder="$t('mqtt.url')"
:disabled="connectionState"
/>
<ButtonPrimary
id="connect"

View file

@ -46,6 +46,7 @@
"
:value="`Client ${clientVersion}`"
readonly
:disabled="connectionState"
/>
</span>
</template>
@ -78,6 +79,7 @@
focus-visible:border-dividerDark
"
:placeholder="$t('socketio.url')"
:disabled="connectionState"
@keyup.enter="urlValid ? toggleConnection() : null"
/>
<input
@ -97,6 +99,7 @@
focus-visible:border-dividerDark
"
spellcheck="false"
:disabled="connectionState"
/>
</div>
<ButtonPrimary
@ -261,6 +264,10 @@ export default defineComponent({
url() {
this.debouncer()
},
connectionState(connected) {
if (connected) this.$refs.versionOptions.tippy().disable()
else this.$refs.versionOptions.tippy().enable()
},
},
mounted() {
if (process.browser) {

View file

@ -28,10 +28,11 @@
focus-visible:bg-transparent focus-visible:border-dividerDark
"
:placeholder="$t('sse.url')"
:disabled="connectionSSEState"
@keyup.enter="serverValid ? toggleSSEConnection() : null"
/>
<label
for="url"
for="event-type"
class="
bg-primaryLight
border-t border-b border-divider
@ -60,6 +61,7 @@
focus-visible:bg-transparent focus-visible:border-dividerDark
"
spellcheck="false"
:disabled="connectionSSEState"
/>
</div>
<ButtonPrimary

View file

@ -35,6 +35,7 @@
spellcheck="false"
:class="{ error: !urlValid }"
:placeholder="$t('websocket.url')"
:disabled="connectionState"
@keyup.enter="urlValid ? toggleConnection() : null"
/>
<ButtonPrimary