Big refactor of the Execute panel.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Fabio Manganiello 2023-10-11 14:27:23 +02:00
parent 1b6e9b4df9
commit 21820bb185
Signed by: blacklight
GPG key ID: D90FBA7F76362774
5 changed files with 454 additions and 415 deletions

View file

@ -0,0 +1,96 @@
<template>
<article class="argdoc-container" :class="{mobile: isMobile, widescreen: !isMobile}">
<h2>
Argument: <div class="argname" v-text="name" />
<span class="flag required" v-if="args.required">[Required]</span>
<span class="flag optional" v-else>[Optional]</span>
</h2>
<div class="doc html">
<Loading v-if="loading" />
<span v-else>
<span v-html="doc" v-if="doc?.length" />
<div class="type" v-if="args.type">
<b>Type:</b> &nbsp; {{ args.type }}
</div>
</span>
</div>
</article>
</template>
<script>
import Loading from "@/components/Loading"
export default {
name: 'Argdoc',
components: { Loading },
props: {
args: {
type: Object,
default: () => ({}),
},
name: {
type: String,
required: true,
},
doc: String,
loading: Boolean,
isMobile: Boolean,
}
}
</script>
<style lang="scss" scoped>
@import "common";
.argdoc-container {
max-height: 50vh;
display: flex;
flex-direction: column;
@include from($tablet) {
width: calc(100% - #{$params-tablet-width} - 2em);
}
@include from($desktop) {
width: calc(100% - #{$params-desktop-width} - 2em);
}
.argname {
font-weight: bold;
margin-left: 0.25em;
}
.doc {
width: 100%;
overflow: auto;
}
&.widescreen {
@include until($tablet) {
display: none;
}
}
&.mobile {
width: 100%;
@include from($tablet) {
display: none;
}
}
.flag {
font-size: 0.9em;
margin-left: 0.5em;
margin-bottom: 0.1em;
&.required {
color: $error-fg;
}
&.optional {
color: $selected-fg;
}
}
}
</style>

View file

@ -1,9 +1,12 @@
<template> <template>
<div class="row plugin execute-container" @click="onClick"> <div class="row plugin execute-container" @click="onClick">
<Loading v-if="loading" /> <Loading v-if="loading" />
<div class="section command-container">
<div class="section-title">Execute Action</div>
<!-- Action executor container -->
<main>
<h1>Execute Action</h1>
<!-- Execute panel views -->
<Tabs> <Tabs>
<Tab :selected="structuredInput" icon-class="fas fa-list" @input="onInputTypeChange(true)"> <Tab :selected="structuredInput" icon-class="fas fa-list" @input="onInputTypeChange(true)">
Structured Structured
@ -14,15 +17,18 @@
</Tab> </Tab>
</Tabs> </Tabs>
<form class="action-form" ref="actionForm" autocomplete="off" @submit.prevent="executeAction"> <form ref="actionForm" autocomplete="off" @submit.prevent="executeAction">
<div class="request structured-request" :class="structuredInput ? '' : 'hidden'"> <!-- Structured request container -->
<div class="request-header"> <div class="request structured" v-if="structuredInput">
<!-- Request header -->
<header>
<!-- Action autocomplete container -->
<div class="autocomplete-container"> <div class="autocomplete-container">
<Autocomplete <Autocomplete
ref="autocomplete" ref="autocomplete"
:items="autocompleteItems" :items="autocompleteItems"
@input="updateAction" @input="updateAction"
placeholder="Action Name" placeholder="Action"
show-results-when-blank show-results-when-blank
autofocus autofocus
:disabled="running" :disabled="running"
@ -34,103 +40,105 @@
<i class="fas fa-play" /> <i class="fas fa-play" />
</button> </button>
</div> </div>
</div> </header>
<div class="doc-container" v-if="selectedDoc"> <!-- Action documentation container -->
<div class="title"> <section class="doc-container" v-if="selectedDoc">
<h2>
<i class="fas fa-book" /> &nbsp; <i class="fas fa-book" /> &nbsp;
<a :href="this.action?.doc_url">Action documentation</a> <a :href="this.action?.doc_url">Action documentation</a>
</div> </h2>
<div class="doc html"> <div class="doc html">
<Loading v-if="docLoading" /> <Loading v-if="docLoading" />
<span v-html="selectedDoc" v-else /> <span v-html="selectedDoc" v-else />
</div> </div>
</div> </section>
<div class="options-container" <!-- Action arguments container -->
<section class="args"
v-if="action.name in actions && (Object.keys(action.args).length || action.supportsExtraArgs)"> v-if="action.name in actions && (Object.keys(action.args).length || action.supportsExtraArgs)">
<div class="header title row"> <h2>
<i class="fas fa-code" /> &nbsp; <i class="fas fa-code" /> &nbsp;
Arguments Arguments
</div> </h2>
<div class="options"> <div class="args-body">
<div class="params" ref="params" <div class="args-list"
v-if="Object.keys(action.args).length || action.supportsExtraArgs"> v-if="Object.keys(action.args).length || action.supportsExtraArgs">
<div class="param" :key="name" v-for="name in Object.keys(action.args)"> <!-- Supported action arguments -->
<div class="arg" :key="name" v-for="name in Object.keys(action.args)">
<label> <label>
<input type="text" class="action-param-value" :disabled="running" <input
:placeholder="name" v-model="action.args[name].value" type="text"
@focus="selectAttrDoc(name)"> class="action-arg-value"
:class="{required: action.args[name].required}"
:disabled="running"
:placeholder="name"
v-model="action.args[name].value"
@focus="selectArgdoc(name)">
<span class="required-flag" v-if="action.args[name].required">*</span>
</label> </label>
<div class="attr-doc-container mobile" v-if="selectedAttrDoc && selectedAttr === name"> <Argdoc :name="selectedArg"
<div class="title"> :args="action.args[selectedArg]"
Attribute: <div class="attr-name" v-text="selectedAttr" /> :doc="selectedArgdoc"
:loading="docLoading"
is-mobile
v-if="selectedArgdoc && selectedArg && name === selectedArg" />
</div> </div>
<div class="doc html"> <!-- Extra action arguments -->
<Loading v-if="docLoading" /> <div class="extra-args" v-if="Object.keys(action.extraArgs).length">
<span v-html="selectedAttrDoc" v-else /> <div class="arg extra-arg" :key="i" v-for="i in Object.keys(action.extraArgs)">
</div>
</div>
</div>
<div class="extra-params" ref="extraParams" v-if="Object.keys(action.extraArgs).length">
<div class="param extra-param" :key="i" v-for="i in Object.keys(action.extraArgs)">
<label class="col-5"> <label class="col-5">
<input type="text" class="action-extra-param-name" :disabled="running" <input type="text" class="action-extra-arg-name" :disabled="running"
placeholder="Name" v-model="action.extraArgs[i].name"> placeholder="Name" v-model="action.extraArgs[i].name">
</label> </label>
<label class="col-6"> <label class="col-6">
<input type="text" class="action-extra-param-value" :disabled="running" <input type="text" class="action-extra-arg-value" :disabled="running"
placeholder="Value" v-model="action.extraArgs[i].value"> placeholder="Value" v-model="action.extraArgs[i].value">
</label> </label>
<label class="col-1 buttons"> <label class="col-1 buttons">
<button type="button" class="action-extra-param-del" title="Remove parameter" <button type="button" class="action-extra-arg-del" title="Remove argument"
@click="removeParameter(i)"> @click="removeArg(i)">
<i class="fas fa-trash" /> <i class="fas fa-trash" />
</button> </button>
</label> </label>
</div> </div>
</div> </div>
<div class="add-param" v-if="action.supportsExtraArgs"> <div class="add-arg" v-if="action.supportsExtraArgs">
<button type="button" title="Add a parameter" @click="addParameter"> <button type="button" title="Add an argument" @click="addArg">
<i class="fas fa-plus" /> <i class="fas fa-plus" />
</button> </button>
</div> </div>
</div> </div>
<div class="attr-doc-container widescreen" v-if="selectedAttrDoc"> <Argdoc :name="selectedArg"
<div class="title"> :args="action.args[selectedArg]"
Attribute: <div class="attr-name" v-text="selectedAttr" /> :doc="selectedArgdoc"
:loading="docLoading"
v-if="selectedArgdoc && selectedArg" />
</div> </div>
</section>
<div class="doc html"> <section class="response">
<Loading v-if="docLoading" /> <hgroup v-if="error != null || response != null">
<span v-html="selectedAttrDoc" v-else /> <h2 v-text="error != null ? 'Error' : 'Output'" />
</div>
</div>
</div>
</div>
<div class="output-container">
<div class="header" v-if="error != null || response != null">
<div class="title" v-text="error != null ? 'Error' : 'Output'" />
<div class="buttons"> <div class="buttons">
<button type="button" title="Copy to clipboard" @click="copyToClipboard"> <button type="button" title="Copy to clipboard" @click="copyToClipboard">
<i class="fas fa-clipboard" /> <i class="fas fa-clipboard" />
</button> </button>
</div> </div>
</div> </hgroup>
<div class="response" v-html="response" v-if="response != null" /> <div class="response" v-html="response" v-if="response != null" />
<div class="error" v-html="error" v-else-if="error != null" /> <div class="error" v-html="error" v-else-if="error != null" />
</div> </section>
</div> </div>
<div class="request raw-request" :class="structuredInput ? 'hidden' : ''"> <!-- Raw request container -->
<div class="request raw-request" v-if="!structuredInput">
<div class="first-row"> <div class="first-row">
<label> <label>
<textarea v-model="rawRequest" ref="rawAction" :placeholder="rawRequestPlaceholder" /> <textarea v-model="rawRequest" ref="rawAction" :placeholder="rawRequestPlaceholder" />
@ -140,24 +148,25 @@
</button> </button>
</div> </div>
<div class="output-container" v-if="response != null || error != null"> <section class="response" v-if="response != null || error != null">
<div class="header" v-if="error != null || response != null"> <hgroup v-if="error != null || response != null">
<div class="title" v-text="error != null ? 'Error' : 'Output'" /> <h2 v-text="error != null ? 'Error' : 'Output'" />
<div class="buttons"> <div class="buttons">
<button type="button" title="Copy to clipboard" @click="copyToClipboard"> <button type="button" title="Copy to clipboard" @click="copyToClipboard">
<i class="fas fa-clipboard" /> <i class="fas fa-clipboard" />
</button> </button>
</div> </div>
</div> </hgroup>
<div class="error" v-html="error" v-if="error != null" /> <div class="error" v-html="error" v-if="error != null" />
<div class="response" v-html="response" v-else-if="response != null" /> <div class="response" v-html="response" v-else-if="response != null" />
</div> </section>
</div> </div>
</form> </form>
</div> </main>
<!-- Procedures section (to be removed) -->
<div class="section procedures-container" v-if="Object.keys(procedures).length"> <div class="section procedures-container" v-if="Object.keys(procedures).length">
<div class="section-title">Execute Procedure</div> <h1>Execute Procedure</h1>
<div class="procedure" :class="selectedProcedure.name === name ? 'selected' : ''" <div class="procedure" :class="selectedProcedure.name === name ? 'selected' : ''"
v-for="name in Object.keys(procedures).sort()" :key="name" @click="updateProcedure(name, $event)"> v-for="name in Object.keys(procedures).sort()" :key="name" @click="updateProcedure(name, $event)">
<form ref="procedureForm" autocomplete="off" @submit.prevent="executeProcedure"> <form ref="procedureForm" autocomplete="off" @submit.prevent="executeProcedure">
@ -171,12 +180,12 @@
</div> </div>
</div> </div>
<div class="params" v-if="selectedProcedure.name === name"> <div class="args-list" v-if="selectedProcedure.name === name">
<div class="param" <div class="arg"
v-for="argname in Object.keys(selectedProcedure.args)" v-for="argname in Object.keys(selectedProcedure.args)"
:key="argname"> :key="argname">
<label> <label>
<input type="text" class="action-param-value" @click="$event.stopPropagation()" :disabled="running" <input type="text" class="action-arg-value" @click="$event.stopPropagation()" :disabled="running"
:placeholder="argname" v-model="selectedProcedure.args[argname]"> :placeholder="argname" v-model="selectedProcedure.args[argname]">
</label> </label>
</div> </div>
@ -188,6 +197,7 @@
</template> </template>
<script> <script>
import Argdoc from "./Argdoc"
import Autocomplete from "@/components/elements/Autocomplete" import Autocomplete from "@/components/elements/Autocomplete"
import Loading from "@/components/Loading" import Loading from "@/components/Loading"
import Tab from "@/components/elements/Tab" import Tab from "@/components/elements/Tab"
@ -196,7 +206,7 @@ import Utils from "@/Utils"
export default { export default {
name: "Execute", name: "Execute",
components: {Autocomplete, Loading, Tab, Tabs}, components: {Argdoc, Autocomplete, Loading, Tab, Tabs},
mixins: [Utils], mixins: [Utils],
data() { data() {
@ -206,8 +216,8 @@ export default {
docLoading: false, docLoading: false,
structuredInput: true, structuredInput: true,
selectedDoc: undefined, selectedDoc: undefined,
selectedAttr: undefined, selectedArg: undefined,
selectedAttrDoc: undefined, selectedArgdoc: undefined,
selectedProcedure: { selectedProcedure: {
name: undefined, name: undefined,
args: {}, args: {},
@ -274,11 +284,11 @@ export default {
this.action.name = actionName this.action.name = actionName
if (!(this.action.name in this.actions)) { if (!(this.action.name in this.actions)) {
this.selectedDoc = undefined this.selectedDoc = undefined
this.resetAttrDoc() this.resetArgdoc()
return return
} }
this.resetAttrDoc() this.resetArgdoc()
this.docLoading = true this.docLoading = true
try { try {
@ -306,7 +316,7 @@ export default {
this.actionDocsCache[this.action.name] = {} this.actionDocsCache[this.action.name] = {}
this.actionDocsCache[this.action.name].html = this.selectedDoc this.actionDocsCache[this.action.name].html = this.selectedDoc
this.$el.querySelector('.action-param-value')?.focus() this.$el.querySelector('.action-arg-value')?.focus()
this.response = undefined this.response = undefined
this.error = undefined this.error = undefined
}, },
@ -346,32 +356,32 @@ export default {
} }
}, },
addParameter() { addArg() {
this.action.extraArgs.push({ this.action.extraArgs.push({
name: undefined, name: undefined,
value: undefined, value: undefined,
}) })
}, },
removeParameter(i) { removeArg(i) {
this.action.extraArgs.pop(i) this.action.extraArgs.pop(i)
}, },
async selectAttrDoc(name) { async selectArgdoc(name) {
this.selectedAttr = name this.selectedArg = name
this.selectedAttrDoc = this.selectedArgdoc =
this.actionDocsCache[this.action.name]?.[name]?.html || this.actionDocsCache[this.action.name]?.[name]?.html ||
await this.parseDoc(this.action.args[name].doc) await this.parseDoc(this.action.args[name].doc)
if (!this.actionDocsCache[this.action.name]) if (!this.actionDocsCache[this.action.name])
this.actionDocsCache[this.action.name] = {} this.actionDocsCache[this.action.name] = {}
this.actionDocsCache[this.action.name][name] = {html: this.selectedAttrDoc} this.actionDocsCache[this.action.name][name] = {html: this.selectedArgdoc}
}, },
resetAttrDoc() { resetArgdoc() {
this.selectedAttr = undefined this.selectedArg = undefined
this.selectedAttrDoc = undefined this.selectedArgdoc = undefined
}, },
onInputTypeChange(structuredInput) { onInputTypeChange(structuredInput) {
@ -423,9 +433,9 @@ export default {
this.running = true this.running = true
if (this.structuredInput) { if (this.structuredInput) {
const args = { const args = {
...Object.entries(this.action.args).reduce((args, param) => { ...Object.entries(this.action.args).reduce((args, arg) => {
if (param[1].value != null) { if (arg[1].value != null) {
let value = param[1].value let value = arg[1].value
try { try {
value = JSON.parse(value) value = JSON.parse(value)
} catch (e) { } catch (e) {
@ -433,13 +443,13 @@ export default {
console.debug(value) console.debug(value)
} }
args[param[0]] = value args[arg[0]] = value
} }
return args return args
}, {}), }, {}),
...this.action.extraArgs.reduce((args, param) => { ...this.action.extraArgs.reduce((args, arg) => {
let value = args[param.value] let value = args[arg.value]
try { try {
value = JSON.parse(value) value = JSON.parse(value)
} catch (e) { } catch (e) {
@ -447,7 +457,7 @@ export default {
console.debug(value) console.debug(value)
} }
args[param.name] = value args[arg.name] = value
return args return args
}, {}) }, {})
} }
@ -474,9 +484,9 @@ export default {
event.stopPropagation() event.stopPropagation()
this.running = true this.running = true
const args = { const args = {
...Object.entries(this.selectedProcedure.args).reduce((args, param) => { ...Object.entries(this.selectedProcedure.args).reduce((args, arg) => {
if (param[1] != null) { if (arg[1] != null) {
let value = param[1] let value = arg[1]
try { try {
value = JSON.parse(value) value = JSON.parse(value)
} catch (e) { } catch (e) {
@ -484,7 +494,7 @@ export default {
console.debug(value) console.debug(value)
} }
args[param[0]] = value args[arg[0]] = value
} }
return args return args
}, {}), }, {}),
@ -511,24 +521,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "vars"; @import "common";
$params-desktop-width: 30em;
$params-tablet-width: 20em;
$request-headers-btn-width: 7.5em;
@mixin header {
display: flex;
background: $header-bg-2;
align-items: center;
padding: 0.5em;
margin-bottom: 0.1em;
border: $title-border;
border-radius: 1em;
box-shadow: $title-shadow;
font-weight: normal;
font-size: 1em;
}
.execute-container { .execute-container {
width: 100%; width: 100%;
@ -541,7 +534,7 @@ $request-headers-btn-width: 7.5em;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.section { main {
width: 100%; width: 100%;
max-width: 1000px; max-width: 1000px;
display: flex; display: flex;
@ -554,304 +547,10 @@ $request-headers-btn-width: 7.5em;
} }
} }
form {
padding: 0;
margin: 0;
border-radius: 0;
border: none;
}
.action-form {
background: $default-bg-2;
padding: 1em .5em;
}
.request-header {
width: 100%;
display: flex;
align-items: center;
.autocomplete-container {
width: calc(100% - $request-headers-btn-width);
flex-grow: 1;
}
.buttons {
width: $request-headers-btn-width;
display: inline-flex;
justify-content: flex-end;
margin-right: 0.5em;
}
}
.section-title {
background: $header-bg;
padding: .75em .5em;
box-shadow: $title-shadow;
font-size: 1.1em;
margin-bottom: 0 !important;
@include from($desktop) {
border-radius: 0.5em 0.5em 0 0;
}
}
.request { .request {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 0 .5em; margin: 0 .5em;
form {
margin-bottom: 0 !important;
}
.options {
display: flex;
margin-top: 0.15em;
margin-bottom: 1.5em;
@include until($tablet) {
flex-direction: column;
}
}
.params {
@include until($tablet) {
width: 100%;
}
@include from($tablet) {
width: $params-tablet-width;
margin-right: 1.5em;
}
@include from($desktop) {
width: $params-desktop-width;
}
.param {
margin-bottom: .25em;
@include until($tablet) {
width: 100%;
}
}
.action-param-value {
width: 100%;
}
}
.add-param {
width: 100%;
button {
width: 100%;
background: $extra-params-btn-bg;
border: $title-border;
}
}
.extra-param {
display: flex;
margin-bottom: .5em;
label {
margin-left: 0.25em;
}
.buttons {
display: flex;
flex-grow: 1;
justify-content: right;
}
.action-extra-param-del {
border: 0;
text-align: right;
padding: 0 .5em;
}
input[type=text] {
width: 100%;
}
.buttons {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: .25em;
button {
background: none;
&:hover {
color: $default-hover-fg;
}
}
}
}
.doc-container,
.output-container {
margin-top: .5em;
}
.doc-container,
.attr-doc-container {
.title {
@include header;
}
}
.attr-doc-container {
.title {
.attr-name {
font-weight: bold;
margin-left: 0.25em;
}
}
}
.output-container {
flex-grow: 1;
}
.attr-doc-container {
@include from($tablet) {
width: calc(100% - #{$params-tablet-width} - 2em);
}
@include from($desktop) {
width: calc(100% - #{$params-desktop-width} - 2em);
}
.doc {
width: 100%;
overflow: auto;
}
&.widescreen {
@include until($tablet) {
display: none;
}
}
&.mobile {
width: 100%;
@include from($tablet) {
display: none;
}
}
}
.doc-container,
.attr-doc-container {
.doc {
padding: 1em !important;
}
}
.output-container,
.doc-container,
.attr-doc-container,
.options-container {
max-height: 50vh;
display: flex;
flex-direction: column;
.header {
@include header;
.title {
flex-grow: 1;
}
button {
background: none;
border: none;
box-shadow: none;
&:hover {
color: $default-hover-fg;
}
}
.attr-name {
display: inline-block;
font-weight: bold;
}
}
.response,
.error,
.doc {
height: 100%;
padding: .5em .5em 0 .5em;
border-radius: 1em;
overflow: auto;
margin-top: 0.1em;
}
.response {
background: $response-bg;
box-shadow: $response-shadow;
}
.error {
background: $error-bg;
padding: 1em;
box-shadow: $error-shadow;
}
.doc {
background: $doc-bg;
box-shadow: $doc-shadow;
}
}
.options-container {
margin-top: .5em;
padding-top: .5em;
}
textarea {
width: 100%;
height: 10em;
margin-bottom: .5em;
padding: .5em;
border: $default-border-2;
border-radius: 1em;
box-shadow: $border-shadow-bottom-right;
outline: none;
&:hover {
border: 1px solid $default-hover-fg-2;
}
&:focus {
border: 1px solid $selected-fg;
}
}
}
.raw-request {
.first-row {
@include until($tablet) {
width: 100%;
}
@include from($tablet) {
width: 80%;
max-width: 60em;
}
display: flex;
flex-direction: column;
button {
margin-left: 0;
}
}
} }
.procedures-container { .procedures-container {
@ -891,15 +590,11 @@ $request-headers-btn-width: 7.5em;
} }
} }
.action-param-value { .action-arg-value {
margin: 0.25em 0; margin: 0.25em 0;
} }
} }
pre {
background: none;
}
.run-btn { .run-btn {
background: $background-color; background: $background-color;
border-radius: .25em; border-radius: .25em;
@ -925,10 +620,4 @@ $request-headers-btn-width: 7.5em;
} }
} }
} }
:deep(.doc) {
blockquote {
margin-left: 0;
}
}
</style> </style>

View file

@ -0,0 +1,236 @@
@import "vars.scss";
hgroup {
flex-grow: 1;
button {
background: none;
border: none;
box-shadow: none;
&:hover {
color: $default-hover-fg;
}
}
}
h1 {
background: $header-bg;
padding: .75em .5em;
box-shadow: $title-shadow;
font-size: 1.1em;
margin-bottom: 0 !important;
@include from($desktop) {
border-radius: 0.5em 0.5em 0 0;
}
}
h2 {
@include header;
}
section {
max-height: 50vh;
display: flex;
flex-direction: column;
margin-top: .5em;
&.response {
flex-grow: 1;
}
&.args {
margin-top: .5em;
padding-top: .5em;
}
.response {
background: $response-bg;
box-shadow: $response-shadow;
}
.error {
background: $error-bg;
padding: 1em;
box-shadow: $error-shadow;
}
}
.buttons {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 0.25em;
flex-grow: 1;
button {
background: none;
&:hover {
color: $default-hover-fg;
}
}
}
header {
width: 100%;
display: flex;
align-items: center;
.autocomplete-container {
width: calc(100% - $request-headers-btn-width);
flex-grow: 1;
}
.buttons {
width: $request-headers-btn-width;
display: inline-flex;
justify-content: flex-end;
margin-right: 0.5em;
}
}
.doc {
height: 100%;
background: $doc-bg;
padding: 1em;
border-radius: 1em;
overflow: auto;
margin-top: 0.1em;
box-shadow: $doc-shadow;
}
:deep(.doc) {
blockquote {
margin-left: 0;
}
}
pre {
background: none;
}
textarea {
width: 100%;
height: 10em;
margin-bottom: .5em;
padding: .5em;
border: $default-border-2;
border-radius: 1em;
box-shadow: $border-shadow-bottom-right;
outline: none;
&:hover {
border: 1px solid $default-hover-fg-2;
}
&:focus {
border: 1px solid $selected-fg;
}
}
form {
background: $default-bg-2;
margin: 0;
border-radius: 0;
border: none;
padding: 1em .5em;
margin-bottom: 0 !important;
}
.raw .first-row {
@include until($tablet) {
width: 100%;
}
@include from($tablet) {
width: 80%;
max-width: 60em;
}
display: flex;
flex-direction: column;
button {
margin-left: 0;
}
}
.args-list {
padding-top: 0.5em;
@include until($tablet) {
width: 100%;
}
@include from($tablet) {
width: $params-tablet-width;
margin-right: 1.5em;
}
@include from($desktop) {
width: $params-desktop-width;
}
.arg {
margin-bottom: .25em;
@include until($tablet) {
width: 100%;
}
.required-flag {
width: 1.25em;
font-weight: bold;
margin-left: 0.25em;
}
input {
width: calc(100% - 1.5em);
}
}
.action-arg-value {
width: 100%;
}
}
.args-body {
display: flex;
margin-top: 0.15em;
margin-bottom: 1.5em;
@include until($tablet) {
flex-direction: column;
}
}
.add-arg {
width: 100%;
button {
width: 100%;
background: $extra-params-btn-bg;
border: $title-border;
}
}
.extra-arg {
display: flex;
margin-bottom: .5em;
label {
margin-left: 0.25em;
}
.action-extra-arg-del {
border: 0;
text-align: right;
padding: 0 .5em;
}
input[type=text] {
width: 100%;
}
}

View file

@ -11,3 +11,6 @@ $doc-shadow: 0 1px 3px 1px #d7d3c0, inset 0 1px 1px 0 #d7d3c9;
$response-shadow: $doc-shadow; $response-shadow: $doc-shadow;
$procedure-submit-btn-bg: #ebffeb; $procedure-submit-btn-bg: #ebffeb;
$section-title-bg: rgba(0, 0, 0, .04); $section-title-bg: rgba(0, 0, 0, .04);
$params-desktop-width: 30em;
$params-tablet-width: 20em;
$request-headers-btn-width: 7.5em;

View file

@ -34,3 +34,18 @@
#{$property}: -moz-calc( #{$expression} ); #{$property}: -moz-calc( #{$expression} );
#{$property}: calc( #{$expression} ); #{$property}: calc( #{$expression} );
} }
@mixin header {
width: 100%;
display: flex;
background: $header-bg-2;
align-items: center;
padding: 0.5em;
margin-bottom: 0.1em;
border: $title-border;
border-radius: 1em;
box-shadow: $title-shadow;
font-weight: normal;
font-size: 1em;
}