<commit_before><style lang="scss">

$lefyNavWidth: 240px;

.app-container {
  .left-nav {
    position: fixed;
    width: $lefyNavWidth;
    height: 100%;
    padding-top: 12px;
    background: #263238;
    z-index: 1;
    overflow: hidden;
    overflow-x: hidden;
    overflow-y: auto;
    .user-avatar {
      width: 64px;
      height: 64px;
      background: #ededed;
    }
    .username-btn {
      width: 100%;
      background: none;
      border: none;
      color: #eceff1;
      outline: none;
      &:active {
        box-shadow: none;
      }
    }
  }
  .context-container {
    width: 100%;
    padding-left: $lefyNavWidth;
  }
}
</style>

<template>
  <div class="app-container clearfix">
    <div class="left-nav pull-left">

      <!-- User avatar. -->
      <img v-if="user.avatar" class="img-responsive img-circle center-block user-avatar" :src="user.avatar">
      <default-avatar v-else class="img-responsive img-circle center-block user-avatar" />
      <!-- End user avatar. -->

      <!-- Username and dropdown menu. -->
      <div class="dropdown">
        <button class="btn dropdown-toggle username-btn" type="button" id="userDropdownMune" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          {{ user.name }}
          <span class="caret"></span>
        </button>
        <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdownMune">
          <li class="disabled">
            <a href="#" @click="openWebsite">
              <span class="glyphicon glyphicon-new-window"></span>
              打开前台
            </a>
          </li>
          <li role="separator" class="divider"></li>
          <li>
            <a :href="logout">
              <span class="glyphicon glyphicon-log-in"></span>
              退出登录
            </a>
          </li>
        </ul>
      </div>
      <!-- End username and dropdown menu. -->

      <system-nav />

    </div>
    <!-- The content container. -->
    <router-view class="pull-right context-container"></router-view>
    <!-- End content container. -->
  </div>
</template>

<script>
import { mapGetters } from 'vuex';
import { createRequestURI, createAPI } from '../util/request';
import { USER, USER_DATA } from '../store/getter-types';

import DefaultAvatar from '../icons/default-avatar';

// components.
import Nav from './Nav';

const home = {
  data: () => ({
    logout: createRequestURI('logout')
  }),
  computed: {
    ...mapGetters([
      USER
    ]),
    user () {
      return this[USER];
    }
  },
  methods: {
    openWebsite (e) {
      e.stopPropagation();
      e.preventDefault();

      return false;
    }
  },
  components: {
    'system-nav': Nav,
    'default-avatar': DefaultAvatar
  }
};

export default home;
</script><commit_msg>增加打开前台按钮链接。<commit_after><style lang="scss">

$lefyNavWidth: 240px;

.app-container {
  .left-nav {
    position: fixed;
    width: $lefyNavWidth;
    height: 100%;
    padding-top: 12px;
    background: #263238;
    z-index: 1;
    overflow: hidden;
    overflow-x: hidden;
    overflow-y: auto;
    .user-avatar {
      width: 64px;
      height: 64px;
      background: #ededed;
    }
    .username-btn {
      width: 100%;
      background: none;
      border: none;
      color: #eceff1;
      outline: none;
      &:active {
        box-shadow: none;
      }
    }
  }
  .context-container {
    width: 100%;
    padding-left: $lefyNavWidth;
  }
}
</style>

<template>
  <div class="app-container clearfix">
    <div class="left-nav pull-left">

      <!-- User avatar. -->
      <img v-if="user.avatar" class="img-responsive img-circle center-block user-avatar" :src="user.avatar">
      <default-avatar v-else class="img-responsive img-circle center-block user-avatar" />
      <!-- End user avatar. -->

      <!-- Username and dropdown menu. -->
      <div class="dropdown">
        <button class="btn dropdown-toggle username-btn" type="button" id="userDropdownMune" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          {{ user.name }}
          <span class="caret"></span>
        </button>
        <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdownMune">
          <li>
            <a href="/" target="_blank">
              <span class="glyphicon glyphicon-new-window"></span>
              打开前台
            </a>
          </li>
          <li role="separator" class="divider"></li>
          <li>
            <a :href="logout">
              <span class="glyphicon glyphicon-log-in"></span>
              退出登录
            </a>
          </li>
        </ul>
      </div>
      <!-- End username and dropdown menu. -->

      <system-nav />

    </div>
    <!-- The content container. -->
    <router-view class="pull-right context-container"></router-view>
    <!-- End content container. -->
  </div>
</template>

<script>
import { mapGetters } from 'vuex';
import { createRequestURI, createAPI } from '../util/request';
import { USER, USER_DATA } from '../store/getter-types';

import DefaultAvatar from '../icons/default-avatar';

// components.
import Nav from './Nav';

const home = {
  data: () => ({
    logout: createRequestURI('logout')
  }),
  computed: {
    ...mapGetters([
      USER
    ]),
    user () {
      return this[USER];
    }
  },
  components: {
    'system-nav': Nav,
    'default-avatar': DefaultAvatar
  }
};

export default home;
</script>
{'fraction_non_alphanumeric': 0.16506291635825315, 'fraction_numerical': 0.009622501850481125, 'mean_word_length': 2.122472559214327, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 91, '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': '1356586', 'n_tokens_mistral': 1810, 'n_tokens_neox': 1748, 'n_words': 377}