Skip to content

Commit

Permalink
Unstaging (#121)
Browse files Browse the repository at this point in the history
* only allow unstaging for completed staging

* magic-mock debugging log

* more status displayed

* actually fix
  • Loading branch information
nafiz1001 authored Nov 19, 2024
1 parent 398e4ab commit d8f6760
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 4 additions & 0 deletions magic-mock/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ void new Promise((resolve, reject) => {
reject(err)
})
server.on("listening", () => console.log(`listening on port ${PORT}`))
server.on("request", (req, res) => {
console.log(req.method, req.url, req.headers)
console.log(res.statusCode, res.statusMessage)
})
})
14 changes: 4 additions & 10 deletions triton-client/src/components/DatasetCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function DatasetCard({ datasetID }: DatasetCardProps) {
const requestDetails = useMemo(() => {
return SUPPORTED_DOWNLOAD_TYPES.map((type) => {
const req = requestByType[type]
if (req && !req.should_delete && req.status !== "FAILED") {
if (req && !req.should_delete && req.status === "SUCCESS") {
const { type, status } = req
const actions: ActionDropdownProps["actions"] = [
{
Expand Down Expand Up @@ -167,12 +167,6 @@ function DatasetCard({ datasetID }: DatasetCardProps) {
},
]

let statusDescription: ReactNode
if (status === "SUCCESS") {
statusDescription = "DOWNLOAD"
} else {
statusDescription = "QUEUED"
}
const buttonStagingActive = (
<Button
key={type}
Expand All @@ -196,7 +190,7 @@ function DatasetCard({ datasetID }: DatasetCardProps) {
<Space>
{type}
{"|"}
{statusDescription}
{"DOWNLOAD"}
</Space>
</Button>
)
Expand All @@ -212,8 +206,8 @@ function DatasetCard({ datasetID }: DatasetCardProps) {
let statusDescription: ReactNode
if (req && req.should_delete) {
statusDescription = "UNSTAGING"
} else if (req?.status === "FAILED") {
statusDescription = "FAILED"
} else if (req?.status) {
statusDescription = req.status
} else {
statusDescription = "STAGE"
}
Expand Down

0 comments on commit d8f6760

Please sign in to comment.