Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Resource/List.vue
<template> | <template> | ||||
<div class="container"> | <div class="container"> | ||||
<div class="card" id="resource-list"> | <div class="card" id="resource-list"> | ||||
<div class="card-body"> | <div class="card-body"> | ||||
<div class="card-title"> | <div class="card-title"> | ||||
{{ $tc('resource.list-title', 2) }} | {{ $tc('resource.list-title', 2) }} | ||||
<small><sup class="badge bg-primary">{{ $t('dashboard.beta') }}</sup></small> | <small><sup class="badge bg-primary">{{ $t('dashboard.beta') }}</sup></small> | ||||
<btn-router v-if="!$root.isDegraded()" to="resource/new" class="btn-success float-end" icon="cog"> | <btn-router v-if="!$root.isDegraded()" to="resource/new" class="btn-success float-end" icon="gear"> | ||||
{{ $t('resource.create') }} | {{ $t('resource.create') }} | ||||
</btn-router> | </btn-router> | ||||
</div> | </div> | ||||
<div class="card-text"> | <div class="card-text"> | ||||
<table class="table table-sm table-hover"> | <table class="table table-sm table-hover"> | ||||
<thead> | <thead> | ||||
<tr> | <tr> | ||||
<th scope="col">{{ $t('form.name') }}</th> | <th scope="col">{{ $t('form.name') }}</th> | ||||
<th scope="col">{{ $t('form.email') }}</th> | <th scope="col">{{ $t('form.email') }}</th> | ||||
</tr> | </tr> | ||||
</thead> | </thead> | ||||
<tbody> | <tbody> | ||||
<tr v-for="resource in resources" :key="resource.id" @click="$root.clickRecord"> | <tr v-for="resource in resources" :key="resource.id" @click="$root.clickRecord"> | ||||
<td> | <td> | ||||
<svg-icon icon="cog" :class="$root.statusClass(resource)" :title="$root.statusText(resource)"></svg-icon> | <svg-icon icon="gear" :class="$root.statusClass(resource)" :title="$root.statusText(resource)"></svg-icon> | ||||
<router-link :to="{ path: 'resource/' + resource.id }">{{ resource.name }}</router-link> | <router-link :to="{ path: 'resource/' + resource.id }">{{ resource.name }}</router-link> | ||||
</td> | </td> | ||||
<td> | <td> | ||||
<router-link :to="{ path: 'resource/' + resource.id }">{{ resource.email }}</router-link> | <router-link :to="{ path: 'resource/' + resource.id }">{{ resource.email }}</router-link> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</tbody> | </tbody> | ||||
<tfoot class="table-fake-body"> | <tfoot class="table-fake-body"> | ||||
<tr> | <tr> | ||||
<td colspan="2">{{ $t('resource.list-empty') }}</td> | <td colspan="2">{{ $t('resource.list-empty') }}</td> | ||||
</tr> | </tr> | ||||
</tfoot> | </tfoot> | ||||
</table> | </table> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import { library } from '@fortawesome/fontawesome-svg-core' | |||||
library.add( | |||||
require('@fortawesome/free-solid-svg-icons/faGear').definition, | |||||
) | |||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
resources: [] | resources: [] | ||||
} | } | ||||
}, | }, | ||||
created() { | created() { | ||||
this.$root.startLoading() | this.$root.startLoading() | ||||
Show All 10 Lines |