1
0
Эх сурвалжийг харах

feat: workflow parameter description

Ahmad Kholid 2 жил өмнө
parent
commit
1944fc963e

+ 10 - 1
src/components/newtab/workflow/edit/EditWorkflowParameters.vue

@@ -68,7 +68,7 @@
               </ui-button>
             </td>
           </tr>
-          <tr v-if="paramTypes[param.type].options">
+          <tr>
             <td colspan="999" style="padding-top: 0">
               <ui-expand
                 hide-header-icon
@@ -83,8 +83,16 @@
                   <span>Options</span>
                 </template>
                 <div class="pl-[28px] mt-2 mb-4">
+                  <ui-textarea
+                    v-model="param.description"
+                    placeholder="Description"
+                    title="Description"
+                    class="mb-4"
+                    style="max-width: 400px"
+                  />
                   <component
                     :is="paramTypes[param.type].options"
+                    v-if="paramTypes[param.type].options"
                     v-model="param.data"
                     :default-value="paramTypes[param.type].data"
                   />
@@ -143,6 +151,7 @@ function addParameter() {
   state.parameters.push({
     name: 'param',
     type: 'string',
+    description: '',
     defaultValue: '',
     placeholder: 'Text',
     data: paramTypes.string.data,

+ 8 - 1
src/params/App.vue

@@ -41,7 +41,7 @@
           </div>
         </template>
         <div class="px-4 pb-4">
-          <ul class="space-y-2">
+          <ul class="space-y-2 divide-y">
             <li v-for="(param, paramIdx) in workflow.params" :key="paramIdx">
               <component
                 :is="paramsList[param.type].valueComp"
@@ -60,6 +60,13 @@
                 class="w-full"
                 @keyup.enter="runWorkflow(index, workflow)"
               />
+              <p
+                v-if="param.description"
+                title="Description"
+                class="ml-1 text-sm"
+              >
+                {{ param.description }}
+              </p>
             </li>
           </ul>
           <div class="flex items-center mt-6">