summaryrefslogtreecommitdiff
path: root/src/client/app/dev/views/apps.vue
blob: b99ccdf5763708759f49b34d313f50c604b53690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<template>
<mk-ui>
	<b-card :header="$t('manage-apps')">
		<b-button to="/app/new" variant="primary">{{ $t('create-app') }}</b-button>
		<hr>
		<div class="apps">
			<p v-if="fetching">{{ $t('@.loading') }}</p>
			<template v-if="!fetching">
				<b-alert v-if="apps.length == 0">{{ $t('app-missing') }}</b-alert>
				<b-list-group v-else>
					<b-list-group-item v-for="app in apps" :key="app.id" :to="`/app/${app.id}`">
						{{ app.name }}
					</b-list-group-item>
				</b-list-group>
			</template>
		</div>
	</b-card>
</mk-ui>
</template>

<script lang="ts">
import Vue from 'vue';
import i18n from '../../i18n';
export default Vue.extend({
	i18n: i18n('dev/views/apps.vue'),
	data() {
		return {
			fetching: true,
			apps: []
		};
	},
	mounted() {
		this.$root.api('my/apps').then(apps => {
			this.apps = apps;
			this.fetching = false;
		});
	}
});
</script>