1
1
<template >
2
2
<el-row >
3
- <el-col :span =" 14 " :offset =" 5 " >
3
+ <el-col :span =" 20 " :offset =" 2 " >
4
4
<div class =" container flag-container" >
5
5
<el-dialog
6
6
title =" Delete feature flag"
90
90
<div v-if =" loaded && flag" >
91
91
<el-tabs >
92
92
<el-tab-pane label =" Config" >
93
- <el-card >
93
+ <el-card class = " flag-config-card " >
94
94
<div slot =" header" class =" el-card-header" >
95
95
<div class =" flex-row" >
96
96
<div class =" flex-row-left" >
110
110
</div >
111
111
</div >
112
112
</div >
113
- <el-card >
113
+ <el-card shadow = " hover " >
114
114
<div class =" flex-row id-row" >
115
115
<div class =" flex-row-left" >
116
116
<el-tag type =" primary" :disable-transitions =" true" >
127
127
:inactive-value =" false" >
128
128
</el-switch >
129
129
</el-tooltip >
130
- <span size =" small" >Data Records</span >
130
+ <span size =" small" class = " data-records-label " >Data Records</span >
131
131
<el-button size =" small" @click =" putFlag(flag)" >
132
132
Save Flag
133
133
</el-button >
160
160
</div >
161
161
<div class =" variants-container-inner" v-if =" flag.variants.length" >
162
162
<div v-for =" variant in flag.variants" :key =" variant.id" >
163
- <el-card >
163
+ <el-card shadow = " hover " >
164
164
<el-form label-position =" left" label-width =" 100px" >
165
165
<div class =" flex-row id-row" >
166
166
<div class =" flex-row-left" >
175
175
</el-button >
176
176
</div >
177
177
</div >
178
- <el-input
179
- size =" small"
180
- placeholder =" Key"
181
- v-model =" variant.key" >
182
- <template slot="prepend">Key</template >
183
- </el-input >
184
- <el-input
185
- size =" small"
186
- placeholder =" {}"
187
- v-model =" variant.attachmentStr" >
188
- <template slot="prepend">Attachment </template >
189
- </el-input >
178
+ <el-row :gutter =" 10" >
179
+ <el-col :span =" 12" >
180
+ <el-input
181
+ size =" small"
182
+ placeholder =" Key"
183
+ v-model =" variant.key" >
184
+ <template slot="prepend">Key</template >
185
+ </el-input >
186
+ </el-col >
187
+ <el-col :span =" 12" >
188
+ <el-input
189
+ size =" small"
190
+ placeholder =" {}"
191
+ v-model =" variant.attachmentStr" >
192
+ <template slot="prepend">Attachment </template >
193
+ </el-input >
194
+ </el-col >
195
+ </el-row >
190
196
</el-form >
191
197
</el-card >
192
198
</div >
234
240
<draggable v-model =" flag.segments" @start =" drag=true" @end =" drag=false" >
235
241
<transition-group >
236
242
<el-card
243
+ shadow =" hover"
237
244
v-for =" segment in flag.segments"
238
245
:key =" segment.id"
239
246
class =" segment grabbable" >
243
250
</div >
244
251
<div class =" flex-row-right" >
245
252
<el-button slot =" append" size =" small" @click =" putSegment(segment)" >
246
- Save Segment
253
+ Save Segment Setting
247
254
</el-button >
248
255
<el-button @click =" deleteSegment(segment)" size =" small" >
249
256
<span class =" el-icon-delete" />
250
257
</el-button >
251
258
</div >
252
259
</div >
253
- <el-row :gutter =" 20 " class =" id-row" >
260
+ <el-row :gutter =" 10 " class =" id-row" >
254
261
<el-col :span =" 15" >
255
262
<el-input
256
263
size =" small"
275
282
</el-row >
276
283
<el-row >
277
284
<el-col :span =" 24" >
278
- <h4 >Constraints (match ALL of them)</h4 >
285
+ <h5 >Constraints (match ALL of them)</h5 >
279
286
<div class =" constraints" >
280
287
<div class =" constraints-inner" v-if =" segment.constraints.length" >
281
288
<div
309
316
</el-input >
310
317
</el-col >
311
318
<el-col :span =" 2" >
312
- <el-button class =" width--full" @click =" putConstraint(segment, constraint)" size =" small" >
313
- < span class = " el-icon-check " />
319
+ <el-button type = " success " plain class =" width--full" @click =" putConstraint(segment, constraint)" size =" small" >
320
+ Save
314
321
</el-button >
315
322
</el-col >
316
323
<el-col :span =" 2" >
317
- <el-button class =" width--full" @click =" deleteConstraint(segment, constraint)" size =" small" >
318
- <span class =" el-icon-delete" / >
324
+ <el-button type = " danger " plain class =" width--full" @click =" deleteConstraint(segment, constraint)" size =" small" >
325
+ <i class =" el-icon-delete" ></ i >
319
326
</el-button >
320
327
</el-col >
321
328
</el-row >
354
361
<el-button
355
362
class =" width--full"
356
363
size =" small"
364
+ type =" primary"
365
+ plain
357
366
:disabled =" !segment.newConstraint.property || !segment.newConstraint.value"
358
367
@click.prevent =" () => createConstraint(segment)" >
359
368
<span class =" el-icon-plus" />
364
373
</div >
365
374
</el-col >
366
375
<el-col :span =" 24" class =" segment-distributions" >
367
- <h4 >Distribution</h4 >
368
- <ul class =" segment-distributions-inner" v-if =" segment.distributions.length" >
369
- <li v-for =" distribution in segment.distributions" :key =" distribution.id" >
370
- <el-tag type =" gray" :disable-transitions =" true" >{{ distribution.variantKey }}</el-tag >
371
- <span size =" small" >{{ distribution.percent }}%</span >
372
- </li >
373
- </ul >
376
+ <h5 >
377
+ <span >Distribution</span >
378
+ <el-button round size =" mini" @click =" editDistribution(segment)" >
379
+ <span class =" el-icon-edit" ></span > edit
380
+ </el-button >
381
+ </h5 >
382
+ <el-row type =" flex" v-if =" segment.distributions.length" :gutter =" 20" >
383
+ <el-col
384
+ v-for =" distribution in segment.distributions" :key =" distribution.id"
385
+ :span =" 6" >
386
+ <el-card shadow =" never" class =" distribution-card" >
387
+ <div >
388
+ <span size =" small" >{{distribution.variantKey}}</span >
389
+ </div >
390
+ <el-progress
391
+ type =" circle"
392
+ color =" #74E5E0"
393
+ width =" 70"
394
+ :percentage =" distribution.percent" >
395
+ </el-progress >
396
+ </el-card >
397
+ </el-col >
398
+ </el-row >
399
+
374
400
<div class =" card--error" v-else >
375
401
No distribution yet
376
402
</div >
377
- <div class =" edit-distribution-button" >
378
- <el-button class =" width--full" @click =" editDistribution(segment)" >
379
- <span class =" el-icon-edit" ></span >
380
- Edit distribution
381
- </el-button >
382
- </div >
383
403
</el-col >
384
404
</el-row >
385
405
</el-card >
395
415
<div slot =" header" class =" el-card-header" >
396
416
<h2 >Flag Settings</h2 >
397
417
</div >
398
- <el-button @click =" dialogDeleteFlagVisible = true" >
418
+ <el-button @click =" dialogDeleteFlagVisible = true" type = " danger " plain >
399
419
<span class =" el-icon-delete" ></span >
400
420
Delete Flag
401
421
</el-button >
@@ -714,9 +734,9 @@ export default {
714
734
</script >
715
735
716
736
<style lang="less">
717
- h4 {
737
+ h5 {
718
738
padding : 0 ;
719
- margin : 10px 0 ;
739
+ margin : 10px 0 5 px ;
720
740
}
721
741
722
742
.grabbable {
@@ -739,6 +759,19 @@ h4 {
739
759
background-color : #f6f6f6 ;
740
760
border-radius : 5px ;
741
761
}
762
+ .distribution-card {
763
+ height : 110px ;
764
+ text-align : center ;
765
+ .el-card__body {
766
+ padding : 3px 10px 10px 10px ;
767
+ }
768
+ font-size : 0.9em ;
769
+ }
770
+ .distribution-card__edit {
771
+ button {
772
+ boarder- size: 0 ;
773
+ }
774
+ }
742
775
}
743
776
744
777
ol .constraints-inner {
@@ -764,7 +797,7 @@ ol.constraints-inner {
764
797
margin-bottom : 1em ;
765
798
}
766
799
.el-input-group__prepend {
767
- width : 8 em ;
800
+ width : 2 em ;
768
801
}
769
802
}
770
803
@@ -792,10 +825,16 @@ ol.constraints-inner {
792
825
margin-bottom : 8px ;
793
826
}
794
827
795
- .flag-content {
796
- margin-top : 8px ;
797
- .el-input-group__prepend {
798
- width : 8em ;
828
+ .flag-config-card {
829
+ .flag-content {
830
+ margin-top : 8px ;
831
+ .el-input-group__prepend {
832
+ width : 8em ;
833
+ }
834
+ }
835
+ .data-records-label {
836
+ margin-right : 8px ;
799
837
}
800
838
}
839
+
801
840
</style >
0 commit comments