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