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