This commit is contained in:
Fine 2022-11-28 17:01:05 +08:00
parent 7c3a9407c2
commit 699057b6ed
4 changed files with 15 additions and 15 deletions

View File

@ -117,20 +117,14 @@ export const networkProfilingStore = defineStore({
when4xx: string;
when5xx: string;
minDuration: number;
}
}[]
) {
const res: AxiosResponse = await graphql
.query("newNetworkProfiling")
.params({
request: {
instanceId,
samplings: {
...params,
settings: {
requireCompleteRequest: true,
requireCompleteResponse: true,
},
},
samplings: params,
},
});

View File

@ -35,7 +35,7 @@ limitations under the License. -->
class="mb-5"
:value="states.when4xx"
:options="InitTaskField.Whenxx"
@change="changeConfig({ when4xx: states.when4xx })"
@change="changeWhen4xx"
/>
</div>
<div>
@ -44,7 +44,7 @@ limitations under the License. -->
class="mb-5"
:value="states.when5xx"
:options="InitTaskField.Whenxx"
@change="changeConfig({ when5xx: states.when5xx })"
@change="changeWhen5xx"
/>
</div>
</div>
@ -71,9 +71,12 @@ const props = defineProps({
const { t } = useI18n();
const states = reactive<NetworkProfilingRequest>(props.condition);
function changeConfig(params: { [key: string]: number | string }) {
const key: string = Object.keys(params)[0];
(states as any)[key] = params[key];
function changeWhen5xx(value: string) {
states.when5xx = value;
emits("change", states, props.key);
}
function changeWhen4xx(value: string) {
states.when4xx = value;
emits("change", states, props.key);
}
</script>

View File

@ -91,6 +91,10 @@ function createTask() {
minDuration: isNaN(Number(d.minDuration))
? undefined
: Number(d.minDuration),
settings: {
requireCompleteRequest: true,
requireCompleteResponse: true,
},
};
});
emits("create", list);

View File

@ -176,11 +176,10 @@ async function saveNewTask(
minDuration: number;
}[]
) {
console.log(params);
newTask.value = false;
const instanceId =
(selectorStore.currentPod && selectorStore.currentPod.id) || "";
if (instanceId) {
if (!instanceId) {
return ElMessage.error("No Instance ID");
}
const res = await networkProfilingStore.createNetworkTask(instanceId, params);