Config.vue 1.8 KB
Newer Older
J
Jeff Wang 已提交
1
<template>
2 3 4 5 6 7 8
  <div class="visual-dl-page-config-com">
    <v-text-field
      label="Group name RegExp"
      hint="input a tag group name to search"
      v-model="config.groupNameReg"
      dark
    />
J
Jeff Wang 已提交
9

10 11 12 13 14 15 16 17 18 19
    <v-radio-group
      label="Histogram mode"
      v-model="config.chartType"
      dark>
      <v-radio
        v-for="mode in chartTypeItems"
        :key="mode.name"
        :label="mode.name"
        :value="mode.value"/>
    </v-radio-group>
J
Jeff Wang 已提交
20

21 22 23 24 25 26 27 28 29
    <label class="visual-dl-page-checkbox-group-label">Runs</label>
    <v-checkbox
      v-for="item in runsItems"
      :key="item.name"
      :label="item.name"
      :value="item.value"
      v-model="config.runs"
      dark
    />
J
Jeff Wang 已提交
30

31 32 33 34
    <v-btn
      class="visual-dl-page-run-toggle"
      :color="config.running ? 'primary' : 'error'"
      v-model="config.running"
D
daminglu 已提交
35
      v-if="!isDemo"
36 37 38 39 40 41 42
      @click="toggleAllRuns"
      dark
      block
    >
      {{ config.running ? 'Running' : 'Stopped' }}
    </v-btn>
  </div>
J
Jeff Wang 已提交
43 44 45
</template>
<script>
export default {
J
Jeff Wang 已提交
46 47 48 49 50 51 52 53 54 55
  props: {
    runsItems: {
      type: Array,
      required: true,
    },
    config: {
      type: Object,
      required: true,
    },
  },
J
Jeff Wang 已提交
56 57 58 59 60 61 62 63 64 65
  data() {
    return {
      chartTypeItems: [
        {
          name: 'Overlay',
          value: 'overlay',
        },
        {
          name: 'Offset',
          value: 'offset',
66
        },
J
Jeff Wang 已提交
67
      ],
D
daminglu 已提交
68
      isDemo: process.env.NODE_ENV === 'demo',
J
Jeff Wang 已提交
69 70 71 72 73 74
    };
  },
  methods: {
    toggleAllRuns() {
      let running = this.config.running;
      this.config.running = !running;
75
    },
J
Jeff Wang 已提交
76
  },
J
Jeff Wang 已提交
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
};
</script>
<style lang="stylus">
+prefix-classes('visual-dl-page-')
    .config-com
        padding 20px
        .run-toggle
            margin-top 20px
        .checkbox-group-label
            display flex
            margin-top 20px
            margin-bottom 10px
</style>