Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
hitman249 committed Feb 11, 2021
1 parent 1d439e1 commit a470857
Show file tree
Hide file tree
Showing 19 changed files with 248 additions and 150 deletions.
56 changes: 14 additions & 42 deletions src/src/components/Db/ItemSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,24 @@
<p v-if="item.description" class="text-dark">
<span class="text-muted">{{ item.description }}</span>
</p>
<span class="text-muted">{{ item.run }}</span>
<!-- <pre>{{ item.run }}</pre>-->
<!-- <br>-->
<!-- <code>{{ item.tags.join(', ') }}</code>-->

<template v-if="item.env.length > 0">
<br>
<code>{{ item.env.join(' ') }}</code>
</template>
</div>
</div>

<!-- <div class="table-detail time-detail">-->
<!-- <p class="text-dark m-b-5">-->
<!-- <b>wert</b><br/>-->
<!-- <span class="label label-inverse">123</span>-->
<!-- </p>-->
<!-- </div>-->

<!-- <div class="table-detail item-point__info">-->
<!-- <p class="text-dark m-b-5">-->
<!-- <span v-if="item.esync" class="label label-inverse m-r-5">esync</span>-->
<!-- <span v-if="item.fsync" class="label label-inverse m-r-5">fsync</span>-->
<!-- <span v-if="item.pulse" class="label label-inverse m-r-5">pulse</span>-->
<!-- <span v-if="!item.pulse" class="label label-inverse m-r-5">alsa</span>-->
<!-- <span v-if="item.csmt" class="label label-inverse m-r-5">csmt</span>-->
<!-- <span v-if="item.window" class="label label-inverse m-r-5">window</span>-->
<!-- </p>-->
<!-- </div>-->

<div class="table-detail item-point__button-block">
<PopupEditConfig :config="item.config" ref="popup" :hide-button="false"
:button-open-title="$t('labels.add')" :button-save-title="$t('labels.add')"/>
<PopupRemove v-if="user.id === item.user_id || user.is_admin" :type="type" :item="item" :model="'config'"/>
</div>

<div class="btn-group">
<button type="button" class="btn item-point__button btn-custom waves-effect waves-light dropdown-toggle"
data-toggle="dropdown" aria-expanded="false">
{{ $t('labels.action') }} <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<PopupEditConfig :config="item.config" ref="popup" :hide-button="false"
:button-open-title="$t('labels.add')" :button-save-title="$t('labels.add')"/>
<PopupRemove v-if="user.id === item.user_id || user.is_admin" :type="type" :item="item" :model="'config'"/>
</ul>
</div>

</div>
</div>

<div class="item-point__footer">
Expand Down Expand Up @@ -126,7 +108,7 @@ export default {
}
.table-box .table-detail {
vertical-align: top;
vertical-align: middle;
}
.member-info {
Expand All @@ -144,14 +126,4 @@ export default {
display: inline;
}
}
.item-point__button-block {
vertical-align: middle !important;
padding-right: 0;
& > div {
margin-top: 5px;
float: right;
}
}
</style>
15 changes: 9 additions & 6 deletions src/src/components/Db/PopupRemove.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<div>
<button class="btn item-point__button btn-custom waves-effect waves-light" @click="open" onclick="return false">
<span>{{ $t('labels.delete') }}</span>
<i class="fa fa-angle-right m-l-10"></i>
</button>
<li>
<a @click="open" onclick="return false">
{{ $t('labels.delete') }}
</a>

<div :id="id" class="modal-demo">
<button type="button" class="close" @click="cancel">
Expand Down Expand Up @@ -35,7 +34,7 @@
</div>
</div>

</div>
</li>
</template>

<script>
Expand Down Expand Up @@ -107,4 +106,8 @@ export default {
.item-point__button {
min-width: 110px;
}
a {
cursor: pointer;
}
</style>
37 changes: 22 additions & 15 deletions src/src/components/Home/ItemGame.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<div class="table-detail">
<div class="member-info">
<h4 class="m-t-15 item-point__title"><b>{{ config.name }}</b></h4>
<h4 class="item-point__title"><b>{{ config.name }}</b></h4>
<template v-if="!icon">
<p v-if="config.description" class="text-dark">
<span class="text-muted">{{ config.description }}</span>
Expand All @@ -37,22 +37,21 @@
</p>
</div>

<!-- <div v-if="edit && !icon" class="table-detail item-point__info">-->
<!-- <p class="text-dark m-b-5">-->
<!-- <span v-if="config.esync" class="label label-inverse m-r-5">esync</span>-->
<!-- <span v-if="config.fsync" class="label label-inverse m-r-5">fsync</span>-->
<!-- <span v-if="config.pulse" class="label label-inverse m-r-5">pulse</span>-->
<!-- <span v-if="!config.pulse" class="label label-inverse m-r-5">alsa</span>-->
<!-- <span v-if="config.csmt" class="label label-inverse m-r-5">csmt</span>-->
<!-- <span v-if="config.window" class="label label-inverse m-r-5">window</span>-->
<!-- </p>-->
<!-- </div>-->

<div class="table-detail item-point__button-block">

<div v-if="edit && !icon" class="btn-group">
<button type="button" class="btn item-point__button btn-custom waves-effect waves-light dropdown-toggle"
data-toggle="dropdown" aria-expanded="false">
{{ $t('labels.action') }} <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<PopupEditConfig v-if="edit && !icon" :config="config.config"/>
<PopupShareConfig v-if="config.icon && config.background && edit && !icon" :config="config"/>
<PopupRemoveConfig v-if="edit && !icon" :config="config"/>
</ul>
</div>

<PopupPlay v-if="!edit && !icon" :config="config"/>
<PopupEditConfig v-else-if="edit && !icon" :config="config.config"/>
<PopupShareConfig v-if="config.icon && config.background && edit && !icon" :config="config"/>
<PopupRemoveConfig v-if="edit && !icon" :config="config"/>
<PopupIconCreate v-if="!edit && icon && config.icons.length === 0" :config="config"/>
<PopupIconRemove v-if="!edit && icon && config.icons.length" :config="config"/>
</div>
Expand Down Expand Up @@ -102,5 +101,13 @@ export default {
</script>

<style lang="less" scoped>
.member-info {
h4 {
margin: 0;
}
.text-dark {
margin: 0;
}
}
</style>
15 changes: 9 additions & 6 deletions src/src/components/Home/PopupRemoveConfig.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<div>
<button class="btn item-point__button btn-custom waves-effect waves-light" @click="open" onclick="return false">
<span>{{ $t('labels.delete') }}</span>
<i class="fa fa-angle-right m-l-10"></i>
</button>
<li>
<a @click="open" onclick="return false">
{{ $t('labels.delete') }}
</a>

<div :id="id" class="modal-demo">
<button type="button" class="close" @click="cancel">
Expand Down Expand Up @@ -35,7 +34,7 @@
</div>
</div>

</div>
</li>
</template>

<script>
Expand Down Expand Up @@ -98,4 +97,8 @@ export default {
.item-point__button {
min-width: 110px;
}
a {
cursor: pointer;
}
</style>
17 changes: 10 additions & 7 deletions src/src/components/Home/PopupShareConfig.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<div>
<button class="btn item-point__button btn-custom waves-effect waves-light" @click="open" onclick="return false">
<span>{{ $t('labels.share') }}</span>
<i class="fa fa-angle-right m-l-10"></i>
</button>
<li>
<a @click="open" onclick="return false">
{{ $t('labels.share') }}
</a>

<div :id="id" class="modal-demo">
<button type="button" class="close" @click="cancel">
Expand All @@ -17,7 +16,7 @@
<div class="form-group m-b-30 text-center">
<h4 class="m-t-20">
<b>
{{ $t('labels.share') }} "{{ config.name }}"?
{{ $t('search.shared', { name: config.name }) }}
</b>
</h4>
</div>
Expand All @@ -35,7 +34,7 @@
</div>
</div>

</div>
</li>
</template>

<script>
Expand Down Expand Up @@ -91,4 +90,8 @@ export default {
.item-point__button {
min-width: 110px;
}
a {
cursor: pointer;
}
</style>
25 changes: 20 additions & 5 deletions src/src/components/Patches/ItemPatch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<div class="table-detail">
<div class="member-info">
<h4 class="m-0 m-b-10">
<span v-if="!patch.created && patch" class="label label-success label-new">NEW</span>
<span class="badge badge-success" :class="{'badge-success' : active, 'badge-danger': !active}">
.
</span>
Expand Down Expand Up @@ -44,11 +45,17 @@
</div>

<div class="table-detail item-point__button-block">
<template v-if="!patch.created">
<PopupCommand v-if="patch" :patch="patch.patch" ref="popup"/>
</template>
<PopupPatch v-if="patch" :patch="patch.patch" ref="popup"/>
<PopupRemove v-if="patch" :item="patch"/>
<div class="btn-group">
<button type="button" class="btn item-point__button btn-custom waves-effect waves-light dropdown-toggle"
data-toggle="dropdown" aria-expanded="false">
{{ $t('labels.action') }} <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<PopupCommand v-if="!patch.created && patch" :patch="patch.patch" ref="popup"/>
<PopupPatch v-if="patch" :patch="patch.patch" ref="popup"/>
<PopupRemove v-if="patch" :item="patch"/>
</ul>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -113,4 +120,12 @@ export default {
margin-top: 10px;
margin-bottom: 10px;
}
.label-new {
font-size: 10px;
margin-right: 5px;
vertical-align: middle;
position: relative;
top: -1px;
}
</style>
16 changes: 9 additions & 7 deletions src/src/components/Patches/PopupCommand.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<template>
<div>
<button class="btn item-point__button btn-custom waves-effect waves-light" @click="open"
onclick="return false">
<span>{{ $t('patch.operations') }}</span>
<i class="fa fa-angle-right m-l-10"></i>
</button>
<li>
<a @click="open" onclick="return false">
{{ $t('patch.operations') }}
</a>

<div :id="id" class="modal-demo">
<ButtonTerminal/>
Expand Down Expand Up @@ -51,7 +49,7 @@
</div>
</div>

</div>
</li>
</template>

<script>
Expand Down Expand Up @@ -272,4 +270,8 @@ export default {
.item-point__button {
min-width: 110px;
}
a {
cursor: pointer;
}
</style>
20 changes: 13 additions & 7 deletions src/src/components/Patches/PopupPatch.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<template>
<div>
<button v-if="!hideButton" class="btn item-point__button btn-custom waves-effect waves-light" @click="open"
onclick="return false">
<span>{{ $t('labels.edit') }}</span>
<i class="fa fa-angle-right m-l-10"></i>
</button>
<li>
<a v-if="!hideButton" @click="open" onclick="return false">
{{ $t('labels.edit') }}
</a>

<div :id="id" class="modal-demo">
<button type="button" class="close" @click="cancel">
Expand Down Expand Up @@ -37,7 +35,7 @@
</div>
</div>

</div>
</li>
</template>

<script>
Expand Down Expand Up @@ -151,4 +149,12 @@ export default {
.item-point__button {
min-width: 110px;
}
a {
cursor: pointer;
}
li {
display: block;
}
</style>
15 changes: 9 additions & 6 deletions src/src/components/Patches/PopupRemove.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<div>
<button class="btn item-point__button btn-custom waves-effect waves-light" @click="open" onclick="return false">
<span>{{ $t('labels.delete') }}</span>
<i class="fa fa-angle-right m-l-10"></i>
</button>
<li>
<a @click="open" onclick="return false">
{{ $t('labels.delete') }}
</a>

<div :id="id" class="modal-demo">
<button type="button" class="close" @click="cancel">
Expand Down Expand Up @@ -35,7 +34,7 @@
</div>
</div>

</div>
</li>
</template>

<script>
Expand Down Expand Up @@ -91,4 +90,8 @@ export default {
.item-point__button {
min-width: 110px;
}
a {
cursor: pointer;
}
</style>
Loading

0 comments on commit a470857

Please sign in to comment.