Cli improvements (#850)

* Fix infinite user list

* Remove Description from table
This commit is contained in:
Kai Jellinghaus
2022-11-01 22:14:46 +01:00
committed by GitHub
parent e5d8111ae1
commit 7dafa6e955
5 changed files with 6 additions and 17 deletions
+1 -1
View File
@@ -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(
+2 -2
View File
@@ -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();
}
+1 -10
View File
@@ -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();
+1 -2
View File
@@ -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;
+1 -2
View File
@@ -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();