|
263 | 263 | } |
264 | 264 | </div> |
265 | 265 |
|
266 | | -@code{ |
267 | | - |
268 | | - static List<string> roleList = new() |
| 266 | +@code{ |
| 267 | + |
| 268 | + static List<string> roleList = new() |
269 | 269 | { |
270 | 270 | "Anonym", "Isabelle", "Steven", "Albert" |
271 | 271 | }; |
272 | 272 |
|
273 | | - static string _role = roleList[ 0 ]; |
274 | | - static string _input = string.Empty; |
275 | | - static string _watchText = string.Empty; |
276 | | - static string _path = string.Empty; |
277 | | - static bool _loading; |
278 | | - static bool _edit; |
279 | | - |
280 | | -//TODO: code duplication with Pcf2.razor |
281 | | - static string getAasLink(IIdentifiable aas) |
282 | | - { |
283 | | - string endpoint = null; |
284 | | - var idEncoded = Base64UrlEncoder.Encode(aas.Id); |
285 | | - if (aas.Extensions != null) |
286 | | - { |
287 | | - endpoint = aas.Extensions[ 0 ].Value; |
288 | | - } |
289 | | - else |
290 | | - { |
291 | | - endpoint = Program.externalBlazor + "/shells/" + idEncoded; |
292 | | - } |
293 | | - |
294 | | - return endpoint; |
295 | | - } |
296 | | - |
297 | | - string getIframePath() |
298 | | - { |
299 | | - var link = ""; |
300 | | - //get the admin shell of the cabinet |
301 | | - foreach (var env in AasxServer.Program.env) |
302 | | - { |
303 | | - if (env != null) |
304 | | - { |
305 | | - var queryPara = ""; |
306 | | - var userPW = ""; |
307 | | - var urlEdcWrapper = ""; |
308 | | - string replace = ""; |
309 | | - |
310 | | - var aas = env.AasEnv.AssetAdministrationShells[ 0 ]; |
311 | | - if (aas.IdShort != "ZveiControlCabinetAas - EXTERNAL") |
312 | | - continue; |
313 | | - |
314 | | - link = getAasLink(aas); |
315 | | - |
316 | | - var registry = AasRegistryService.GetRegistryList(); |
317 | | - if (registry != null && registry.Count != 0) |
318 | | - { |
319 | | - string registryURL = registry[ 0 ]; |
320 | | - |
321 | | - if (AasxCredentials.get(AasxTaskService, cs.credentials, registryURL, out queryPara, out userPW, out urlEdcWrapper, out replace, true)) |
322 | | - { |
323 | | - if (replace != "") |
324 | | - registryURL = replace; |
325 | | - } |
326 | | - |
327 | | - link += "®istryURL=" + registryURL; |
328 | | - } |
| 273 | + static string _role = roleList[ 0 ]; |
| 274 | + static string _input = string.Empty; |
| 275 | + static string _watchText = string.Empty; |
| 276 | + static string _path = string.Empty; |
| 277 | + static bool _loading; |
| 278 | + static bool _edit; |
| 279 | + |
| 280 | + //TODO: code duplication with Pcf2.razor |
| 281 | + static string getAasLink(IIdentifiable aas) |
| 282 | + { |
| 283 | + string endpoint = null; |
| 284 | + var idEncoded = Base64UrlEncoder.Encode(aas.Id); |
| 285 | + if (aas.Extensions != null) |
| 286 | + { |
| 287 | + endpoint = aas.Extensions[ 0 ].Value; |
| 288 | + } |
| 289 | + else |
| 290 | + { |
| 291 | + endpoint = Program.externalBlazor + "/shells/" + idEncoded; |
| 292 | + } |
| 293 | + |
| 294 | + return endpoint; |
| 295 | + } |
| 296 | + |
| 297 | + string getIframePath() |
| 298 | + { |
| 299 | + var link = ""; |
| 300 | + //get the admin shell of the cabinet |
| 301 | + foreach (var env in AasxServer.Program.env) |
| 302 | + { |
| 303 | + if (env != null) |
| 304 | + { |
| 305 | + var queryPara = ""; |
| 306 | + var userPW = ""; |
| 307 | + var urlEdcWrapper = ""; |
| 308 | + string replace = ""; |
| 309 | + |
| 310 | + var aas = env.AasEnv.AssetAdministrationShells[ 0 ]; |
| 311 | + if (aas.IdShort != "ZveiControlCabinetAas - EXTERNAL") |
| 312 | + continue; |
| 313 | + |
| 314 | + link = getAasLink(aas); |
| 315 | + |
| 316 | + var registry = AasRegistryService.GetRegistryList(); |
| 317 | + if (registry != null && registry.Count != 0) |
| 318 | + { |
| 319 | + string registryURL = registry[0]; |
| 320 | + |
| 321 | + if (registryURL.EndsWith("/shell-descriptors")) |
| 322 | + { |
| 323 | + registryURL = registryURL.Substring(0, registryURL.Length - "/shell-descriptors".Length); |
| 324 | + } |
| 325 | + |
| 326 | + if (AasxCredentials.get(AasxTaskService, cs.credentials, registryURL, out queryPara, out userPW, out urlEdcWrapper, out replace, true)) |
| 327 | + { |
| 328 | + if (replace != "") |
| 329 | + registryURL = replace; |
| 330 | + } |
| 331 | + |
| 332 | + link += "®istryURL=" + registryURL; |
| 333 | + } |
329 | 334 |
|
330 | 335 | queryPara = ""; |
331 | 336 | userPW = ""; |
|
0 commit comments