github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/stories/components/log-stream.stories.js (about)

     1  import hbs from 'htmlbars-inline-precompile';
     2  
     3  export default {
     4    title: 'Components|Log Stream',
     5  };
     6  
     7  export let LogStream = () => {
     8    return {
     9      template: hbs`
    10        <h5 class="title is-5">Log stream</h5>
    11        <div class="boxed-section">
    12          <div class="boxed-section-head">
    13            <span>
    14              <button
    15                class="button {{if (eq mode1 "stdout") "is-info"}}"
    16                onclick={{action (mut mode1) "stdout"}}>stdout</button>
    17              <button
    18                class="button {{if (eq mode1 "stderr") "is-danger"}}"
    19                onclick={{action (mut mode1) "stderr"}}>stderr</button>
    20            </span>
    21            <span class="pull-right">
    22              <button class="button is-white">Head</button>
    23              <button class="button is-white">Tail</button>
    24              <button class="button is-white" onclick={{toggle "isPlaying1" this}}>
    25                {{x-icon (if isPlaying1 "media-play" "media-pause") class="is-text"}}
    26              </button>
    27            </span>
    28          </div>
    29          <div class="boxed-section-body is-dark is-full-bleed">
    30            <pre class="cli-window"><code>{{if (eq mode1 "stdout") sampleOutput sampleError}}</code></pre>
    31          </div>
    32        </div>
    33        `,
    34      context: {
    35        mode1: 'stdout',
    36        isPlaying1: true,
    37  
    38        sampleOutput: `Sample output
    39  > 1
    40  > 2
    41  > 3
    42  [00:12:58] Log output here
    43  [00:15:29] [ERR] Uh oh
    44  Loading.
    45  Loading..
    46  Loading...
    47  
    48    >> Done! <<
    49  
    50      `,
    51  
    52        sampleError: `Sample error
    53  
    54  [====|--------------------] 20%
    55  
    56  !!! Unrecoverable error:
    57  
    58    Cannot continue beyond this point. Exception should be caught.
    59    This is not a mistake. You did something wrong. Check the code.
    60    No, you will not receive any more details or guidance from this
    61    error message.
    62  
    63      `,
    64      },
    65    };
    66  };