github.com/ijc/docker-app@v0.6.1-0.20181012090447-c7ca8bc483fb/pkg/yatee/gopher/yatee.html (about)

     1  <html>
     2  <head>
     3  <script language="javascript" src="gopher.js"></script>
     4  <script language="javascript">
     5  function compute() {
     6    t = document.getElementById('itemplate').value
     7    s = document.getElementById('isettings').value
     8    r = yatee.ProcessJS(t, s)
     9    res = r[0]
    10    if (!res) {
    11      res = "<font color='red'>" + r[1] + "</font>"
    12    }
    13    document.getElementById('iresult').innerHTML = res
    14  }
    15  
    16  </script>
    17  </head>
    18  <body>
    19  Test <a href="http://github.com/docker/yatee">yatee</a> in your browser.
    20  <br/>
    21  Input template <br/>
    22  <textarea id="itemplate" rows=20 cols=80>
    23  version: "3.4"
    24  services:
    25    "@for i in 0..2":
    26      replica$i:
    27        image: superduperserver:latest
    28        command: /run $i
    29        port:
    30          - $(5000 + ($i*2))
    31          - $(5001 + ($i * 2))
    32    "@if ${myapp.debug}":
    33      debugger:
    34        image: debug
    35    "@if ! ${myapp.debug}":
    36      monitor:
    37       image: monitor
    38    "@for i in $myapp.services":
    39      "$i":
    40         image: $i:latest
    41  </textarea>
    42  <textarea id="isettings" rows=20 cols=80>
    43  myapp:
    44    debug: false
    45    services:
    46    - nginx
    47    - redis
    48  </textarea>
    49  <br/>
    50  <input type=submit onclick="javascript:compute()"></input>
    51  <br/>
    52  Result:
    53  <pre><div id="iresult"></div></pre>
    54  </body>
    55  </html>