From 7dafa6e955c48756072fbb84cd72d4ce5298d5ad Mon Sep 17 00:00:00 2001 From: Kai Jellinghaus Date: Tue, 1 Nov 2022 22:14:46 +0100 Subject: [PATCH] Cli improvements (#850) * Fix infinite user list * Remove Description from table --- cli/flow.ts | 2 +- cli/resource.ts | 4 ++-- cli/script.ts | 11 +---------- cli/user.ts | 3 +-- cli/variable.ts | 3 +-- 5 files changed, 6 insertions(+), 17 deletions(-) diff --git a/cli/flow.ts b/cli/flow.ts index 3464e3e21b..d5933bf5e0 100644 --- a/cli/flow.ts +++ b/cli/flow.ts @@ -86,7 +86,7 @@ async function list(opts: GlobalOptions & { showArchived?: boolean }) { } new Table() - .header(["path", "summary", "edited at", "edited by", "description"]) + .header(["path", "summary", "edited at", "edited by"]) .padding(2) .border(true) .body( diff --git a/cli/resource.ts b/cli/resource.ts index db95211fd4..d2731fd657 100644 --- a/cli/resource.ts +++ b/cli/resource.ts @@ -117,10 +117,10 @@ async function list(opts: GlobalOptions) { } new Table() - .header(["Path", "Resource Type", "Description"]) + .header(["Path", "Resource Type"]) .padding(2) .border(true) - .body(total.map((x) => [x.path, x.resource_type, x.description])) + .body(total.map((x) => [x.path, x.resource_type])) .render(); } diff --git a/cli/script.ts b/cli/script.ts index af943d6a3e..b1b62a22d6 100644 --- a/cli/script.ts +++ b/cli/script.ts @@ -152,15 +152,7 @@ async function list(opts: GlobalOptions & { showArchived?: boolean }) { } new Table() - .header([ - "path", - "hash", - "kind", - "language", - "created at", - "created by", - "description", - ]) + .header(["path", "hash", "kind", "language", "created at", "created by"]) .padding(2) .border(true) .body( @@ -171,7 +163,6 @@ async function list(opts: GlobalOptions & { showArchived?: boolean }) { x.language, x.created_at, x.created_by, - x.description ?? "-", ]) ) .render(); diff --git a/cli/user.ts b/cli/user.ts index d8328ac1e4..5e4b6feddc 100644 --- a/cli/user.ts +++ b/cli/user.ts @@ -1,4 +1,3 @@ -import { reset } from "https://deno.land/std@0.161.0/fmt/colors.ts"; import { Command } from "https://deno.land/x/cliffy@v0.25.4/command/command.ts"; import { Table } from "https://deno.land/x/cliffy@v0.25.4/table/table.ts"; import { UserService } from "https://deno.land/x/windmill@v1.41.0/mod.ts"; @@ -17,7 +16,7 @@ async function list(opts: GlobalOptions) { while (true) { const res = await UserService.listUsersAsSuperAdmin({ page, perPage }); total.push(...res); - page += 0; + page += 1; if (res.length < perPage) { break; diff --git a/cli/variable.ts b/cli/variable.ts index 50079bd11a..2281a5e5bb 100644 --- a/cli/variable.ts +++ b/cli/variable.ts @@ -11,7 +11,7 @@ async function list(opts: GlobalOptions) { const variables = await VariableService.listVariable({ workspace }); new Table() - .header(["Path", "Is Secret", "Account", "Value", "Description"]) + .header(["Path", "Is Secret", "Account", "Value"]) .padding(2) .border(true) .body( @@ -20,7 +20,6 @@ async function list(opts: GlobalOptions) { x.is_secret ? "true" : "false", x.account ?? "-", x.value ?? "-", - x.description ?? "-", ]) ) .render();