@@ -4,8 +4,8 @@ use serde::Serialize;
44use crate :: {
55 AppState ,
66 config:: {
7- AdminConfig , AuthMode , BrandingConfig , ChatConfig , ColorPalette , CustomFont , FontsConfig ,
8- LoginConfig , UiConfig ,
7+ AdminConfig , AdminPagesConfig , AuthMode , BrandingConfig , ChatConfig , ColorPalette ,
8+ CustomFont , FontsConfig , LoginConfig , PageConfig , PageStatus , PagesConfig , UiConfig ,
99 } ,
1010} ;
1111
@@ -17,6 +17,7 @@ pub struct UiConfigResponse {
1717 pub admin : AdminResponse ,
1818 pub auth : AuthResponse ,
1919 pub sovereignty : SovereigntyUiResponse ,
20+ pub pages : PagesResponse ,
2021}
2122
2223#[ derive( Debug , Serialize ) ]
@@ -155,6 +156,94 @@ pub struct CustomFieldDefResponse {
155156 pub description : Option < String > ,
156157}
157158
159+ #[ derive( Debug , Serialize ) ]
160+ pub struct PageConfigResponse {
161+ pub status : PageStatus ,
162+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
163+ pub notice_message : Option < String > ,
164+ }
165+
166+ #[ derive( Debug , Serialize ) ]
167+ pub struct PagesResponse {
168+ pub chat : PageConfigResponse ,
169+ pub studio : PageConfigResponse ,
170+ pub projects : PageConfigResponse ,
171+ pub teams : PageConfigResponse ,
172+ pub knowledge_bases : PageConfigResponse ,
173+ pub api_keys : PageConfigResponse ,
174+ pub providers : PageConfigResponse ,
175+ pub usage : PageConfigResponse ,
176+ pub admin : AdminPagesResponse ,
177+ }
178+
179+ #[ derive( Debug , Serialize ) ]
180+ pub struct AdminPagesResponse {
181+ pub dashboard : PageConfigResponse ,
182+ pub organizations : PageConfigResponse ,
183+ pub projects : PageConfigResponse ,
184+ pub teams : PageConfigResponse ,
185+ pub service_accounts : PageConfigResponse ,
186+ pub users : PageConfigResponse ,
187+ pub sso : PageConfigResponse ,
188+ pub session_info : PageConfigResponse ,
189+ pub api_keys : PageConfigResponse ,
190+ pub providers : PageConfigResponse ,
191+ pub provider_health : PageConfigResponse ,
192+ pub knowledge_bases : PageConfigResponse ,
193+ pub pricing : PageConfigResponse ,
194+ pub usage : PageConfigResponse ,
195+ pub audit_logs : PageConfigResponse ,
196+ pub settings : PageConfigResponse ,
197+ }
198+
199+ impl From < & PageConfig > for PageConfigResponse {
200+ fn from ( config : & PageConfig ) -> Self {
201+ Self {
202+ status : config. status ( ) . clone ( ) ,
203+ notice_message : config. notice_message ( ) . map ( String :: from) ,
204+ }
205+ }
206+ }
207+
208+ impl From < & PagesConfig > for PagesResponse {
209+ fn from ( config : & PagesConfig ) -> Self {
210+ Self {
211+ chat : PageConfigResponse :: from ( & config. chat ) ,
212+ studio : PageConfigResponse :: from ( & config. studio ) ,
213+ projects : PageConfigResponse :: from ( & config. projects ) ,
214+ teams : PageConfigResponse :: from ( & config. teams ) ,
215+ knowledge_bases : PageConfigResponse :: from ( & config. knowledge_bases ) ,
216+ api_keys : PageConfigResponse :: from ( & config. api_keys ) ,
217+ providers : PageConfigResponse :: from ( & config. providers ) ,
218+ usage : PageConfigResponse :: from ( & config. usage ) ,
219+ admin : AdminPagesResponse :: from ( & config. admin ) ,
220+ }
221+ }
222+ }
223+
224+ impl From < & AdminPagesConfig > for AdminPagesResponse {
225+ fn from ( config : & AdminPagesConfig ) -> Self {
226+ Self {
227+ dashboard : PageConfigResponse :: from ( & config. dashboard ) ,
228+ organizations : PageConfigResponse :: from ( & config. organizations ) ,
229+ projects : PageConfigResponse :: from ( & config. projects ) ,
230+ teams : PageConfigResponse :: from ( & config. teams ) ,
231+ service_accounts : PageConfigResponse :: from ( & config. service_accounts ) ,
232+ users : PageConfigResponse :: from ( & config. users ) ,
233+ sso : PageConfigResponse :: from ( & config. sso ) ,
234+ session_info : PageConfigResponse :: from ( & config. session_info ) ,
235+ api_keys : PageConfigResponse :: from ( & config. api_keys ) ,
236+ providers : PageConfigResponse :: from ( & config. providers ) ,
237+ provider_health : PageConfigResponse :: from ( & config. provider_health ) ,
238+ knowledge_bases : PageConfigResponse :: from ( & config. knowledge_bases ) ,
239+ pricing : PageConfigResponse :: from ( & config. pricing ) ,
240+ usage : PageConfigResponse :: from ( & config. usage ) ,
241+ audit_logs : PageConfigResponse :: from ( & config. audit_logs ) ,
242+ settings : PageConfigResponse :: from ( & config. settings ) ,
243+ }
244+ }
245+ }
246+
158247impl From < & UiConfig > for UiConfigResponse {
159248 fn from ( config : & UiConfig ) -> Self {
160249 Self {
@@ -165,6 +254,7 @@ impl From<&UiConfig> for UiConfigResponse {
165254 sovereignty : SovereigntyUiResponse {
166255 custom_fields : vec ! [ ] ,
167256 } ,
257+ pages : PagesResponse :: from ( & config. pages ) ,
168258 }
169259 }
170260}
0 commit comments