Skip to content

Commit 7a6c4db

Browse files
Merge pull request #2472 from FarmBot/staging
v15.10.2
2 parents 8190f94 + 57a71cd commit 7a6c4db

File tree

12 files changed

+103
-60
lines changed

12 files changed

+103
-60
lines changed

app/views/dashboard/promo.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
}
66
body {
77
margin: 0;
8+
background-image: url("/placeholder_farmbot.jpg");
89
}
910
</style>
11+
<h1 class="initial-loading-text">Loading...</h1>

example.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# If your server is on a domain (eg=my-own-farmbot.com), put it here.
1414
# DONT USE `localhost`, `127.0.0.1`, or `0.0.0.0`.
1515
# Use a real IP address or domain name.
16+
# For a local install, find your IP with `hostname -I` on Linux or `ipconfig getifaddr en0` on Mac.
1617
API_HOST=
1718

1819
# 3000 for local development. 443 is using SSL.
@@ -51,6 +52,7 @@ NO_EMAILS=TRUE
5152
# If you wish to opt out of https, delete this line.
5253
# NOTE: By not using SSL, passwords will be transmitted without encryption,
5354
# making it very easy for attackers to see them.
55+
# Comment out or delete for local installs.
5456
FORCE_SSL=TRUE
5557

5658

frontend/css/farm_designer/farm_designer.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,7 @@
12681268
padding: 1rem;
12691269
overflow-x: scroll;
12701270
background: linear-gradient(0deg, $translucent5, transparent);
1271+
scrollbar-width: none;
12711272

12721273
@media screen and (max-width: 768px) {
12731274
justify-content: left;

frontend/farm_designer/three_d_garden_map.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const ThreeDGardenMap = (props: ThreeDGardenMapProps) => {
1717
config.botSizeY = gridSize.y;
1818
config.bedWidthOuter = gridSize.y + 160;
1919
config.bedLengthOuter = gridSize.x + 160;
20+
config.zoomBeacons = false;
2021

2122
return <ThreeDGarden config={config} />;
2223
};

frontend/promo/promo.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export const Promo = () => {
1818
config, setConfig,
1919
toolTip, setToolTip,
2020
activeFocus, setActiveFocus,
21-
showBeacons: true,
2221
};
2322

2423
React.useEffect(() => {

frontend/three_d_garden/__tests__/garden_test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ describe("<GardenModel />", () => {
1414
config: clone(INITIAL),
1515
activeFocus: "",
1616
setActiveFocus: jest.fn(),
17-
showBeacons: true,
1817
});
1918

2019
it("renders", () => {

frontend/three_d_garden/config.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export interface Config {
5454
xyDimensions: boolean;
5555
zDimension: boolean;
5656
promoInfo: boolean;
57+
settingsBar: boolean;
58+
zoomBeacons: boolean;
5759
solar: boolean;
5860
utilitiesPost: boolean;
5961
packaging: boolean;
@@ -123,6 +125,8 @@ export const INITIAL: Config = {
123125
xyDimensions: false,
124126
zDimension: false,
125127
promoInfo: true,
128+
settingsBar: true,
129+
zoomBeacons: true,
126130
solar: false,
127131
utilitiesPost: true,
128132
packaging: false,
@@ -152,9 +156,9 @@ export const BOOLEAN_KEYS = [
152156
"legsFlush", "labels", "labelsOnHover", "ground", "grid", "axes", "trail",
153157
"tracks", "clouds", "perspective", "bot", "laser", "cableCarriers",
154158
"viewCube", "stats", "config", "zoom", "pan", "bounds", "threeAxes",
155-
"xyDimensions", "zDimension", "promoInfo", "solar", "utilitiesPost",
156-
"packaging", "lab", "people", "lowDetail", "eventDebug", "cableDebug",
157-
"zoomBeaconDebug", "animate",
159+
"xyDimensions", "zDimension", "promoInfo", "settingsBar", "zoomBeacons",
160+
"solar", "utilitiesPost", "packaging", "lab", "people", "lowDetail",
161+
"eventDebug", "cableDebug", "zoomBeaconDebug", "animate",
158162
];
159163

160164
export const PRESETS: Record<string, Config> = {
@@ -259,6 +263,8 @@ export const PRESETS: Record<string, Config> = {
259263
xyDimensions: false,
260264
zDimension: false,
261265
promoInfo: false,
266+
settingsBar: false,
267+
zoomBeacons: false,
262268
solar: false,
263269
utilitiesPost: false,
264270
packaging: false,
@@ -308,6 +314,8 @@ export const PRESETS: Record<string, Config> = {
308314
xyDimensions: true,
309315
zDimension: true,
310316
promoInfo: true,
317+
settingsBar: true,
318+
zoomBeacons: true,
311319
solar: true,
312320
utilitiesPost: true,
313321
packaging: true,
@@ -335,9 +343,10 @@ const OTHER_CONFIG_KEYS: (keyof Config)[] = [
335343
"bedBrightness", "soilBrightness", "plants", "labels", "ground", "grid", "axes",
336344
"trail", "clouds", "sunInclination", "sunAzimuth", "perspective", "bot", "laser",
337345
"tool", "cableCarriers", "viewCube", "stats", "config", "zoom", "bounds",
338-
"threeAxes", "xyDimensions", "zDimension", "labelsOnHover", "promoInfo", "pan",
339-
"solar", "utilitiesPost", "packaging", "lab", "people", "scene", "lowDetail",
340-
"eventDebug", "cableDebug", "zoomBeaconDebug", "animate",
346+
"threeAxes", "xyDimensions", "zDimension", "labelsOnHover", "promoInfo",
347+
"settingsBar", "zoomBeacons", "pan", "solar", "utilitiesPost", "packaging", "lab",
348+
"people", "scene", "lowDetail", "eventDebug", "cableDebug", "zoomBeaconDebug",
349+
"animate",
341350
];
342351

343352
export const modifyConfig = (config: Config, update: Partial<Config>) => {

frontend/three_d_garden/config_overlays.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const PublicOverlay = (props: OverlayProps) => {
6464
};
6565

6666
return <div className={"overlay"}>
67-
{!props.activeFocus &&
67+
{config.settingsBar && !props.activeFocus &&
6868
<div className={"settings-bar"}>
6969
<Section
7070
title={"FarmBot"}
@@ -271,6 +271,8 @@ export const PrivateOverlay = (props: OverlayProps) => {
271271
onChange={e => setParamAdd(e.target.checked)} />
272272
</div>
273273
<Toggle {...common} configKey={"promoInfo"} />
274+
<Toggle {...common} configKey={"settingsBar"} />
275+
<Toggle {...common} configKey={"zoomBeacons"} />
274276
<label>{"Presets"}</label>
275277
<Radio {...common} configKey={"sizePreset"}
276278
options={["Jr", "Genesis", "Genesis XL"]} />

frontend/three_d_garden/distance_indicator.tsx

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ import { ASSETS } from "./constants";
44
import { Arrow } from "./arrow";
55
import { Group, MeshPhongMaterial } from "./components";
66

7+
enum BoxDimension {
8+
width = 300,
9+
height = 100,
10+
depth = 75,
11+
}
12+
13+
const depthOffset = BoxDimension.depth / 2 + 0.5;
14+
const heightOffset = BoxDimension.height / 2 + 0.5;
15+
16+
interface Label {
17+
position: [number, number, number];
18+
rotation: [number, number, number];
19+
}
20+
21+
const LABELS: Label[] = [
22+
{ position: [0, 0, depthOffset], rotation: [0 * Math.PI / 2, 0, 0] },
23+
{ position: [0, -heightOffset, 0], rotation: [1 * Math.PI / 2, 0, 0] },
24+
{ position: [0, 0, -depthOffset], rotation: [2 * Math.PI / 2, 0, 0] },
25+
{ position: [0, heightOffset, 0], rotation: [3 * Math.PI / 2, 0, 0] },
26+
];
27+
728
export interface DistanceIndicatorProps {
829
start: Record<"x" | "y" | "z", number>;
930
end: Record<"x" | "y" | "z", number>;
@@ -28,20 +49,22 @@ export const DistanceIndicator = (props: DistanceIndicatorProps) => {
2849
<Arrow length={distance / 2} width={25} rotation={[0, 0, Math.PI]} />
2950
<Group rotation={[Math.PI / 6, 0, 0]}>
3051
<Box
31-
args={[300, 100, 75]}
52+
args={[BoxDimension.width, BoxDimension.height, BoxDimension.depth]}
3253
receiveShadow={true}>
3354
<MeshPhongMaterial color={"#c49f7a"} />
3455
</Box>
35-
<Text name={"distance-label"}
36-
fontSize={50}
37-
font={ASSETS.fonts.cabinBold}
38-
color={"black"}
39-
strokeColor={"black"}
40-
strokeWidth={7}
41-
fontWeight={"bold"}
42-
position={[0, 0, 38]}>
43-
{distance.toFixed(0)}mm
44-
</Text>
56+
{LABELS.map(({ position, rotation }) =>
57+
<Text name={"distance-label"}
58+
fontSize={50}
59+
font={ASSETS.fonts.cabinBold}
60+
color={"black"}
61+
strokeColor={"black"}
62+
strokeWidth={7}
63+
fontWeight={"bold"}
64+
rotation={rotation}
65+
position={position}>
66+
{distance.toFixed(0)}mm
67+
</Text>)}
4568
</Group>
4669
</Group>;
4770
};

frontend/three_d_garden/garden.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export interface GardenModelProps {
2929
config: Config;
3030
activeFocus: string;
3131
setActiveFocus(focus: string): void;
32-
showBeacons: boolean;
3332
}
3433

3534
interface Plant {
@@ -176,7 +175,7 @@ export const GardenModel = (props: GardenModelProps) => {
176175
? e => console.log(e.intersections.map(x => x.object.name))
177176
: undefined}>
178177
{config.stats && <Stats />}
179-
{props.showBeacons && <ZoomBeacons
178+
{config.zoomBeacons && <ZoomBeacons
180179
config={config}
181180
activeFocus={props.activeFocus}
182181
setActiveFocus={props.setActiveFocus} />}

0 commit comments

Comments
 (0)