feat: checkbox component

This commit is contained in:
liyasthomas
2021-11-15 20:25:40 +05:30
parent 73568043f1
commit 7a6d117a76
3 changed files with 81 additions and 42 deletions

View File

@@ -63,19 +63,19 @@
</tippy>
</span>
<div class="flex">
<!-- <SmartToggle
<!-- <SmartCheckbox
:on="!URLExcludes.auth"
@change="setExclude('auth', !$event)"
>
{{ $t("authorization.include_in_url") }}
</SmartToggle> -->
<SmartToggle
</SmartCheckbox> -->
<SmartCheckbox
:on="authActive"
class="px-2"
@change="authActive = !authActive"
>
{{ $t("state.enabled") }}
</SmartToggle>
</SmartCheckbox>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
to="https://docs.hoppscotch.io/features/authorization"
@@ -254,7 +254,6 @@ export default defineComponent({
{ authType: "none", authActive: true },
setRESTAuth
)
const authType = pluckRef(auth, "authType")
const authName = computed(() => {
if (authType.value === "basic") return "Basic Auth"
@@ -263,23 +262,17 @@ export default defineComponent({
else return "None"
})
const authActive = pluckRef(auth, "authActive")
const basicUsername = pluckRef(auth as Ref<HoppRESTAuthBasic>, "username")
const basicPassword = pluckRef(auth as Ref<HoppRESTAuthBasic>, "password")
const bearerToken = pluckRef(auth as Ref<HoppRESTAuthBearer>, "token")
const oauth2Token = pluckRef(auth as Ref<HoppRESTAuthOAuth2>, "token")
const URLExcludes = useSetting("URL_EXCLUDES")
const clearContent = () => {
auth.value = {
authType: "none",
authActive: true,
}
}
return {
auth,
authType,