mirror of
https://github.com/microsoft/AI-Red-Teaming-Playground-Labs.git
synced 2026-02-12 17:22:49 +00:00
Added support for localhost equivalents
This commit is contained in:
@@ -2,23 +2,23 @@
|
|||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Spinner,
|
Spinner,
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
TableCell,
|
TableCell,
|
||||||
TableCellLayout,
|
TableCellLayout,
|
||||||
TableColumnDefinition,
|
TableColumnDefinition,
|
||||||
TableColumnId,
|
TableColumnId,
|
||||||
TableHeader,
|
TableHeader,
|
||||||
TableHeaderCell,
|
TableHeaderCell,
|
||||||
TableRow,
|
TableRow,
|
||||||
createTableColumn,
|
createTableColumn,
|
||||||
useTableFeatures,
|
useTableFeatures,
|
||||||
useTableSort
|
useTableSort
|
||||||
} from "@fluentui/react-components";
|
} from "@fluentui/react-components";
|
||||||
import {
|
import {
|
||||||
DocumentRegular, OpenRegular
|
DocumentRegular, OpenRegular
|
||||||
} from "@fluentui/react-icons";
|
} from "@fluentui/react-icons";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
@@ -104,6 +104,14 @@ export const SortControlled = () => {
|
|||||||
|
|
||||||
const getUrl = (id: number, url?: string) => {
|
const getUrl = (id: number, url?: string) => {
|
||||||
if (url) {
|
if (url) {
|
||||||
|
const urlObj = new URL(url);
|
||||||
|
if (
|
||||||
|
(urlObj.hostname === "localhost" || urlObj.hostname === "127.0.0.1") &&
|
||||||
|
window.location.hostname !== urlObj.hostname
|
||||||
|
) {
|
||||||
|
urlObj.hostname = window.location.hostname;
|
||||||
|
return urlObj.toString();
|
||||||
|
}
|
||||||
return url;
|
return url;
|
||||||
} else {
|
} else {
|
||||||
return `/challenge/${id}/`;
|
return `/challenge/${id}/`;
|
||||||
|
|||||||
Reference in New Issue
Block a user