<commit_before><template>
  <div>

    <div class="row">
      <div class="col-xs-12">
        <div class="box">
          <div class="box-header">
            <h3 class="box-title">Users</h3>
          </div>
          <!-- /.box-header -->
          <div class="overlay" v-if="loading">
            <i class="fa fa-refresh fa-spin"></i>
          </div>
          <div class="box-body table-responsive no-padding">
            <table class="table table-hover">
              <thead>
                <tr>
                  <th>User</th>
                  <th>Domain Admin</th>
                  <th>Namespace Admin</th>
                  <th>Service Consumer</th>
                </tr>
              </thead>
              <tbody>
                <tr v-if="error">
                  <td><span class="label label-danger center">Error</span> <i class="text-red">{{ error }}</i></td>
                </tr>
                <tr v-for="roleMap, username in users">
                  <td>{{ username }}</td>
                  <td>
                    <span v-if="roleMap['domain-admin']" class="label label-success"><label class="fa fa-check"></label></span>
                  </td>
                  <td>
                    <span v-for="flag, namespace in roleMap['namespace-admin']" class="label label-primary">{{ namespace }}</span>
                  </td>
                  <td>
                    <span v-for="flag, namespace in roleMap['service-consumer']" class="label label-primary">{{ namespace }}</span>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <!-- /.box-body -->
        </div>
        <!-- /.box -->
      </div>
    </div>
    <!-- /.row -->

  </div>
</template>

<script>
  import {getUsersAndRoles} from 'lib/api.js'

  export default {
    data () {
      // empty data
      return {
        loading: false,
        users: null,
        error: null
      }
    },
    created () {
      // fetch the data when the view is created and the data is already being observed<commit_msg>correct margins in UI when user has access to multiple NS<commit_after><template>
  <div>

    <div class="row">
      <div class="col-xs-12">
        <div class="box">
          <div class="box-header">
            <h3 class="box-title">Users</h3>
          </div>
          <!-- /.box-header -->
          <div class="overlay" v-if="loading">
            <i class="fa fa-refresh fa-spin"></i>
          </div>
          <div class="box-body table-responsive no-padding">
            <table class="table table-hover">
              <thead>
                <tr>
                  <th>User</th>
                  <th>Domain Admin</th>
                  <th>Namespace Admin</th>
                  <th>Service Consumer</th>
                </tr>
              </thead>
              <tbody>
                <tr v-if="error">
                  <td><span class="label label-danger center">Error</span> <i class="text-red">{{ error }}</i></td>
                </tr>
                <tr v-for="roleMap, username in users">
                  <td>{{ username }}</td>
                  <td>
                    <span v-if="roleMap['domain-admin']" class="label label-success"><label class="fa fa-check"></label></span>
                  </td>
                  <td>
                    <span v-for="flag, namespace in roleMap['namespace-admin']" class="label label-primary" style="margin-right: 5px">{{ namespace }}</span>
                  </td>
                  <td>
                    <span v-for="flag, namespace in roleMap['service-consumer']" class="label label-primary" style="margin-right: 5px">{{ namespace }}</span>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <!-- /.box-body -->
        </div>
        <!-- /.box -->
      </div>
    </div>
    <!-- /.row -->

  </div>
</template>

<script>
  import {getUsersAndRoles} from 'lib/api.js'

  export default {
    data () {
      // empty data
      return {
        loading: false,
        users: null,
        error: null
      }
    },
    created () {
      // fetch the data when the view is created and the data is already being observed
{'fraction_non_alphanumeric': 0.16422840962718263, 'fraction_numerical': 0.0023596035865974517, 'mean_word_length': 1.292590589507842, 'pattern_counts': {'":': 0, '<': 137, '<?xml version=': 0, '>': 137, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3618954', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1166, 'n_words': 283}