-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Fabio Pinheiro <[email protected]> Signed-off-by: Shailesh Patil <[email protected]>
- Loading branch information
1 parent
5227acb
commit f6ce05c
Showing
7 changed files
with
121 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 32 additions & 25 deletions
57
mediator/src/main/scala/io/iohk/atala/mediator/app/IndexHtml.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,38 @@ | ||
package io.iohk.atala.mediator.app | ||
|
||
import zio.http.Response | ||
import zio.http._ | ||
import fmgp.did.DID | ||
|
||
object IndexHtml { | ||
// TODO use the html.Html.fromDomElement() | ||
def html(identity: DID) = Response.html(s"""<html> | ||
|<head> | ||
| <meta charset="UTF-8"> | ||
| <title>IOHK Mediator</title> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <meta name="did" content="${identity.did}"> | ||
| <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet"> | ||
| <link href="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.css" rel="stylesheet"> | ||
| <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||
| <script> | ||
| var callback = function () { | ||
| alert('A callback was triggered'); | ||
| } | ||
| </script> | ||
| <!-- My APP --> | ||
| <script type="text/javascript" src="public/webapp-fastopt-bundle.js"></script> | ||
|</head> | ||
| | ||
|<body style="margin:0;"> | ||
| <div id="app-container"></div> | ||
|</body> | ||
| | ||
|</html>""".stripMargin) | ||
def html(identity: DID) = | ||
Response( | ||
status = Status.Ok, | ||
headers = Headers(Header.ContentType(MediaType.text.html).untyped), | ||
body = Body.fromString( | ||
s"""<!DOCTYPE html> | ||
|<html> | ||
|<head> | ||
| <meta charset="UTF-8"> | ||
| <title>IOHK Mediator</title> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <meta name="did" content="${identity.did}"> | ||
| <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet"> | ||
| <link href="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.css" rel="stylesheet"> | ||
| <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | ||
| <script> | ||
| var callback = function () { | ||
| alert('A callback was triggered'); | ||
| } | ||
| </script> | ||
| <!-- My APP --> | ||
| <script type="text/javascript" src="public/webapp-fastopt-bundle.js"></script> | ||
|</head> | ||
| | ||
|<body style="margin:0;"> | ||
| <div id="app-container"></div> | ||
|</body> | ||
| | ||
|</html>""".stripMargin | ||
), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters