feat(web): add display number for workflow
This commit is contained in:
		
							parent
							
								
									59ec8ecb06
								
							
						
					
					
						commit
						39dd760ba0
					
				@ -26,9 +26,10 @@ export async function RunDisplay({
 | 
				
			|||||||
        className="appearance-none hover:cursor-pointer"
 | 
					        className="appearance-none hover:cursor-pointer"
 | 
				
			||||||
      >
 | 
					      >
 | 
				
			||||||
        <TableRow>
 | 
					        <TableRow>
 | 
				
			||||||
          <TableCell>{run.version?.version}</TableCell>
 | 
					          <TableCell>{run.number}</TableCell>
 | 
				
			||||||
          <TableCell className="font-medium">{run.machine?.name}</TableCell>
 | 
					          <TableCell className="font-medium">{run.machine?.name}</TableCell>
 | 
				
			||||||
          <TableCell>{getRelativeTime(run.created_at)}</TableCell>
 | 
					          <TableCell>{getRelativeTime(run.created_at)}</TableCell>
 | 
				
			||||||
 | 
					          <TableCell>{run.version?.version}</TableCell>
 | 
				
			||||||
          <LiveStatus run={run} />
 | 
					          <LiveStatus run={run} />
 | 
				
			||||||
        </TableRow>
 | 
					        </TableRow>
 | 
				
			||||||
      </DialogTrigger>
 | 
					      </DialogTrigger>
 | 
				
			||||||
 | 
				
			|||||||
@ -18,9 +18,10 @@ export async function RunsTable(props: { workflow_id: string }) {
 | 
				
			|||||||
        <TableCaption>A list of your recent runs.</TableCaption>
 | 
					        <TableCaption>A list of your recent runs.</TableCaption>
 | 
				
			||||||
        <TableHeader className="bg-background top-0 sticky">
 | 
					        <TableHeader className="bg-background top-0 sticky">
 | 
				
			||||||
          <TableRow>
 | 
					          <TableRow>
 | 
				
			||||||
            <TableHead className=" w-[100px]">Version</TableHead>
 | 
					            <TableHead className="w-[100px]">Number</TableHead>
 | 
				
			||||||
            <TableHead className="">Machine</TableHead>
 | 
					            <TableHead className="">Machine</TableHead>
 | 
				
			||||||
            <TableHead className="">Time</TableHead>
 | 
					            <TableHead className="">Time</TableHead>
 | 
				
			||||||
 | 
					            <TableHead className="w-[100px]">Version</TableHead>
 | 
				
			||||||
            <TableHead className="">Live Status</TableHead>
 | 
					            <TableHead className="">Live Status</TableHead>
 | 
				
			||||||
            <TableHead className=" text-right">Status</TableHead>
 | 
					            <TableHead className=" text-right">Status</TableHead>
 | 
				
			||||||
          </TableRow>
 | 
					          </TableRow>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,12 +1,15 @@
 | 
				
			|||||||
import { db } from "@/db/db";
 | 
					import { db } from "@/db/db";
 | 
				
			||||||
import { deploymentsTable, workflowRunsTable } from "@/db/schema";
 | 
					import { deploymentsTable, workflowRunsTable } from "@/db/schema";
 | 
				
			||||||
import { desc, eq } from "drizzle-orm";
 | 
					import { desc, eq, sql } from "drizzle-orm";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export async function findAllRuns(workflow_id: string) {
 | 
					export async function findAllRuns(workflow_id: string) {
 | 
				
			||||||
  return await db.query.workflowRunsTable.findMany({
 | 
					  return await db.query.workflowRunsTable.findMany({
 | 
				
			||||||
    where: eq(workflowRunsTable.workflow_id, workflow_id),
 | 
					    where: eq(workflowRunsTable.workflow_id, workflow_id),
 | 
				
			||||||
    orderBy: desc(workflowRunsTable.created_at),
 | 
					    orderBy: desc(workflowRunsTable.created_at),
 | 
				
			||||||
    limit: 10,
 | 
					    limit: 10,
 | 
				
			||||||
 | 
					    extras: {
 | 
				
			||||||
 | 
					      "number": sql<number>`row_number() over (order by created_at)`.as("number"),
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    with: {
 | 
					    with: {
 | 
				
			||||||
      machine: {
 | 
					      machine: {
 | 
				
			||||||
        columns: {
 | 
					        columns: {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user