@@ -19,145 +19,155 @@ import { WorkspaceBuildPage } from "./pages/WorkspaceBuildPage/WorkspaceBuildPag
19
19
import { WorkspacePage } from "./pages/WorkspacePage/WorkspacePage"
20
20
import { WorkspaceSchedulePage } from "./pages/WorkspaceSchedulePage/WorkspaceSchedulePage"
21
21
22
+ const WorkspaceAppErrorPage = lazy ( ( ) => import ( "./pages/WorkspaceAppErrorPage/WorkspaceAppErrorPage" ) )
22
23
const TerminalPage = lazy ( ( ) => import ( "./pages/TerminalPage/TerminalPage" ) )
23
24
const WorkspacesPage = lazy ( ( ) => import ( "./pages/WorkspacesPage/WorkspacesPage" ) )
24
25
const CreateWorkspacePage = lazy ( ( ) => import ( "./pages/CreateWorkspacePage/CreateWorkspacePage" ) )
25
26
26
27
export const AppRouter : FC = ( ) => (
27
28
< Suspense fallback = { < > </ > } >
28
29
< Routes >
29
- < Route path = "/" >
30
+ < Route
31
+ index
32
+ element = {
33
+ < RequireAuth >
34
+ < IndexPage />
35
+ </ RequireAuth >
36
+ }
37
+ />
38
+
39
+ < Route path = "login" element = { < LoginPage /> } />
40
+ < Route path = "healthz" element = { < HealthzPage /> } />
41
+ < Route
42
+ path = "cli-auth"
43
+ element = {
44
+ < RequireAuth >
45
+ < CliAuthenticationPage />
46
+ </ RequireAuth >
47
+ }
48
+ />
49
+
50
+ < Route path = "workspaces" >
30
51
< Route
31
52
index
32
53
element = {
33
- < RequireAuth >
34
- < IndexPage />
35
- </ RequireAuth >
54
+ < AuthAndFrame >
55
+ < WorkspacesPage />
56
+ </ AuthAndFrame >
36
57
}
37
58
/>
38
59
39
- < Route path = "login" element = { < LoginPage /> } />
40
- < Route path = "healthz" element = { < HealthzPage /> } />
41
60
< Route
42
- path = "cli-auth "
61
+ path = "new "
43
62
element = {
44
63
< RequireAuth >
45
- < CliAuthenticationPage />
64
+ < CreateWorkspacePage />
46
65
</ RequireAuth >
47
66
}
48
67
/>
49
68
50
- < Route path = "workspaces " >
69
+ < Route path = ":workspace " >
51
70
< Route
52
71
index
53
72
element = {
54
73
< AuthAndFrame >
55
- < WorkspacesPage />
74
+ < WorkspacePage />
56
75
</ AuthAndFrame >
57
76
}
58
77
/>
59
-
60
78
< Route
61
- path = "new "
79
+ path = "schedule "
62
80
element = {
63
81
< RequireAuth >
64
- < CreateWorkspacePage />
82
+ < WorkspaceSchedulePage />
65
83
</ RequireAuth >
66
84
}
67
85
/>
68
-
69
- < Route path = ":workspace" >
70
- < Route
71
- index
72
- element = {
73
- < AuthAndFrame >
74
- < WorkspacePage />
75
- </ AuthAndFrame >
76
- }
77
- />
78
- < Route
79
- path = "schedule"
80
- element = {
81
- < RequireAuth >
82
- < WorkspaceSchedulePage />
83
- </ RequireAuth >
84
- }
85
- />
86
- </ Route >
87
86
</ Route >
87
+ </ Route >
88
88
89
- < Route path = "templates" >
90
- < Route
91
- index
92
- element = {
93
- < AuthAndFrame >
94
- < TemplatesPage />
95
- </ AuthAndFrame >
96
- }
97
- />
89
+ < Route path = "templates" >
90
+ < Route
91
+ index
92
+ element = {
93
+ < AuthAndFrame >
94
+ < TemplatesPage />
95
+ </ AuthAndFrame >
96
+ }
97
+ />
98
98
99
- < Route
100
- path = ":template"
101
- element = {
102
- < AuthAndFrame >
103
- < TemplatePage />
104
- </ AuthAndFrame >
105
- }
106
- />
107
- </ Route >
99
+ < Route
100
+ path = ":template"
101
+ element = {
102
+ < AuthAndFrame >
103
+ < TemplatePage />
104
+ </ AuthAndFrame >
105
+ }
106
+ />
107
+ </ Route >
108
108
109
- < Route path = "users" >
110
- < Route
111
- index
112
- element = {
113
- < AuthAndFrame >
114
- < UsersPage />
115
- </ AuthAndFrame >
116
- }
117
- />
109
+ < Route path = "users" >
110
+ < Route
111
+ index
112
+ element = {
113
+ < AuthAndFrame >
114
+ < UsersPage />
115
+ </ AuthAndFrame >
116
+ }
117
+ />
118
+ < Route
119
+ path = "create"
120
+ element = {
121
+ < RequireAuth >
122
+ < CreateUserPage />
123
+ </ RequireAuth >
124
+ }
125
+ />
126
+ </ Route >
127
+
128
+ < Route path = "settings" element = { < SettingsLayout /> } >
129
+ < Route path = "account" element = { < AccountPage /> } />
130
+ < Route path = "security" element = { < SecurityPage /> } />
131
+ < Route path = "ssh-keys" element = { < SSHKeysPage /> } />
132
+ </ Route >
133
+
134
+ < Route
135
+ path = "builds/:buildId"
136
+ element = {
137
+ < AuthAndFrame >
138
+ < WorkspaceBuildPage />
139
+ </ AuthAndFrame >
140
+ }
141
+ />
142
+
143
+ < Route path = "/@:username" >
144
+ < Route path = ":workspace" >
118
145
< Route
119
- path = "create "
146
+ path = "terminal "
120
147
element = {
121
148
< RequireAuth >
122
- < CreateUserPage />
149
+ < TerminalPage />
123
150
</ RequireAuth >
124
151
}
125
152
/>
126
- </ Route >
127
153
128
- < Route path = "settings" element = { < SettingsLayout /> } >
129
- < Route path = "account" element = { < AccountPage /> } />
130
- < Route path = "security" element = { < SecurityPage /> } />
131
- < Route path = "ssh-keys" element = { < SSHKeysPage /> } />
132
- </ Route >
133
-
134
- < Route path = ":username" >
135
- < Route path = ":workspace" >
154
+ < Route path = "apps" >
136
155
< Route
137
- path = "terminal "
156
+ path = ":app/* "
138
157
element = {
139
- < RequireAuth >
140
- < TerminalPage />
141
- </ RequireAuth >
158
+ < AuthAndFrame >
159
+ < WorkspaceAppErrorPage />
160
+ </ AuthAndFrame >
142
161
}
143
162
/>
144
163
</ Route >
145
164
</ Route >
165
+ </ Route >
146
166
147
- < Route
148
- path = "builds/:buildId"
149
- element = {
150
- < AuthAndFrame >
151
- < WorkspaceBuildPage />
152
- </ AuthAndFrame >
153
- }
154
- />
155
-
156
- { /* Using path="*"" means "match anything", so this route
167
+ { /* Using path="*"" means "match anything", so this route
157
168
acts like a catch-all for URLs that we don't have explicit
158
169
routes for. */ }
159
- < Route path = "*" element = { < NotFoundPage /> } />
160
- </ Route >
170
+ < Route path = "*" element = { < NotFoundPage /> } />
161
171
</ Routes >
162
172
</ Suspense >
163
173
)
0 commit comments