Files
mixtape/zero.Backoffice.UI/old_app/pages/settings/applications-items.vue
T

129 lines
2.6 KiB
Vue
Raw Normal View History

2020-05-08 16:53:59 +02:00
<template>
<div class="apps-items">
2021-12-23 14:39:00 +01:00
<ui-link v-for="app in value" :key="app.id" :to="getAppLink(app)" class="apps-item">
2020-05-08 16:53:59 +02:00
<strong class="apps-item-name">{{app.name}}</strong>
<span class="apps-item-minor">{{app.domains[0]}}</span>
2020-10-15 14:10:04 +02:00
<span class="apps-item-status" :class="{ 'is-active': app.isActive }" v-localize="getStatus(app)"></span>
2021-12-23 14:39:00 +01:00
</ui-link>
<ui-link :to="getAddLink()" class="apps-items-add" v-if="zero.config.multiApps">
2021-03-20 09:54:16 +01:00
<ui-icon symbol="fth-plus" :size="24" />
2021-12-23 14:39:00 +01:00
</ui-link>
2020-05-08 16:53:59 +02:00
</div>
</template>
<script>
2020-10-16 14:02:10 +02:00
const baseRoute = __zero.alias.settings.applications;
2020-05-08 16:53:59 +02:00
export default {
2020-05-26 11:43:13 +02:00
props: {
value: {
2020-10-15 14:10:04 +02:00
type: Array,
default: () => []
}
2020-05-08 16:53:59 +02:00
},
2020-10-15 14:10:04 +02:00
methods: {
2020-05-08 16:53:59 +02:00
2020-10-15 14:10:04 +02:00
getAppLink(item)
2020-05-08 16:53:59 +02:00
{
2020-10-15 14:10:04 +02:00
return {
name: baseRoute + '-edit',
2020-11-22 22:31:45 +01:00
params: { id: item.id },
query: { scope: 'shared' }
2020-10-15 14:10:04 +02:00
};
},
2020-05-08 16:53:59 +02:00
2020-10-15 14:10:04 +02:00
getStatus(item)
{
return item.isActive ? '@ui.active' : '@ui.inactive';
},
getAddLink()
{
2020-11-22 22:31:45 +01:00
return {
name: baseRoute + '-create',
query: { scope: 'shared' }
};
2020-10-15 14:10:04 +02:00
}
2020-05-08 16:53:59 +02:00
}
}
</script>
<style lang="scss">
.apps-items
{
display: grid;
gap: var(--padding);
2020-05-08 16:53:59 +02:00
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
align-items: stretch;
margin-top: 40px;
}
a.apps-item
{
display: flex;
flex-direction: column;
background: var(--color-box);
2020-05-08 16:53:59 +02:00
border-radius: var(--radius);
padding: var(--padding-m);
2020-05-08 16:53:59 +02:00
text-align: center;
color: var(--color-text);
2020-05-08 16:53:59 +02:00
font-size: var(--font-size);
line-height: 1.5;
box-shadow: var(--shadow-short);
2020-05-08 16:53:59 +02:00
}
.apps-item-name
{
}
.apps-item-minor
{
color: var(--color-text-dim);
2020-05-08 16:53:59 +02:00
}
.apps-item-image
{
text-align: center;
display: inline-block;
margin: 0 auto var(--padding-m);
2020-05-08 16:53:59 +02:00
position: relative;
max-width: 120px;
max-height: 50px;
}
.apps-item-status
{
align-self: center;
display: inline-block;
font-size: 9px;
font-weight: 700;
margin-top: 15px;
text-transform: uppercase;
background: var(--color-box-nested);
color: var(--color-text);
2020-05-08 16:53:59 +02:00
height: 22px;
line-height: 22px;
padding: 0 10px;
border-radius: 16px;
letter-spacing: .5px;
}
.apps-items-add
{
background: transparent;
2021-08-23 12:56:40 +02:00
border: 1px dashed var(--color-line-dashed-onbg);
color: var(--color-text);
2020-05-08 16:53:59 +02:00
border-radius: var(--radius);
text-align: center;
display: inline-flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 22px;
width: 60px;
}
</style>