mirror of https://github.com/jetkvm/kvm.git
Compare commits
3 Commits
0078d50a18
...
17b364b58a
Author | SHA1 | Date |
---|---|---|
|
17b364b58a | |
|
a1ed28c676 | |
|
1674a6666c |
4
Makefile
4
Makefile
|
@ -2,8 +2,8 @@ BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
BUILDDATE ?= $(shell date -u +%FT%T%z)
|
BUILDDATE ?= $(shell date -u +%FT%T%z)
|
||||||
BUILDTS ?= $(shell date -u +%s)
|
BUILDTS ?= $(shell date -u +%s)
|
||||||
REVISION ?= $(shell git rev-parse HEAD)
|
REVISION ?= $(shell git rev-parse HEAD)
|
||||||
VERSION_DEV := 0.4.5-dev$(shell date +%Y%m%d%H%M)
|
VERSION_DEV ?= 0.4.5-dev$(shell date +%Y%m%d%H%M)
|
||||||
VERSION := 0.4.4
|
VERSION ?= 0.4.4
|
||||||
|
|
||||||
PROMETHEUS_TAG := github.com/prometheus/common/version
|
PROMETHEUS_TAG := github.com/prometheus/common/version
|
||||||
KVM_PKG_NAME := github.com/jetkvm/kvm
|
KVM_PKG_NAME := github.com/jetkvm/kvm
|
||||||
|
|
|
@ -295,6 +295,10 @@ if (isOnDevice) {
|
||||||
path: "hardware",
|
path: "hardware",
|
||||||
element: <SettingsHardwareRoute />,
|
element: <SettingsHardwareRoute />,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "network",
|
||||||
|
element: <SettingsNetworkRoute />,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "access",
|
path: "access",
|
||||||
children: [
|
children: [
|
||||||
|
@ -350,10 +354,11 @@ if (isOnDevice) {
|
||||||
loader: DeviceIdRename.loader,
|
loader: DeviceIdRename.loader,
|
||||||
action: DeviceIdRename.action,
|
action: DeviceIdRename.action,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "devices",
|
path: "devices",
|
||||||
element: <DevicesRoute />,
|
element: <DevicesRoute />,
|
||||||
loader: DevicesRoute.loader },
|
loader: DevicesRoute.loader
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -58,9 +58,11 @@ import { SystemVersionInfo } from "./devices.$id.settings.general.update";
|
||||||
|
|
||||||
interface LocalLoaderResp {
|
interface LocalLoaderResp {
|
||||||
authMode: "password" | "noPassword" | null;
|
authMode: "password" | "noPassword" | null;
|
||||||
|
deviceId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CloudLoaderResp {
|
interface CloudLoaderResp {
|
||||||
|
deviceId: string;
|
||||||
deviceName: string;
|
deviceName: string;
|
||||||
user: User | null;
|
user: User | null;
|
||||||
iceConfig: {
|
iceConfig: {
|
||||||
|
@ -85,7 +87,7 @@ const deviceLoader = async () => {
|
||||||
if (deviceRes.status === 401) return redirect("/login-local");
|
if (deviceRes.status === 401) return redirect("/login-local");
|
||||||
if (deviceRes.ok) {
|
if (deviceRes.ok) {
|
||||||
const device = (await deviceRes.json()) as LocalDevice;
|
const device = (await deviceRes.json()) as LocalDevice;
|
||||||
return { authMode: device.authMode };
|
return { authMode: device.authMode, deviceId: device.deviceId };
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error("Error fetching device");
|
throw new Error("Error fetching device");
|
||||||
|
@ -111,7 +113,7 @@ const cloudLoader = async (params: Params<string>): Promise<CloudLoaderResp> =>
|
||||||
device: { id: string; name: string; user: { googleId: string } };
|
device: { id: string; name: string; user: { googleId: string } };
|
||||||
};
|
};
|
||||||
|
|
||||||
return { user, iceConfig, deviceName: device.name || device.id };
|
return { user, iceConfig, deviceName: device.name || device.id, deviceId: device.id };
|
||||||
};
|
};
|
||||||
|
|
||||||
const loader = async ({ params }: LoaderFunctionArgs) => {
|
const loader = async ({ params }: LoaderFunctionArgs) => {
|
||||||
|
@ -123,6 +125,7 @@ export default function KvmIdRoute() {
|
||||||
// Depending on the mode, we set the appropriate variables
|
// Depending on the mode, we set the appropriate variables
|
||||||
const user = "user" in loaderResp ? loaderResp.user : null;
|
const user = "user" in loaderResp ? loaderResp.user : null;
|
||||||
const deviceName = "deviceName" in loaderResp ? loaderResp.deviceName : null;
|
const deviceName = "deviceName" in loaderResp ? loaderResp.deviceName : null;
|
||||||
|
const deviceId = "deviceId" in loaderResp ? loaderResp.deviceId : null;
|
||||||
const iceConfig = "iceConfig" in loaderResp ? loaderResp.iceConfig : null;
|
const iceConfig = "iceConfig" in loaderResp ? loaderResp.iceConfig : null;
|
||||||
const authMode = "authMode" in loaderResp ? loaderResp.authMode : null;
|
const authMode = "authMode" in loaderResp ? loaderResp.authMode : null;
|
||||||
|
|
||||||
|
@ -788,6 +791,14 @@ export default function KvmIdRoute() {
|
||||||
setupPeerConnection,
|
setupPeerConnection,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// update the browser tab title with the name of the JetKVM we're discussing
|
||||||
|
useEffect(() => {
|
||||||
|
const name = deviceName || deviceId;
|
||||||
|
document.title = (name && name.length > 0)
|
||||||
|
? "JetKVM-" + name
|
||||||
|
: "JetKVM";
|
||||||
|
}, [deviceName, deviceId]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FeatureFlagProvider appVersion={appVersion}>
|
<FeatureFlagProvider appVersion={appVersion}>
|
||||||
{!outlet && otaState.updating && (
|
{!outlet && otaState.updating && (
|
||||||
|
|
Loading…
Reference in New Issue