Skip to content
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
11 changes: 8 additions & 3 deletions site/htmlTemplates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@
data-statuscode="{{ .APIResponse.StatusCode }}"
data-message="{{ .APIResponse.Message }}"
/>
<link rel="mask-icon" href="/static/favicon.svg" color="#000000" crossorigin="use-credentials" />
<link rel="alternate icon" type="image/png" href="/favicon.png" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<!-- We need to set data-react-helmet to be able to override it in the workspace page -->
<link
rel="alternate icon"
type="image/png"
href="/favicons/favicon.png"
data-react-helmet="true"
/>
<link rel="icon" type="image/svg+xml" href="/favicons/favicon.svg" data-react-helmet="true" />
</head>

<body>
Expand Down
4 changes: 4 additions & 0 deletions site/src/pages/WorkspacePage/WorkspacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { FullScreenLoader } from "../../components/Loader/FullScreenLoader"
import { Workspace } from "../../components/Workspace/Workspace"
import { firstOrItem } from "../../util/array"
import { pageTitle } from "../../util/page"
import { getFaviconByStatus } from "../../util/workspace"
import { selectUser } from "../../xServices/auth/authSelectors"
import { XServiceContext } from "../../xServices/StateContext"
import { workspaceMachine } from "../../xServices/workspace/workspaceXService"
Expand Down Expand Up @@ -50,10 +51,13 @@ export const WorkspacePage: React.FC = () => {
} else if (!workspace) {
return <FullScreenLoader />
} else {
const favicon = getFaviconByStatus(workspace.latest_build)
return (
<>
<Helmet>
<title>{pageTitle(`${workspace.owner_name}/${workspace.name}`)}</title>
<link rel="alternate icon" type="image/png" href={`/favicons/${favicon}.png`} />
<link rel="icon" type="image/svg+xml" href={`/favicons/${favicon}.svg`} />
</Helmet>

<Workspace
Expand Down
38 changes: 38 additions & 0 deletions site/src/util/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,41 @@ export const defaultWorkspaceExtension = (
deadline: fourHoursFromNow.format(),
}
}

// You can see the favicon designs here: https://www.figma.com/file/YIGBkXUcnRGz2ZKNmLaJQf/Coder-v2-Design?node-id=560%3A620

type FaviconType =
| "favicon"
| "favicon-success"
| "favicon-error"
| "favicon-warning"
| "favicon-running"

export const getFaviconByStatus = (build: TypesGen.WorkspaceBuild): FaviconType => {
const status = getWorkspaceStatus(build)
switch (status) {
case undefined:
return "favicon"
case "started":
return "favicon-success"
case "starting":
return "favicon-running"
case "stopping":
return "favicon-running"
case "stopped":
return "favicon"
case "deleting":
return "favicon"
case "deleted":
return "favicon"
case "canceling":
return "favicon-warning"
case "canceled":
return "favicon"
case "error":
return "favicon-error"
case "queued":
return "favicon"
}
throw new Error("unknown status " + status)
}
Binary file removed site/static/favicon.png
Binary file not shown.
1 change: 0 additions & 1 deletion site/static/favicon.svg

This file was deleted.

Binary file added site/static/favicons/favicon-error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions site/static/favicons/favicon-error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/static/favicons/favicon-running.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions site/static/favicons/favicon-running.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/static/favicons/favicon-success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions site/static/favicons/favicon-success.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/static/favicons/favicon-warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions site/static/favicons/favicon-warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/static/favicons/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy