Skip to content

Sno issues search #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions components/NodeStatusReason.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export function NodeStatusReason(nv: NodeVersion) {
<li
key={i}
className="flex gap-2 items-center w-full justify-start text-xs"
title={`${yaml.stringify(e)}`}
title={`${yaml.stringify(e)}`}
>
<div className="sticky left-0 z-10 flex gap-1 whitespace-nowrap bg-gray-800 w-[14rem]">
{/* show green checkmark if approved before */}
Expand All @@ -394,18 +394,14 @@ export function NodeStatusReason(nv: NodeVersion) {
>
<FaGithub className="w-5 h-5 ml-4" />
</Link>
<code
className="text-gray-400 whitespace-nowrap flex-1"
>
<code className="text-gray-400 whitespace-nowrap flex-1">
{(e.file_path?.length ?? 0) > 18 + 2
? `…${e.file_path?.slice(-18)}`
: e.file_path}
&nbsp;L{e.line_number}
</code>
</div>
<code
className="flex-1 ml-4 whitespace-nowrap text"
>
<code className="flex-1 ml-4 whitespace-nowrap text">
&nbsp;
{e.issue_type}
&nbsp;
Expand Down
2 changes: 1 addition & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const withMDX = mdx({
const conf: NextConfig = {
reactStrictMode: true,
// swcMinify: true,
swcMinify: true,
// swcMinify: true,

// Append the default value with md extensions
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
Expand Down
10 changes: 5 additions & 5 deletions orval.config.js → orval.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require('dotenv/config') // load backend url from .env
import 'dotenv/config' // load backend url from .env
import { defineConfig } from 'orval'

// orval.config.js
module.exports = {
export default defineConfig({
dripApi: {
input: {
target: 'https://api.comfy.org/openapi',
target: `${process.env.NEXT_PUBLIC_BACKEND_URL}/openapi`,
},
output: {
target: './src/api/generated.ts',
Expand All @@ -17,4 +17,4 @@ module.exports = {
},
},
},
}
})
32 changes: 30 additions & 2 deletions pages/admin/nodeversions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function NodeVersionList({}) {
deleted: NodeVersionStatus.NodeVersionStatusDeleted,
pending: NodeVersionStatus.NodeVersionStatusPending,
active: NodeVersionStatus.NodeVersionStatusActive,
} // satisfies Record<string, NodeVersionStatus> // 'satisfies' requires latest typescript
} satisfies Record<string, NodeVersionStatus> // 'satisfies' requires latest typescript
const flagColors = {
all: 'success',
flagged: 'warning',
Expand Down Expand Up @@ -109,16 +109,18 @@ function NodeVersionList({}) {
useState(false)

const queryForNodeId = router.query.nodeId as string
const queryForStatusReason = router.query.statusReason as string

const getAllNodeVersionsQuery = useListAllNodeVersions(
{
page: page,
pageSize: 8,
statuses: selectedStatus,
include_status_reason: true,
status_reason: queryForStatusReason || '',

// failed to filter, TODO: fix this in the backend
// nodeId: queryForNodeId ?? undefined,
// nodeId: queryForNodeId || undefined,
},
{ query: { enabled: !queryForNodeId } }
)
Expand Down Expand Up @@ -796,6 +798,32 @@ function NodeVersionList({}) {

<Button color="blue">Search</Button>
</form>
<form
className="flex gap-2 items-center"
onSubmit={(e) => {
e.preventDefault()
const inputElement = document.getElementById(
'filter-status-reason'
) as HTMLInputElement
const statusReason = inputElement.value.trim()
const searchParams = new URLSearchParams({
...(omit(['statusReason'])(router.query) as object),
...(statusReason ? { statusReason } : {}),
})
.toString()
.replace(/^(?!$)/, '?')
router.push(
router.pathname + searchParams + location.hash
)
}}
>
<TextInput
id="filter-status-reason"
placeholder="Filter by status reason"
defaultValue={queryForStatusReason || ''}
/>
<Button color="blue">Search by Reason</Button>
</form>
<div className="flex gap-2">
<Button
color={
Expand Down
Loading