|
|
@ -23,6 +23,7 @@ |
|
|
|
</a-col> |
|
|
|
</a-row> |
|
|
|
<div class="p-1"> |
|
|
|
<a-button class="mr-1" @click="actionServiceParamReset">重置</a-button> |
|
|
|
<a-button class="mr-1" @click="actionServiceParamReload">刷新</a-button> |
|
|
|
<a-button @click="actionServiceParamSave">保存</a-button> |
|
|
|
</div> |
|
|
@ -31,12 +32,12 @@ |
|
|
|
<fieldset v-for="(group,groupIndex) in actions" :key="groupIndex" class="border my-1 p-1"> |
|
|
|
<legend>{{ group.name }}</legend> |
|
|
|
<div v-for="action in group.items" :key="action.key" :class="{'inline-block ml-1':0 === action.params.length}"> |
|
|
|
<a-button v-if="0 === action.params.length" class="my-1" |
|
|
|
<a-button v-if="0 === action.params.length" class="my-1 w-64 text-left" |
|
|
|
:loading="action.isExecuting" |
|
|
|
@click="actionServiceExecute(action)" |
|
|
|
>{{ action.name }}</a-button> |
|
|
|
<div v-else class="border rounded-md my-1 px-3 bg-white"> |
|
|
|
<span>{{ action.name }}</span> |
|
|
|
<div v-else class="border rounded-md my-1 pr-3 bg-white"> |
|
|
|
<a-button class="m-1 w-64 text-left" :loading="action.isExecuting" @click="actionServiceExecute(action)">{{ action.name }}</a-button> |
|
|
|
<div class="inline-block mx-2" v-for="actionParam in action.params" :key="actionParam.key"> |
|
|
|
{{ actionParam.name }} : |
|
|
|
<a-switch v-if="'java.lang.Boolean' === actionParam.type" v-model:checked="actionParam.value" /> |
|
|
@ -47,7 +48,6 @@ |
|
|
|
</a-select> |
|
|
|
<span v-else>{{ actionParam }}</span> |
|
|
|
</div> |
|
|
|
<a-button class="m-1" :loading="action.isExecuting" @click="actionServiceExecute(action)">执行</a-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</fieldset> |
|
|
@ -149,6 +149,15 @@ async function actionServiceParamSave() { |
|
|
|
} catch ( e ) {/** nothing to do here */} |
|
|
|
} |
|
|
|
|
|
|
|
// service param reset |
|
|
|
async function actionServiceParamReset() { |
|
|
|
try { |
|
|
|
let client = ApiClient.getClient(); |
|
|
|
await client.call('service-config/service-params-reset', {serviceKey:props.serviceKey}); |
|
|
|
await actionServiceParamReload(); |
|
|
|
} catch ( e ) {/** nothing to do here */} |
|
|
|
} |
|
|
|
|
|
|
|
// service actions reload |
|
|
|
async function serviceActionReload() { |
|
|
|
try { |
|
|
@ -162,7 +171,7 @@ async function serviceActionReload() { |
|
|
|
actions.value.push(group); |
|
|
|
} |
|
|
|
group.items.push(item); |
|
|
|
group.items.sort((a,b) => a.params.length - b.params.length); |
|
|
|
group.items.sort((a,b) => b.order - a.order || a.params.length - b.params.length); |
|
|
|
} |
|
|
|
actions.value.sort((a,b) => a.name.localeCompare(b.name)); |
|
|
|
} catch ( e ) {/** nothing to do here */} |
|
|
|