mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 19:33:46 +00:00
1d4dc3a26f
* refactor: unlock changing port in UI * Change server port (#464) * Ability to save custom port * Launch server on custom port & pass that port to electron * Add serverPort validation * Prevent changing port in docker --------- Co-authored-by: Snehanshu Phukon <snehanshu@mamboemm.com> --------- Co-authored-by: স্নেহাংশু ফুকন <hello@snehanshu.com> Co-authored-by: Snehanshu Phukon <snehanshu@mamboemm.com>
28 lines
841 B
TypeScript
28 lines
841 B
TypeScript
import { IoArrowUp } from '@react-icons/all-files/io5/IoArrowUp';
|
|
|
|
import { serverPort } from '../../common/api/apiConstants';
|
|
import useInfo from '../../common/hooks-query/useInfo';
|
|
import { openLink } from '../../common/utils/linkUtils';
|
|
|
|
import style from './Info.module.scss';
|
|
|
|
export default function InfoNif() {
|
|
const { data } = useInfo();
|
|
|
|
const handleClick = (address: string) => {
|
|
const baseURL = `http://__IP__:${serverPort}`;
|
|
openLink(baseURL.replace('__IP__', address));
|
|
};
|
|
|
|
return (
|
|
<div className={style.interfaceList}>
|
|
{data?.networkInterfaces?.map((nif) => (
|
|
<span key={nif.address} onClick={() => handleClick(nif.address)} className={style.interface}>
|
|
{`${nif.name} - ${nif.address}`}
|
|
<IoArrowUp className={style.linkIcon} />
|
|
</span>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|