-
Notifications
You must be signed in to change notification settings - Fork 83
chore: Allow multiple environment logins, new desktop authentication storage, pool configuration, swap environment support. #7714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e224766
8f2a239
fb8acbe
7993b5f
195000b
529c619
74f6e33
eba91e8
d3aa09a
23e6094
aa460d6
01d294a
e5d1cd8
14a7234
693fd8e
8dc1b15
bab98ab
3929f2e
b97bcde
e7559c1
9a5bcb3
dc75b72
d0be5c1
e1dfa80
9aec7e4
d173fc5
7d87ba1
ed32985
05afda5
37af15d
bc717e4
c559969
33fb889
3533143
c032988
25d53f5
4e88300
84d441a
6cd59b4
57da5f9
1290e8f
293ddba
cce275f
55ebb74
3d509eb
ff851ba
726e4be
abf7979
511a3a9
1c2f20a
26e1092
8a7203d
3e27110
dce24d1
36987ce
263f4b4
2d8fdb5
3bb6c69
3853ef2
92b10e5
2425ae1
de3de30
ef4c208
fa82f65
866b622
b31517c
0d5dcfe
bedb8c2
582e76c
631b670
6e132c2
fa05e26
ed8b655
35330b6
923e319
f825a4f
e457d29
fb5884a
7729f79
2c3f364
4190314
fa1a773
44c227f
4a1bbb4
2ae5027
d5eb888
8de5532
37e6ac3
cd49e83
4822ef5
2d1807e
5e82d59
aed7eee
b6c5291
ca1fce5
47e6a07
8908e2a
29f161a
100cb17
39c2418
54152cd
8c6629c
b725668
0607e7d
f6e7465
232c2b7
9b48ead
5e4e647
1bb0e6a
a128cda
8595a24
6e169bf
6ea897b
878383e
03ecae3
92c6d51
02a4ab3
0aa5b06
a9c7460
1949dda
da50f8c
7289cce
fe52cce
acdbc4f
460a461
a94aa5a
09665d9
06a9854
2f2f4ff
a27373d
6ff0662
984606a
adce7fa
a49a842
a22083c
ebfe8f5
0c39528
8227e7f
99be28d
c053292
07efce7
a9ae3e3
6cbff9d
2220954
572c2e9
669921b
36dffd1
650c1e5
a5b36c5
1f09c3c
2805c9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
NODE_ENV=production | ||
|
||
# App | ||
VITE_KITTYCAD_API_BASE_URL=https://api.zoo.dev | ||
VITE_KITTYCAD_API_WEBSOCKET_URL=wss://api.zoo.dev/ws/modeling/commands | ||
VITE_KITTYCAD_SITE_BASE_URL=https://zoo.dev | ||
VITE_KITTYCAD_SITE_APP_URL=https://app.zoo.dev | ||
VITE_KITTYCAD_BASE_DOMAIN=zoo.dev |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import { ActionButton } from '@src/components/ActionButton' | ||
import { commandBarActor } from '@src/lib/singletons' | ||
import env from '@src/env' | ||
import { writeEnvironmentConfigurationPool } from '@src/lib/desktop' | ||
import { reportRejection } from '@src/lib/trap' | ||
|
||
export function EnvironmentChip() { | ||
const shorthand = env().VITE_KITTYCAD_BASE_DOMAIN | ||
const pool = env().POOL | ||
return ( | ||
<div className="flex items-center px-2 py-1 text-xs text-chalkboard-80 dark:text-chalkboard-30 rounded-none border-none hover:bg-chalkboard-30 dark:hover:bg-chalkboard-80 focus:bg-chalkboard-30 dark:focus:bg-chalkboard-80 hover:text-chalkboard-100 dark:hover:text-chalkboard-10 focus:text-chalkboard-100 dark:focus:text-chalkboard-10 focus:outline-none focus-visible:ring-2 focus:ring-primary focus:ring-opacity-50"> | ||
<span className=""> | ||
{shorthand} {pool ? `+ Pool` : ''} | ||
</span> | ||
</div> | ||
) | ||
} | ||
|
||
export function EnvironmentDescription() { | ||
const fullEnvironmentName = env().VITE_KITTYCAD_BASE_DOMAIN | ||
return ( | ||
<div className="absolute left-2 bottom-full mb-1 flex-col gap-1 align-stretch bg-chalkboard-10 dark:bg-chalkboard-90 rounded shadow-lg border border-solid border-chalkboard-20/50 dark:border-chalkboard-80/50 text-sm"> | ||
<div | ||
className={`flex flex-col p-2 mb-2 rounded-t-sm bg-chalkboard-20 text-chalkboard-100`} | ||
> | ||
<p className="flex flex-row justify-between"> | ||
<h2 className="text-sm font-sans font-normal">Environment</h2> | ||
Check warning on line 27 in src/components/environment/Environment.tsx
|
||
<p | ||
data-testid="environment" | ||
className="text-xs rounded-sm flex flex-row items-center" | ||
> | ||
<ActionButton | ||
Element="button" | ||
onClick={() => { | ||
const environment = env().VITE_KITTYCAD_BASE_DOMAIN | ||
if (environment) { | ||
commandBarActor.send({ | ||
type: 'Find and select command', | ||
data: { | ||
groupId: 'application', | ||
name: 'switch-environments', | ||
argDefaultValues: { | ||
environment, | ||
}, | ||
}, | ||
}) | ||
} | ||
}} | ||
iconEnd={{ icon: 'sketch', bgClassName: '!bg-transparent' }} | ||
className="ml-1 pr-0" | ||
> | ||
{fullEnvironmentName} | ||
</ActionButton> | ||
</p> | ||
</p> | ||
</div> | ||
<ul> | ||
<li className="flex flex-col px-2 py-2 gap-1 last:mb-0 "> | ||
<p className="text-chalkboard-100">API</p>{' '} | ||
Check warning on line 59 in src/components/environment/Environment.tsx
|
||
<p className="text-chalkboard-60"> | ||
{env().VITE_KITTYCAD_API_BASE_URL} | ||
</p> | ||
</li> | ||
<li className="flex flex-col px-2 py-2 gap-1 last:mb-0 "> | ||
<p className="text-chalkboard-100">Site</p>{' '} | ||
Check warning on line 65 in src/components/environment/Environment.tsx
|
||
<p className="text-chalkboard-60"> | ||
{env().VITE_KITTYCAD_SITE_BASE_URL} | ||
</p> | ||
</li> | ||
<li className="flex flex-col px-2 py-2 gap-1 last:mb-0 "> | ||
<p className="text-chalkboard-100">WebSocket (real-time-data)</p>{' '} | ||
Check warning on line 71 in src/components/environment/Environment.tsx
|
||
<p className="text-chalkboard-60"> | ||
{env().VITE_KITTYCAD_API_WEBSOCKET_URL} | ||
</p> | ||
</li> | ||
<li className="flex flex-col px-2 py-2 gap-1 last:mb-0 "> | ||
<p className="text-chalkboard-100">Connection Pool</p>{' '} | ||
Check warning on line 77 in src/components/environment/Environment.tsx
|
||
pierremtb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<p className="text-chalkboard-60 flex flex-row justify-between"> | ||
<span>{env().POOL || 'Auto'}</span> | ||
<div className="flex flex-row gap-1"> | ||
<ActionButton | ||
Element="button" | ||
onClick={() => { | ||
commandBarActor.send({ | ||
type: 'Find and select command', | ||
data: { | ||
groupId: 'application', | ||
name: 'choose-pool', | ||
argDefaultValues: { | ||
pool: env().POOL, | ||
}, | ||
}, | ||
}) | ||
}} | ||
> | ||
<span className="py-2 lg:py-0">Edit</span> | ||
Check warning on line 96 in src/components/environment/Environment.tsx
|
||
</ActionButton> | ||
{env().POOL !== '' && ( | ||
<ActionButton | ||
onClick={() => { | ||
const environment = env().VITE_KITTYCAD_BASE_DOMAIN | ||
if (environment) { | ||
writeEnvironmentConfigurationPool(environment, '') | ||
.then(() => { | ||
window.location.reload() | ||
}) | ||
.catch(reportRejection) | ||
} | ||
}} | ||
Element="button" | ||
> | ||
<span className="py-2 lg:py-0">Clear</span> | ||
Check warning on line 112 in src/components/environment/Environment.tsx
|
||
</ActionButton> | ||
)} | ||
</div> | ||
</p> | ||
</li> | ||
</ul> | ||
</div> | ||
) | ||
} |
Uh oh!
There was an error while loading. Please reload this page.