2020-03-28 04:33:11 -06:00
|
|
|
<template>
|
2020-11-25 05:31:34 -07:00
|
|
|
<FormBase>
|
2021-11-19 03:36:12 -07:00
|
|
|
<FormPagination ref="list" :pagination="pagination">
|
2020-03-28 04:33:11 -06:00
|
|
|
<template #empty>
|
|
|
|
<div class="_fullinfo">
|
|
|
|
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
|
2020-12-25 18:47:36 -07:00
|
|
|
<div>{{ $ts.nothing }}</div>
|
2020-03-28 04:33:11 -06:00
|
|
|
</div>
|
|
|
|
</template>
|
2021-12-02 04:09:12 -07:00
|
|
|
<template v-slot="{items}">
|
2021-11-19 03:36:12 -07:00
|
|
|
<div v-for="token in items" :key="token.id" class="_debobigegoPanel bfomjevm">
|
|
|
|
<img v-if="token.iconUrl" class="icon" :src="token.iconUrl" alt=""/>
|
2020-03-28 04:33:11 -06:00
|
|
|
<div class="body">
|
|
|
|
<div class="name">{{ token.name }}</div>
|
|
|
|
<div class="description">{{ token.description }}</div>
|
|
|
|
<div class="_keyValue">
|
2020-12-25 18:47:36 -07:00
|
|
|
<div>{{ $ts.installedDate }}:</div>
|
2020-10-17 05:12:00 -06:00
|
|
|
<div><MkTime :time="token.createdAt"/></div>
|
2020-03-28 04:33:11 -06:00
|
|
|
</div>
|
|
|
|
<div class="_keyValue">
|
2020-12-25 18:47:36 -07:00
|
|
|
<div>{{ $ts.lastUsedDate }}:</div>
|
2020-10-17 05:12:00 -06:00
|
|
|
<div><MkTime :time="token.lastUsedAt"/></div>
|
2020-03-28 04:33:11 -06:00
|
|
|
</div>
|
|
|
|
<div class="actions">
|
2021-04-20 08:22:59 -06:00
|
|
|
<button class="_button" @click="revoke(token)"><i class="fas fa-trash-alt"></i></button>
|
2020-03-28 04:33:11 -06:00
|
|
|
</div>
|
2020-03-29 02:06:36 -06:00
|
|
|
<details>
|
2020-12-25 18:47:36 -07:00
|
|
|
<summary>{{ $ts.details }}</summary>
|
2020-03-29 02:06:36 -06:00
|
|
|
<ul>
|
|
|
|
<li v-for="p in token.permission" :key="p">{{ $t(`_permissions.${p}`) }}</li>
|
|
|
|
</ul>
|
|
|
|
</details>
|
2020-03-28 04:33:11 -06:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
2020-11-25 05:31:34 -07:00
|
|
|
</FormPagination>
|
|
|
|
</FormBase>
|
2020-03-28 04:33:11 -06:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 05:12:00 -06:00
|
|
|
import { defineComponent } from 'vue';
|
2021-11-11 10:02:25 -07:00
|
|
|
import FormPagination from '@/components/debobigego/pagination.vue';
|
|
|
|
import FormSelect from '@/components/form/select.vue';
|
|
|
|
import FormLink from '@/components/debobigego/link.vue';
|
|
|
|
import FormBase from '@/components/debobigego/base.vue';
|
|
|
|
import FormGroup from '@/components/debobigego/group.vue';
|
|
|
|
import FormButton from '@/components/debobigego/button.vue';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import * as symbols from '@/symbols';
|
2020-03-28 04:33:11 -06:00
|
|
|
|
2020-10-17 05:12:00 -06:00
|
|
|
export default defineComponent({
|
2020-03-28 04:33:11 -06:00
|
|
|
components: {
|
2020-11-25 05:31:34 -07:00
|
|
|
FormBase,
|
|
|
|
FormPagination,
|
2020-03-28 04:33:11 -06:00
|
|
|
},
|
|
|
|
|
2020-11-25 05:31:34 -07:00
|
|
|
emits: ['info'],
|
|
|
|
|
2020-03-28 04:33:11 -06:00
|
|
|
data() {
|
|
|
|
return {
|
2021-04-09 21:54:12 -06:00
|
|
|
[symbols.PAGE_INFO]: {
|
2020-12-25 18:47:36 -07:00
|
|
|
title: this.$ts.installedApps,
|
2021-04-20 08:22:59 -06:00
|
|
|
icon: 'fas fa-plug',
|
2021-09-29 09:50:45 -06:00
|
|
|
bg: 'var(--bg)',
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
2020-03-28 04:33:11 -06:00
|
|
|
pagination: {
|
|
|
|
endpoint: 'i/apps',
|
|
|
|
limit: 100,
|
2020-03-28 04:40:03 -06:00
|
|
|
params: {
|
|
|
|
sort: '+lastUsedAt'
|
|
|
|
}
|
2020-03-28 04:33:11 -06:00
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2020-11-25 05:31:34 -07:00
|
|
|
mounted() {
|
2021-04-09 21:54:12 -06:00
|
|
|
this.$emit('info', this[symbols.PAGE_INFO]);
|
2020-11-25 05:31:34 -07:00
|
|
|
},
|
|
|
|
|
2020-03-28 04:33:11 -06:00
|
|
|
methods: {
|
|
|
|
revoke(token) {
|
2020-10-17 05:12:00 -06:00
|
|
|
os.api('i/revoke-token', { tokenId: token.id }).then(() => {
|
2020-03-28 04:33:11 -06:00
|
|
|
this.$refs.list.reload();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.bfomjevm {
|
2020-11-25 05:31:34 -07:00
|
|
|
display: flex;
|
|
|
|
padding: 16px;
|
2020-03-28 04:33:11 -06:00
|
|
|
|
2020-11-25 05:31:34 -07:00
|
|
|
> .icon {
|
|
|
|
display: block;
|
|
|
|
flex-shrink: 0;
|
|
|
|
margin: 0 12px 0 0;
|
|
|
|
width: 50px;
|
|
|
|
height: 50px;
|
|
|
|
border-radius: 8px;
|
|
|
|
}
|
2020-03-28 04:33:11 -06:00
|
|
|
|
2020-11-25 05:31:34 -07:00
|
|
|
> .body {
|
|
|
|
width: calc(100% - 62px);
|
|
|
|
position: relative;
|
2020-03-28 04:33:11 -06:00
|
|
|
|
2020-11-25 05:31:34 -07:00
|
|
|
> .name {
|
|
|
|
font-weight: bold;
|
2020-03-28 04:33:11 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|