Skip to content

Commit

Permalink
implement search
Browse files Browse the repository at this point in the history
  • Loading branch information
dieknolle3333 committed May 8, 2024
1 parent 0b0756a commit d92b3c9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions frontend/javascripts/admin/voxelytics/workflow_list_view.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useMemo, useState } from "react";
import { SyncOutlined } from "@ant-design/icons";
import { Table, Progress, Tooltip, Button } from "antd";
import { Table, Progress, Tooltip, Button, Input } from "antd";
import { Link } from "react-router-dom";
import { getVoxelyticsWorkflows } from "admin/admin_rest_api";
import {
Expand All @@ -12,11 +12,12 @@ import { usePolling } from "libs/react_hooks";
import { formatCountToDataAmountUnit, formatDateMedium, formatNumber } from "libs/format_utils";
import Toast from "libs/toast";
import { runStateToStatus, VX_POLLING_INTERVAL } from "./utils";
import Search from "antd/lib/input/Search";
import Persistence from "libs/persistence";
import * as Utils from "libs/utils";
import { PropTypes } from "@scalableminds/prop-types";

const { Search } = Input;

const persistence = new Persistence<Pick<{ searchQuery: string }, "searchQuery">>(
{
searchQuery: PropTypes.string,
Expand Down Expand Up @@ -140,7 +141,7 @@ export default function WorkflowListView() {
percent={Math.round(
((run.taskCounts.complete + run.taskCounts.cancelled + run.taskCounts.failed) /
run.taskCounts.total) *
100,
100,
)}
status={runStateToStatus(run.state)}
success={{ percent: Math.round((run.taskCounts.complete / run.taskCounts.total) * 100) }}
Expand All @@ -153,22 +154,22 @@ export default function WorkflowListView() {
return (
<div className="container voxelytics-view">
<div className="pull-right">
<Button onClick={() => loadData()} style={{ marginRight: 20 }}>
<SyncOutlined spin={isLoading} /> Refresh
</Button>
<Search
style={{
width: 200,
}}
onChange={handleSearch}
value={searchQuery}
/>
<Button onClick={() => loadData()}>
<SyncOutlined spin={isLoading} /> Refresh
</Button>
</div>
<h3>Voxelytics Workflows</h3>
<Table
bordered
rowKey={(run: RenderRunInfo) => `${run.id}-${run.workflowHash}`}
pagination={{ pageSize: 1 }}
pagination={{ pageSize: 100 }}
columns={[
{
title: "Workflow",
Expand Down

0 comments on commit d92b3c9

Please sign in to comment.