mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: open multiple app windows (#2912)
This commit is contained in:
@@ -4,6 +4,11 @@ import { makeStyles } from "@material-ui/core/styles"
|
|||||||
import ComputerIcon from "@material-ui/icons/Computer"
|
import ComputerIcon from "@material-ui/icons/Computer"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import * as TypesGen from "../../api/typesGenerated"
|
import * as TypesGen from "../../api/typesGenerated"
|
||||||
|
import { generateRandomString } from "../../util/random"
|
||||||
|
|
||||||
|
export const Language = {
|
||||||
|
appTitle: (appName: string, identifier: string): string => `${appName} - ${identifier}`,
|
||||||
|
}
|
||||||
|
|
||||||
export interface AppLinkProps {
|
export interface AppLinkProps {
|
||||||
userName: TypesGen.User["username"]
|
userName: TypesGen.User["username"]
|
||||||
@@ -23,7 +28,11 @@ export const AppLink: FC<AppLinkProps> = ({ userName, workspaceName, appName, ap
|
|||||||
className={styles.link}
|
className={styles.link}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
window.open(href, appName, "width=900,height=600")
|
window.open(
|
||||||
|
href,
|
||||||
|
Language.appTitle(appName, generateRandomString(12)),
|
||||||
|
"width=900,height=600",
|
||||||
|
)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user