mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-11 20:00:29 +01:00
Some tweaks for beta
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@yaakapp/api",
|
||||
"version": "0.1.9",
|
||||
"version": "0.1.10",
|
||||
"main": "lib/index.js",
|
||||
"typings": "./lib/index.d.ts",
|
||||
"files": [
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type FindHttpResponsesRequest = { requestId: string, limit: bigint | null, };
|
||||
export type FindHttpResponsesRequest = { requestId: string, limit: number | null, };
|
||||
|
||||
@@ -1974,10 +1974,13 @@ async fn handle_plugin_event<R: Runtime>(
|
||||
None
|
||||
}
|
||||
InternalEventPayload::FindHttpResponsesRequest(req) => {
|
||||
let http_responses =
|
||||
list_http_responses(app_handle, req.request_id.as_str(), req.limit)
|
||||
.await
|
||||
.unwrap_or_default();
|
||||
let http_responses = list_http_responses(
|
||||
app_handle,
|
||||
req.request_id.as_str(),
|
||||
req.limit.map(|l| l as i64),
|
||||
)
|
||||
.await
|
||||
.unwrap_or_default();
|
||||
Some(InternalEventPayload::FindHttpResponsesResponse(
|
||||
FindHttpResponsesResponse { http_responses },
|
||||
))
|
||||
|
||||
@@ -364,7 +364,7 @@ pub struct GetHttpRequestByIdResponse {
|
||||
#[ts(export)]
|
||||
pub struct FindHttpResponsesRequest {
|
||||
pub request_id: String,
|
||||
pub limit: Option<i64>,
|
||||
pub limit: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize, TS)]
|
||||
|
||||
@@ -9,6 +9,7 @@ import type {
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
import type { FnArg } from '../gen/FnArg';
|
||||
import type { Tokens } from '../gen/Tokens';
|
||||
import { useActiveRequest } from '../hooks/useActiveRequest';
|
||||
import { useDebouncedValue } from '../hooks/useDebouncedValue';
|
||||
import { useHttpRequests } from '../hooks/useHttpRequests';
|
||||
import { useRenderTemplate } from '../hooks/useRenderTemplate';
|
||||
@@ -207,6 +208,7 @@ function HttpRequestArg({
|
||||
onChange: (v: string) => void;
|
||||
}) {
|
||||
const httpRequests = useHttpRequests();
|
||||
const activeRequest = useActiveRequest();
|
||||
return (
|
||||
<Select
|
||||
label={arg.label ?? arg.name}
|
||||
@@ -214,10 +216,12 @@ function HttpRequestArg({
|
||||
onChange={onChange}
|
||||
value={value}
|
||||
options={[
|
||||
...httpRequests.map((r) => ({
|
||||
label: fallbackRequestName(r),
|
||||
value: r.id,
|
||||
})),
|
||||
...httpRequests
|
||||
.filter((r) => r.id != activeRequest?.id)
|
||||
.map((r) => ({
|
||||
label: fallbackRequestName(r),
|
||||
value: r.id,
|
||||
})),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -41,9 +41,9 @@ export function twig({
|
||||
templateFunctions.map((fn) => {
|
||||
const shortArgs =
|
||||
fn.args
|
||||
.slice(0, 2)
|
||||
.slice(0, 1)
|
||||
.map((a) => a.name)
|
||||
.join(', ') + (fn.args.length > 2 ? ', …' : '');
|
||||
.join(', ') + (fn.args.length > 1 ? ', …' : '');
|
||||
return {
|
||||
name: fn.name,
|
||||
type: 'function',
|
||||
|
||||
Reference in New Issue
Block a user