mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-24 09:18:27 +00:00
Lots of work on the vtabbar UI / UX to make it work and integrate into the Wave UI Lots of work on the workspace-layout-model to handle *two* resizable panels.
53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
// Copyright 2026, Command Line Inc.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
export const PlatformMacOS = "darwin";
|
|
export const PlatformWindows = "win32";
|
|
export const PlatformLinux = "linux";
|
|
export let PLATFORM: NodeJS.Platform = PlatformMacOS;
|
|
export let MacOSVersion: string = null;
|
|
|
|
export function setPlatform(platform: NodeJS.Platform) {
|
|
PLATFORM = platform;
|
|
}
|
|
|
|
export function setMacOSVersion(version: string) {
|
|
MacOSVersion = version;
|
|
}
|
|
|
|
export function isMacOSTahoeOrLater(): boolean {
|
|
if (!isMacOS() || MacOSVersion == null) {
|
|
return false;
|
|
}
|
|
const major = parseInt(MacOSVersion.split(".")[0], 10);
|
|
return major >= 16;
|
|
}
|
|
|
|
export function isMacOS(): boolean {
|
|
return PLATFORM == PlatformMacOS;
|
|
}
|
|
|
|
export function isWindows(): boolean {
|
|
return PLATFORM == PlatformWindows;
|
|
}
|
|
|
|
export function makeNativeLabel(isDirectory: boolean) {
|
|
let managerName: string;
|
|
if (!isDirectory) {
|
|
managerName = "Default Application";
|
|
} else if (PLATFORM === PlatformMacOS) {
|
|
managerName = "Finder";
|
|
} else if (PLATFORM == PlatformWindows) {
|
|
managerName = "Explorer";
|
|
} else {
|
|
managerName = "File Manager";
|
|
}
|
|
|
|
let fileAction: string;
|
|
if (isDirectory) {
|
|
fileAction = "Reveal";
|
|
} else {
|
|
fileAction = "Open File";
|
|
}
|
|
return `${fileAction} in ${managerName}`;
|
|
}
|