2020-03-28 19:33:11 +09:00
|
|
|
<template>
|
2023-01-06 13:40:17 +09:00
|
|
|
<div class="_gaps_m">
|
2021-11-19 19:36:12 +09:00
|
|
|
<FormPagination ref="list" :pagination="pagination">
|
2020-03-28 19:33:11 +09:00
|
|
|
<template #empty>
|
|
|
|
<div class="_fullinfo">
|
|
|
|
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
|
2022-05-04 10:15:24 +09:00
|
|
|
<div>{{ i18n.ts.nothing }}</div>
|
2020-03-28 19:33:11 +09:00
|
|
|
</div>
|
|
|
|
</template>
|
2022-06-20 17:38:49 +09:00
|
|
|
<template #default="{items}">
|
2023-04-10 18:56:38 +09:00
|
|
|
<div class="_gaps">
|
|
|
|
<div v-for="token in items" :key="token.id" class="_panel bfomjevm">
|
|
|
|
<img v-if="token.iconUrl" class="icon" :src="token.iconUrl" alt=""/>
|
|
|
|
<div class="body">
|
|
|
|
<div class="name">{{ token.name }}</div>
|
|
|
|
<div class="description">{{ token.description }}</div>
|
|
|
|
<MkKeyValue oneline>
|
|
|
|
<template #key>{{ i18n.ts.installedDate }}</template>
|
|
|
|
<template #value><MkTime :time="token.createdAt"/></template>
|
|
|
|
</MkKeyValue>
|
|
|
|
<MkKeyValue oneline>
|
|
|
|
<template #key>{{ i18n.ts.lastUsedDate }}</template>
|
|
|
|
<template #value><MkTime :time="token.lastUsedAt"/></template>
|
|
|
|
</MkKeyValue>
|
|
|
|
<details>
|
|
|
|
<summary>{{ i18n.ts.details }}</summary>
|
|
|
|
<ul>
|
|
|
|
<li v-for="p in token.permission" :key="p">{{ i18n.t(`_permissions.${p}`) }}</li>
|
|
|
|
</ul>
|
|
|
|
</details>
|
|
|
|
<div class="actions">
|
|
|
|
<MkButton inline danger @click="revoke(token)"><i class="ti ti-trash"></i></MkButton>
|
|
|
|
</div>
|
2023-01-05 19:50:52 +09:00
|
|
|
</div>
|
2020-03-28 19:33:11 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
2020-11-25 21:31:34 +09:00
|
|
|
</FormPagination>
|
2022-01-04 18:21:00 +09:00
|
|
|
</div>
|
2020-03-28 19:33:11 +09:00
|
|
|
</template>
|
|
|
|
|
2022-05-04 10:15:24 +09:00
|
|
|
<script lang="ts" setup>
|
2022-06-20 17:38:49 +09:00
|
|
|
import { ref } from 'vue';
|
2022-09-06 18:21:49 +09:00
|
|
|
import FormPagination from '@/components/MkPagination.vue';
|
2021-11-12 02:02:25 +09:00
|
|
|
import * as os from '@/os';
|
2022-05-04 10:15:24 +09:00
|
|
|
import { i18n } from '@/i18n';
|
2022-06-20 17:38:49 +09:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
2023-01-05 19:50:52 +09:00
|
|
|
import MkKeyValue from '@/components/MkKeyValue.vue';
|
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2020-03-28 19:33:11 +09:00
|
|
|
|
2022-05-04 10:15:24 +09:00
|
|
|
const list = ref<any>(null);
|
2020-03-28 19:33:11 +09:00
|
|
|
|
2022-05-04 10:15:24 +09:00
|
|
|
const pagination = {
|
|
|
|
endpoint: 'i/apps' as const,
|
|
|
|
limit: 100,
|
2023-04-10 18:56:38 +09:00
|
|
|
noPaging: true,
|
2022-05-04 10:15:24 +09:00
|
|
|
params: {
|
2022-06-20 17:38:49 +09:00
|
|
|
sort: '+lastUsedAt',
|
|
|
|
},
|
2022-06-10 14:36:55 +09:00
|
|
|
};
|
2020-11-25 21:31:34 +09:00
|
|
|
|
2022-05-04 10:15:24 +09:00
|
|
|
function revoke(token) {
|
|
|
|
os.api('i/revoke-token', { tokenId: token.id }).then(() => {
|
|
|
|
list.value.reload();
|
|
|
|
});
|
|
|
|
}
|
2020-03-28 19:33:11 +09:00
|
|
|
|
2022-06-20 17:38:49 +09:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.installedApps,
|
2022-12-19 19:01:30 +09:00
|
|
|
icon: 'ti ti-plug',
|
2020-03-28 19:33:11 +09:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2022-12-27 18:29:39 +09:00
|
|
|
<style lang="scss" scoped>
|
2020-03-28 19:33:11 +09:00
|
|
|
.bfomjevm {
|
2020-11-25 21:31:34 +09:00
|
|
|
display: flex;
|
|
|
|
padding: 16px;
|
2020-03-28 19:33:11 +09:00
|
|
|
|
2020-11-25 21:31:34 +09:00
|
|
|
> .icon {
|
|
|
|
display: block;
|
|
|
|
flex-shrink: 0;
|
|
|
|
margin: 0 12px 0 0;
|
|
|
|
width: 50px;
|
|
|
|
height: 50px;
|
|
|
|
border-radius: 8px;
|
|
|
|
}
|
2020-03-28 19:33:11 +09:00
|
|
|
|
2020-11-25 21:31:34 +09:00
|
|
|
> .body {
|
|
|
|
width: calc(100% - 62px);
|
|
|
|
position: relative;
|
2020-03-28 19:33:11 +09:00
|
|
|
|
2020-11-25 21:31:34 +09:00
|
|
|
> .name {
|
|
|
|
font-weight: bold;
|
2020-03-28 19:33:11 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|