update console

This commit is contained in:
AceDataCloud committed 2024-01-01 02:50:17 +08:00
1 parent 29fd2dd801
commit 18ec9d181c
34 files changed
+1713 -112

No files matched your search

+1 -2
View File
@@ -1,5 +1,5 @@
{
"name": "zhishuyun-ai",
"name": "zhishuyun-hub",
"version": "0.1.0",
"scripts": {
"start": "cross-env NODE_ENV=$npm_config_env vite --host",
@@ -28,7 +28,6 @@
"@types/mustache": "^4.2.2",
"@types/qs": "^6.9.9",
"@types/uuid": "^8.3.4",
"@zhishuyun/data": "^0.1.0",
"axios": "^0.22.0",
"codemirror": "^6.0.1",
"copy-to-clipboard": "^3.3.3",
+2 -2
View File
@@ -142,7 +142,7 @@ export default defineComponent({
.el-upload-list {
position: absolute;
width: 400px;
bottom: 40px;
bottom: 45px;
}
}
</style>
@@ -155,7 +155,7 @@ export default defineComponent({
border-radius: 10px;
background: none;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
top: 50px;
top: 30px;
.upload {
display: inline-block;
&.disabled {
+11 -4
View File
@@ -12,7 +12,9 @@
{{ application?.remaining_amount }}
</span>
<span class="actions">
<el-button size="small" type="primary" @click="onBuy">{{ $t('common.button.buyMore') }}</el-button>
<el-button size="small" type="primary" @click="onBuyMore(application)">{{
$t('common.button.buyMore')
}}</el-button>
</span>
</div>
<div v-else class="text-center info">
@@ -36,6 +38,7 @@ import { IApplicationType } from '@/operators';
import { apiOperator } from '@/operators/api/operator';
import { IApiDetailResponse, IApi } from '@/operators/api';
import { ERROR_CODE_DUPLICATION } from '@/constants/errorCode';
import { ROUTE_CONSOLE_APPLICATION_BUY } from '@/router';
export interface IData {
confirming: boolean;
@@ -83,9 +86,13 @@ export default defineComponent({
this.api = data;
});
},
onBuy() {
const url = `https://data.zhishuyun.com/console/applications/${this.application?.id}/buy`;
window.open(url, '_blank');
onBuyMore(application: IApplication) {
this.$router.push({
name: ROUTE_CONSOLE_APPLICATION_BUY,
params: {
id: application.id
}
});
},
onApply() {
applicationOperator
+11 -1
View File
@@ -11,13 +11,19 @@
@click="$router.push(link.route)"
>
<font-awesome-icon :icon="link.icon" />
<!-- <img :src="link.image" class="image" :alt="link.icon" /> -->
</el-button>
</el-tooltip>
</div>
</div>
<div class="middle"></div>
<div class="bottom">
<div class="link">
<el-tooltip effect="dark" :content="$t('common.nav.console')" placement="right">
<el-button class="button" @click="onConsole">
<font-awesome-icon icon="fa-solid fa-compass" />
</el-button>
</el-tooltip>
</div>
<div class="link">
<el-tooltip effect="dark" :content="$t('common.nav.logOut')" placement="right">
<el-button class="button" @click="onLogout">
@@ -38,6 +44,7 @@ import {
ROUTE_CHAT_CONVERSATION,
ROUTE_CHAT_CONVERSATION_NEW,
ROUTE_CHAT_INDEX,
ROUTE_CONSOLE_ROOT,
ROUTE_MIDJOURNEY_HISTORY,
ROUTE_MIDJOURNEY_INDEX
} from '@/router/constants';
@@ -78,6 +85,9 @@ export default defineComponent({
console.debug('logout');
this.$store.dispatch('common/resetToken');
this.$router.push({ name: ROUTE_AUTH_LOGIN });
},
onConsole() {
this.$router.push({ name: ROUTE_CONSOLE_ROOT });
}
}
});
+1 -1
View File
@@ -2,7 +2,7 @@
<div class="price-text">
<span v-if="price > 0" class="unfree"
>¥{{ price }} {{ unit ? ` / ${unit}` : '' }}{{ start ? $t('common.message.startPrice') : ''
}}{{ $t('service.message.fromPrice') }}
}}{{ $t('common.message.startPrice') }}
</span>
<span v-else class="free">
{{ $t('common.message.free') }}
+157
View File
@@ -0,0 +1,157 @@
<template>
<div class="side-panel">
<div>
<img src="@/assets/images/logo2.svg" class="logo" @click="onHome" />
</div>
<div class="links">
<a
v-for="(link, linkIndex) in links"
:key="linkIndex"
:class="{ link: true, active: $route.name === link.name }"
@click="onNavigate(link)"
>
<span class="icon">
<font-awesome-icon :icon="link.icon" class="text-sm" />
</span>
<span class="text">{{ link.text }}</span>
<span class="outer">
<font-awesome-icon
v-if="!link.name && link.href"
icon="fa-solid fa-up-right-from-square"
class="text-sm ml-2"
/>
</span>
<span class="suffix"> </span>
</a>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { ROUTE_CONSOLE_APPLICATION_LIST, ROUTE_CONSOLE_ORDER_LIST, ROUTE_INDEX } from '@/router';
import { ElRow, ElCol } from 'element-plus';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
interface ILink {
key: string;
text: string;
name?: string;
href?: string;
icon: string;
admin?: boolean;
}
export default defineComponent({
name: 'Navigator',
components: {
FontAwesomeIcon
},
computed: {
active() {
return this.$route.matched[0].path;
},
user() {
return this.$store.getters.user;
},
links(): ILink[] {
let links: ILink[] = [
{
key: 'application-list',
text: this.$t('console.menu.applicationList'),
name: ROUTE_CONSOLE_APPLICATION_LIST,
icon: 'fa-solid fa-cube'
},
{
key: 'order-list',
text: this.$t('console.menu.orderList'),
name: ROUTE_CONSOLE_ORDER_LIST,
icon: 'fa-solid fa-store'
}
];
return links;
}
},
mounted() {},
methods: {
onHome() {
this.$router.push({
name: ROUTE_INDEX
});
},
onNavigate(link: ILink) {
if (link.name) {
this.$router.push({
name: link.name
});
} else if (link.href) {
window.open(link.href, '_blank');
}
}
}
});
</script>
<style lang="scss" scoped>
$width: 250px;
$padding-left: 10px;
.side-panel {
padding-left: $padding-left;
width: $width;
padding-top: 50px;
border-right: 1px solid var(--el-border-color);
height: 100%;
}
.logo {
width: 100%;
height: 60px;
cursor: pointer;
margin-bottom: 50px;
}
.links {
width: $width;
.link {
$height: 40px;
height: $height;
display: block;
width: calc(100% - #{$padding-left});
border-radius: 6px;
cursor: pointer;
margin-bottom: 5px;
position: relative;
color: #444;
line-height: $height;
padding-left: 10px;
.suffix {
width: 3px;
height: $height;
position: absolute;
right: -5px;
margin-right: 5px;
border-radius: 3px;
display: inline-block;
}
.icon {
width: 16px;
height: 16px;
display: inline-block;
position: relative;
margin-right: 10px;
transform: translateY(-2%);
}
.text {
font-size: 14px;
}
&.active {
.suffix {
background-color: var(--el-color-primary);
}
}
&:hover {
background-color: #ebedf1;
}
}
}
</style>
+180
View File
@@ -0,0 +1,180 @@
<template>
<el-form label-width="100px">
<el-form-item :label="$t('application.field.service')">
<span v-if="application.type === applicationType.API">
{{ application?.api?.title }}
</span>
</el-form-item>
<el-form-item :label="$t('application.field.package')">
<el-radio-group v-if="application.type === applicationType.API" v-model="form.packageId">
<el-radio-button v-for="(pkg, pkgIndex) in application?.api?.packages" :key="pkgIndex" :label="pkg.id">
{{ pkg.amount }}{{ $t(`api.unit.${application?.api?.unit}`) }}
</el-radio-button>
<el-radio-button label="custom">
{{ $t('application.button.custom') }}
</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.packageId === 'custom'" :label="$t('application.field.amount')">
<el-input-number v-model="form.amount" :min="1" :max="10000" controls-position="right" />
</el-form-item>
<el-form-item :label="$t('application.field.price')">
<div v-if="application.type === applicationType.API">
<price
v-if="form.packageId === 'custom'"
:price="application?.api?.price"
:unit="$t(`api.unit.${application?.api?.unit}`)"
/>
<price v-else :price="package?.price" />
</div>
</el-form-item>
<el-divider border-style="dashed" />
<el-form-item :label="$t('application.field.shouldPayPrice')">
<span v-if="form.packageId === 'custom'" :class="{ price: true, unfree: price > 0, free: price === 0 }">
¥{{ price.toFixed(2) }}
</span>
<span v-else-if="package" :class="{ price: true, unfree: package?.price > 0, free: package?.price === 0 }">
¥{{ package?.price?.toFixed(2) }}
</span>
</el-form-item>
<el-form-item>
<el-button type="primary" size="large" class="btn-create" :loading="creating" @click="onCreateOrder">
{{ $t('application.button.createOrder') }}
</el-button>
</el-form-item>
</el-form>
</template>
<script lang="ts">
import { IApplication, IApplicationType, IOrderDetailResponse, IPackage, orderOperator } from '@/operators';
import { defineComponent } from 'vue';
import { ElMessage } from 'element-plus';
import { ROUTE_CONSOLE_ORDER_DETAIL } from '@/router';
import { ElForm, ElFormItem, ElButton, ElInputNumber, ElDivider, ElRadioGroup, ElRadioButton } from 'element-plus';
import Price from '@/components/common/Price.vue';
interface IData {
form: {
amount: number;
packageId: string | undefined;
};
creating: boolean;
applicationType: typeof IApplicationType;
}
export default defineComponent({
name: 'CreateOrderDialog',
components: {
ElForm,
ElFormItem,
ElInputNumber,
ElButton,
ElDivider,
ElRadioGroup,
ElRadioButton,
Price
},
props: {
application: {
type: Object as () => IApplication,
required: true
}
},
data(): IData {
return {
form: {
amount: 1000,
packageId: undefined
},
creating: false,
applicationType: IApplicationType
};
},
computed: {
price() {
if (this.application?.type === IApplicationType.API) {
if (this.application.api?.price && this.form.amount) {
return this.form.amount * this.application.api?.price;
}
}
return 0;
},
package() {
if (this.application?.type === IApplicationType.API) {
if (this.application.api?.packages && this.form.packageId) {
const filterPackages = this.application.api?.packages.filter((item) => item.id === this.form.packageId);
if (filterPackages.length > 0) {
return filterPackages[0];
}
}
}
return undefined;
}
},
mounted() {
this.onInit();
},
methods: {
onInit() {
if (this.application.type === IApplicationType.API) {
if (this.application?.api?.packages && this.application?.api?.packages.length > 0) {
this.form.packageId = this.application?.api?.packages[0].id;
} else {
this.form.packageId = 'custom';
}
}
},
onChangePackage(pkg: IPackage) {
console.log('pkg', pkg);
},
onCreateOrder() {
if (!this.application?.id) {
return;
}
this.creating = true;
orderOperator
.create({
application_id: this.application?.id,
amount: this.form.amount,
...(this.form.packageId !== 'custom' && this.package
? {
package_id: this.package.id
}
: {})
})
.then(({ data: data }: { data: IOrderDetailResponse }) => {
this.creating = false;
const order = data;
this.$router.push({
name: ROUTE_CONSOLE_ORDER_DETAIL,
params: {
id: order.id
}
});
})
.catch(() => {
ElMessage.error(this.$t('order.message.createFailed'));
this.creating = false;
});
}
}
});
</script>
<style lang="scss" scoped>
.price {
font-size: 20px;
font-weight: bold;
&.unfree {
color: #ff5441;
}
&.free {
color: #29c287;
}
}
.btn-create {
width: 150px;
border-radius: 20px;
}
</style>
+93
View File
@@ -0,0 +1,93 @@
<template>
<el-dialog :model-value="visible" :title="$t('application.title.buyService')" width="500px" center>
<p class="text-center">
{{ $t('order.message.buyInExternalUrl') }}
</p>
</el-dialog>
</template>
<script lang="ts">
import { IOrder, IOrderDetailResponse, orderOperator, OrderState } from '@/operators';
import { defineComponent } from 'vue';
import { ElDialog } from 'element-plus';
interface IData {
refreshTimer: number | undefined;
}
export default defineComponent({
name: 'PayOrderDialog',
components: {
ElDialog
},
props: {
modelValue: {
type: Object as () => IOrder,
required: true
},
visible: {
type: Boolean,
required: false,
default: false
}
},
emits: ['hide', 'update:modelValue'],
data(): IData {
return {
refreshTimer: undefined
};
},
watch: {
visible: {
handler(val) {
if (val && this.modelValue.pay_url) {
window.open(this.modelValue.pay_url, '_blank');
}
}
}
},
mounted() {
this.onRefresh();
},
unmounted() {
if (this.refreshTimer) {
clearTimeout(this.refreshTimer);
}
},
methods: {
onRefresh() {
if (!this.modelValue.id) {
console.error('id does not exist');
return;
}
orderOperator
.refresh(this.modelValue.id)
.then(({ data: data }: { data: IOrderDetailResponse }) => {
// if not paid, check for next loop
if (data.state !== OrderState.PAID) {
setTimeout(() => {
this.onRefresh();
}, 2000);
} else {
// paid, just notify parent, and hide the dialog
this.$emit('hide');
}
this.$emit('update:modelValue', data);
})
.catch(() => {
setTimeout(() => {
this.onRefresh();
}, 5000);
});
}
}
});
</script>
<style lang="scss" scoped>
.paycodes {
padding: 30px 0;
width: 500px;
margin: auto;
}
</style>
+111
View File
@@ -0,0 +1,111 @@
<template>
<el-dialog :model-value="visible" :title="$t('application.title.buyService')" width="500px" center>
<el-row class="paycodes">
<el-col :span="12">
<div class="paycode wechat">
<qr-code v-if="modelValue?.pay_url" :value="modelValue?.pay_url" :size="200" class="m-auto" />
<p class="help-text">{{ $t('order.message.wechatPayHelp') }}</p>
</div>
</el-col>
<el-col :span="12">
<div class="help-img">
<img src="https://midas.gtimg.cn/enterprise/images/ep_sys_wx_tip.jpg" />
</div>
</el-col>
</el-row>
</el-dialog>
</template>
<script lang="ts">
import { IOrder, IOrderDetailResponse, orderOperator, OrderState } from '@/operators';
import { defineComponent } from 'vue';
import { ElDialog, ElRow, ElCol } from 'element-plus';
import QrCode from 'qrcode.vue';
interface IData {
refreshTimer: number | undefined;
}
export default defineComponent({
name: 'PayOrderDialog',
components: {
ElDialog,
QrCode,
ElRow,
ElCol
},
props: {
modelValue: {
type: Object as () => IOrder,
required: true
},
visible: {
type: Boolean,
required: false,
default: false
}
},
emits: ['hide', 'update:modelValue'],
data(): IData {
return {
refreshTimer: undefined
};
},
mounted() {
this.onRefresh();
},
unmounted() {
if (this.refreshTimer) {
clearTimeout(this.refreshTimer);
}
},
methods: {
onRefresh() {
if (!this.modelValue.id) {
console.error('id does not exist');
return;
}
orderOperator
.refresh(this.modelValue.id)
.then(({ data: data }: { data: IOrderDetailResponse }) => {
// if not paid, check for next loop
if (data.state !== OrderState.PAID) {
setTimeout(() => {
this.onRefresh();
}, 2000);
} else {
// paid, just notify parent, and hide the dialog
this.$emit('hide');
}
this.$emit('update:modelValue', data);
})
.catch(() => {
setTimeout(() => {
this.onRefresh();
}, 2000);
});
}
}
});
</script>
<style lang="scss" scoped>
.paycodes {
padding: 30px 0;
width: 500px;
margin: auto;
.wechat {
.help-text {
display: block;
background-color: #00c800;
color: white;
font-size: 14px;
height: 35px;
width: 240px;
text-align: center;
line-height: 35px;
margin: 10px auto 0 auto;
}
}
}
</style>
+1
View File
@@ -12,6 +12,7 @@ export default {
credential: '密钥',
name: '名称',
package: '套餐',
price: '价格',
type: '类型',
freeAmount: '免费赠送',
extraPrice: '价格'
+5
View File
@@ -0,0 +1,5 @@
import menu from './menu';
export default {
menu
};
+11
View File
@@ -0,0 +1,11 @@
export default {
orderList: '订单列表',
applicationList: '申请列表',
userProfile: '个人信息',
idVerify: '实名认证',
manageApplication: '申请管理',
distributionIndex: '分销推广',
usageList: '调用记录',
platformTokenIndex: '平台令牌',
manageOrder: '订单管理'
};
+4
View File
@@ -4,9 +4,13 @@ import api from './api';
import setting from './setting';
import midjourney from './midjourney';
import chat from './chat';
import console from './console';
import order from './order';
export default {
chat,
order,
console,
common,
application,
api,
+8
View File
@@ -0,0 +1,8 @@
export default {
pay: '支付',
continuePay: '继续支付',
checkDetail: '查看详情',
query: '查询',
finish: '手动完成',
update: '更新'
};
+12
View File
@@ -0,0 +1,12 @@
export default {
id: '订单号',
amount: '数量',
price: '金额',
description: '订单描述',
state: '状态',
createdAt: '创建时间',
service: '服务名称',
payWay: '支付方式',
api: 'API',
proxy: '代理'
};
+13
View File
@@ -0,0 +1,13 @@
import field from './field';
import button from './button';
import message from './message';
import state from './state';
import title from './title';
export default {
field,
button,
message,
state,
title
};
+10
View File
@@ -0,0 +1,10 @@
export default {
paidSuccessfully: '支付成功',
createFailed: '创建失败',
wechatPayHelp: '请打开手机微信,扫一扫完成支付',
free: '免费',
buyInExternalUrl: '请在外部链接完成付款',
updateFailed: '修改失败',
updateSuccessfully: '修改成功',
confirmFinish: '此操作将手动将订单设置为支付状态且完成分销处理,无法撤销,请确认客户已经完成付款,是否继续?'
};
+6
View File
@@ -0,0 +1,6 @@
export default {
pending: '待支付',
paid: '已支付',
expired: '支付超时',
failed: '支付失败'
};
+7
View File
@@ -0,0 +1,7 @@
export default {
info: '订单信息',
wechatPay: '微信支付',
aliPay: '支付宝',
stripe: 'Stripe',
manageOrder: '管理订单'
};
+46
View File
@@ -0,0 +1,46 @@
<template>
<div class="wrapper">
<div class="left">
<navigator />
</div>
<div class="main">
<side-panel />
<router-view />
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import Navigator from '@/components/common/Navigator.vue';
import SidePanel from '@/components/console/SidePanel.vue';
export default defineComponent({
name: 'LayoutConsole',
components: {
SidePanel,
Navigator
}
});
</script>
<style lang="scss" scoped>
.wrapper {
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
.left {
width: 60px;
height: 100%;
border-right: 1px solid var(--el-border-color);
}
.main {
height: 100%;
width: calc(100% - 60px);
flex: 1;
display: flex;
flex-direction: row;
}
}
</style>
+1
View File
@@ -5,3 +5,4 @@ export * from './chat';
export * from './midjourney';
export * from './usage';
export * from './api';
export * from './order';
+2
View File
@@ -0,0 +1,2 @@
export * from './models';
export * from './operator';
+33
View File
@@ -0,0 +1,33 @@
import { IApplication } from '../application';
export enum OrderState {
PENDING = 'Pending',
PAID = 'Paid',
EXPIRED = 'Expired',
FAILED = 'Failed'
}
export interface IOrder {
id?: string;
description?: string;
state?: OrderState;
price?: number;
amount?: number;
user_id?: number;
created_at?: string;
updated_at?: string;
application?: IApplication;
application_id?: string;
wechatpay_url?: string;
pay_id?: string;
pay_url?: string;
alipay_url?: string;
pay_way?: string;
}
export interface IOrderListResponse {
count: number;
items: IOrder[];
}
export type IOrderDetailResponse = IOrder;
+55
View File
@@ -0,0 +1,55 @@
import { AxiosResponse } from 'axios';
import { httpClient } from '../instance';
import { IOrder, IOrderDetailResponse, IOrderListResponse } from './models';
export interface IOrderQuery {
user_id?: string;
package_id?: string;
offset?: number;
limit?: number;
ordering: string;
}
class OrderService {
key = 'orders';
async getAll(query: IOrderQuery): Promise<AxiosResponse<IOrderListResponse>> {
return await httpClient.get(`/${this.key}/`, {
params: query
});
}
async get(id: string): Promise<AxiosResponse<IOrderDetailResponse>> {
return await httpClient.get(`/${this.key}/${id}`);
}
async create(data: IOrder): Promise<AxiosResponse<IOrderDetailResponse>> {
return await httpClient.post(`/${this.key}/`, data);
}
async update(id: string, data: IOrder): Promise<AxiosResponse<IOrderDetailResponse>> {
return await httpClient.put(`/${this.key}/${id}`, data);
}
async refresh(id: string): Promise<AxiosResponse<IOrderDetailResponse>> {
return await httpClient.post(`/${this.key}/${id}/refresh/`);
}
async pay(id: string, data: IOrder): Promise<AxiosResponse<IOrderDetailResponse>> {
return await httpClient.post(`/${this.key}/${id}/pay/`, data);
}
async updatePrice(id: string, data: IOrder): Promise<AxiosResponse<IOrderDetailResponse>> {
return await httpClient.post(`/${this.key}/${id}/update-price/`, data);
}
async finish(id: string): Promise<AxiosResponse<IOrderDetailResponse>> {
return await httpClient.post(`/${this.key}/${id}/finish/`);
}
async delete(id: string): Promise<AxiosResponse<null>> {
return await httpClient.delete(`/${this.key}/${id}`);
}
}
export const orderOperator = new OrderService();
+2 -4
View File
@@ -46,7 +46,6 @@ import ApiStatus from '@/components/common/ApiStatus.vue';
import { ROUTE_CHAT_CONVERSATION, ROUTE_CHAT_CONVERSATION_NEW } from '@/router';
import { Status } from '@/store/common/models';
import { log } from '@/utils/log';
import { ComponentCommonHelpEntry as HelpEntry } from '@zhishuyun/data';
export interface IData {
question: string;
@@ -60,8 +59,7 @@ export default defineComponent({
InputBox,
ModelSelector,
Message,
ApiStatus,
HelpEntry
ApiStatus
},
data(): IData {
return {
@@ -276,7 +274,7 @@ export default defineComponent({
}
.bottom {
width: 100%;
height: 110px;
height: 90px;
}
}
</style>
+95
View File
@@ -0,0 +1,95 @@
<template>
<el-row class="panel">
<el-col :span="24">
<el-row>
<el-col :span="24">
<h2 class="title">{{ $t('common.title.buyMore') }}</h2>
</el-col>
</el-row>
<el-row>
<el-col :span="12" :offset="6">
<el-skeleton v-if="loading" />
<create-order v-else-if="application" :application="application" />
</el-col>
</el-row>
</el-col>
</el-row>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { applicationOperator, IApplication, IApplicationDetailResponse } from '@/operators';
import CreateOrder from '@/components/order/Create.vue';
import { ElRow, ElCol, ElCard, ElSkeleton } from 'element-plus';
interface IData {
application: IApplication | undefined;
loading: boolean;
}
export default defineComponent({
name: 'ConsoleApplicationBuy',
components: {
CreateOrder,
ElSkeleton,
ElRow,
ElCol
},
data(): IData {
return {
application: undefined,
loading: false
};
},
computed: {
id() {
return this.$route.params?.id?.toString();
}
},
mounted() {
this.onFetchData();
},
methods: {
onFetchData() {
this.loading = true;
applicationOperator
.get(this.id)
.then(({ data: data }: { data: IApplicationDetailResponse }) => {
this.application = data;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
}
}
});
</script>
<style lang="scss" scoped>
.title {
font-size: 26px;
font-weight: bold;
margin-bottom: 20px;
color: #333;
}
.el-card {
min-height: 500px;
padding-top: 50px;
}
.panel {
padding: 30px;
width: calc(100% - 250px);
.credential {
.copy {
cursor: pointer;
}
}
}
.pagination {
float: right;
}
</style>
+241
View File
@@ -0,0 +1,241 @@
<template>
<el-row class="panel">
<el-col :span="24">
<el-row>
<el-col :span="24">
<h2 class="title">{{ $t('common.title.allApplications') }}</h2>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-table v-loading="loading" :data="applications" stripe table-layout="fixed">
<el-table-column prop="id" :label="$t('application.field.id')" width="300px" class-name="text-center">
<template #default="scope">
<span>{{ scope.row.id }}</span>
<span class="copy">
<copy-to-clipboard :content="scope?.row?.id" />
</span>
</template>
</el-table-column>
<el-table-column :label="$t('application.field.name')" width="220px">
<template #default="scope">
<span v-if="scope.row.type === applicationType.API">{{ scope.row?.api?.title }}</span>
</template>
</el-table-column>
<el-table-column
prop="remaining_amount"
:label="$t('application.field.remainingAmount')"
width="120px"
class-name="text-center"
>
<template #default="scope">
<span>{{ getRemainingAmount(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column
prop="used_amount"
:label="$t('application.field.usedAmount')"
width="120px"
class-name="text-center"
>
<template #default="scope">
<span>{{ getUsedAmount(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" width="100px">
<template #default="scope">
<div class="float-right">
<el-button type="primary" @click="onBuyMore(scope?.row)">
{{ $t('application.button.buyMore') }}
</el-button>
</div>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<el-row>
<el-col :span="10" :offset="14">
<div class="pagination m-v-lg">
<pagination :current-page="page" :page-size="limit" :total="total" @change="onPageChange"> </pagination>
</div>
</el-col>
</el-row>
</el-col>
</el-row>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import {
applicationOperator,
IApplication,
IApplicationListResponse,
IApplicationType,
ICredentialType
} from '@/operators';
import Pagination from '@/components/common/Pagination.vue';
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
import { ElTable, ElRow, ElCol, ElTableColumn, ElButton } from 'element-plus';
import { ROUTE_CONSOLE_APPLICATION_BUY } from '@/router/constants';
interface IData {
applications: IApplication[];
loading: boolean;
total: number | undefined;
limit: number;
buying: boolean;
form: {
amount: number | undefined;
};
active: {
application: IApplication | undefined;
};
applicationType: typeof IApplicationType;
credentialType: typeof ICredentialType;
}
export default defineComponent({
name: 'ConsoleApplicationList',
components: {
Pagination,
CopyToClipboard,
ElTable,
ElRow,
ElCol,
ElTableColumn,
ElButton
},
data(): IData {
return {
credentialType: ICredentialType,
applicationType: IApplicationType,
applications: [],
loading: false,
total: undefined,
buying: false,
// dynamic calculate the limit according to window height
limit: Math.floor((window.innerHeight - 200) / 50),
form: {
amount: 1
},
active: {
application: undefined
}
};
},
computed: {
redirect() {
return this.$route.query?.redirect;
},
page() {
return parseInt(this.$route.query.page?.toString() || '1');
},
type() {
return (this.$route.query.type?.toString() || IApplicationType.API) as IApplicationType;
}
},
watch: {
page: {
handler() {
this.onFetchData();
}
},
type: {
handler() {
this.onFetchData();
}
}
},
mounted() {
this.onFetchData();
},
methods: {
onFilterType(type: string) {
if (type === this.type) {
return;
}
this.$router.push({
...this.$route,
query: {
...this.$route.query,
page: 1,
type
}
});
},
onBuyMore(application: IApplication) {
this.$router.push({
name: ROUTE_CONSOLE_APPLICATION_BUY,
params: {
id: application.id
}
});
},
onPageChange(page: number) {
this.$router.push({
name: this.$route.name?.toString(),
query: {
...this.$route.query,
page: page
}
});
},
onFetchData() {
this.loading = true;
applicationOperator
.getAll({
limit: this.limit,
offset: (this.page - 1) * this.limit,
user_id: this.$store.getters.user.id,
type: this.type,
ordering: '-created_at'
})
.then(({ data: data }: { data: IApplicationListResponse }) => {
this.applications = data.items;
this.loading = false;
this.total = data.count;
})
.catch(() => {
this.loading = false;
});
},
getRemainingAmount(application: IApplication) {
if (application.type === IApplicationType.API) {
const unit = this.$t(`api.unit.${application?.api?.unit}`);
return `${application.remaining_amount}${unit}`;
}
},
getUsedAmount(application: IApplication) {
if (application.type === IApplicationType.API) {
const unit = this.$t(`api.unit.${application?.api?.unit}`);
return `${application.used_amount}${unit}`;
}
}
}
});
</script>
<style lang="scss" scoped>
.panel {
padding: 30px;
width: calc(100% - 250px);
.title {
font-size: 26px;
font-weight: bold;
margin-bottom: 20px;
color: #333;
}
.el-table {
min-height: calc(100vh - 350px);
margin-bottom: 50px;
.el-button {
border-radius: 20px;
}
}
}
.pagination {
float: right;
}
</style>
+325
View File
@@ -0,0 +1,325 @@
<template>
<el-row class="panel">
<el-col :span="24">
<el-row>
<el-col :span="24">
<h2 class="title">{{ $t('order.title.info') }}</h2>
</el-col>
</el-row>
<el-row>
<el-col :span="12" :offset="6">
<div v-if="loading" class="pt-5">
<el-skeleton animated />
</div>
<div v-else class="order">
<el-descriptions :column="1">
<el-descriptions-item :label="$t('order.field.id')">{{ order?.id }}</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.description')">
{{ order?.description }}
</el-descriptions-item>
<el-descriptions-item
v-if="order?.application?.type === applicationType.API"
:label="$t('order.field.api')"
>
{{ order?.application?.api?.title }}
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.amount')">
<span v-if="order?.application?.type === applicationType.API">
{{ order?.amount }}{{ $t(`api.unit.${order?.application?.api?.unit}`) }}
</span>
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.createdAt')">
{{ $dayjs.format(order?.created_at) }}
</el-descriptions-item>
<el-descriptions-item :label="$t('order.field.price')">
<span v-if="order?.price && order?.price > 0" class="price unfree">
¥{{ order?.price?.toFixed(2) }}
</span>
<span v-else class="price free"> {{ $t('order.message.free') }} </span>
</el-descriptions-item>
<el-descriptions-item v-if="order?.pay_way" :label="$t('order.field.payWay')">
<span v-if="order?.pay_way === PayWay.WechatPay">
{{ $t('order.title.wechatPay') }}
</span>
<span v-if="order?.pay_way === PayWay.AliPay">
{{ $t('order.title.aliPay') }}
</span>
<span v-if="order?.pay_way === PayWay.Stripe">
{{ $t('order.title.stripe') }}
</span>
</el-descriptions-item>
</el-descriptions>
</div>
</el-col>
</el-row>
<el-row v-if="order?.state === OrderState.PAID" class="mb-5">
<el-col :span="12" :offset="6">
<el-divider border-style="dashed" />
<el-alert :title="$t('order.message.paidSuccessfully')" type="success" show-icon :closable="false" />
</el-col>
</el-row>
<el-row v-if="order?.state === OrderState.PENDING || order?.state === OrderState.FAILED">
<el-col :span="12" :offset="6">
<el-divider border-style="dashed" />
<div v-if="order.price && order.price > 0 && !order.pay_way" class="payways mb-4">
<div
:class="{
payway: true,
wechatpay: true,
active: payWay === PayWay.WechatPay
}"
@click="payWay = PayWay.WechatPay"
>
<span class="payicon wechatpay"></span>
{{ $t('order.title.wechatPay') }}
</div>
<div
v-if="false"
:class="{
payway: true,
alipay: true,
active: payWay === PayWay.AliPay
}"
@click="payWay = PayWay.AliPay"
>
<span class="payicon alipay"></span>
{{ $t('order.title.aliPay') }}
</div>
<div
v-if="false"
:class="{
payway: true,
stripe: true,
active: payWay === PayWay.Stripe
}"
@click="payWay = PayWay.Stripe"
>
<span class="payicon stripe"></span>
{{ $t('order.title.stripe') }}
</div>
</div>
<div v-if="!order?.pay_way">
<el-button :loading="prepaying" type="primary" size="large" class="btn-pay" @click="onPay">{{
$t('common.button.pay')
}}</el-button>
</div>
<div v-else>
<el-button type="primary" size="large" class="btn-repay" @click="onRepay">{{
$t('common.button.repay')
}}</el-button>
</div>
</el-col>
</el-row>
</el-col>
</el-row>
<wechat-pay-order
v-if="order && payWay === PayWay.WechatPay"
v-model="order"
:visible="paying"
@hide="paying = false"
/>
<stripe-pay-order v-if="order && payWay === PayWay.Stripe" v-model="order" :visible="paying" @hide="paying = false" />
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { IOrder, IOrderDetailResponse, orderOperator, OrderState } from '@/operators/order';
import {
ElRow,
ElCol,
ElSkeleton,
ElDivider,
ElAlert,
ElDescriptions,
ElDescriptionsItem,
ElButton
} from 'element-plus';
import WechatPayOrder from '@/components/order/WechatPay.vue';
import StripePayOrder from '@/components/order/StripePay.vue';
import { IApplicationType } from '@/operators';
enum PayWay {
WechatPay = 'WechatPay',
Stripe = 'Stripe',
AliPay = 'AliPay'
}
interface IData {
PayWay: typeof PayWay;
OrderState: typeof OrderState;
payWay: PayWay | undefined;
order: IOrder | undefined;
loading: boolean;
paying: boolean;
prepaying: boolean;
applicationType: typeof IApplicationType;
}
export default defineComponent({
name: 'ConsoleOrderDetail',
components: {
ElButton,
ElRow,
ElCol,
ElSkeleton,
ElDivider,
ElAlert,
ElDescriptions,
ElDescriptionsItem,
WechatPayOrder,
StripePayOrder
},
data(): IData {
return {
PayWay: PayWay,
payWay: PayWay.WechatPay,
OrderState: OrderState,
order: undefined,
loading: false,
paying: false,
prepaying: false,
applicationType: IApplicationType
};
},
computed: {
id() {
return this.$route.params?.id?.toString();
},
redirect() {
return this.$route.query?.redirect;
}
},
watch: {
order: {
handler(val) {
if (val?.state === OrderState.PAID) {
setTimeout(() => {
if (this.redirect) {
window.location.replace(this.redirect?.toString());
}
}, 2000);
return;
}
},
deep: true
}
},
mounted() {
this.onFetchData();
},
methods: {
onFetchData() {
this.loading = true;
orderOperator
.refresh(this.id)
.then(({ data: data }: { data: IOrderDetailResponse }) => {
this.order = data;
if (data.pay_way) {
// @ts-ignore
this.payWay = data.pay_way;
}
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
onRepay() {
this.paying = true;
},
onPay() {
this.prepaying = true;
orderOperator
.pay(this.id, {
pay_way: this.payWay
})
.then(({ data: data }: { data: IOrderDetailResponse }) => {
this.prepaying = false;
this.order = data;
if (this.order.price && this.order.price > 0) {
this.paying = true;
}
})
.catch(() => {
this.prepaying = false;
});
}
}
});
</script>
<style lang="scss" scoped>
.panel {
padding: 30px;
width: calc(100% - 250px);
.title {
font-size: 26px;
font-weight: bold;
margin-bottom: 20px;
color: #333;
}
}
.order {
padding-top: 50px;
.price {
font-size: 20px;
font-weight: bold;
&.unfree {
color: #ff5441;
}
&.free {
color: #29c287;
}
}
}
.payways {
overflow: hidden;
.payway {
cursor: pointer;
font-size: 14px;
float: left;
width: 120px;
line-height: 40px;
text-align: center;
height: 40px;
border: 1px solid #eee;
&.active {
border: 1px solid #3879d1;
}
}
.payicon {
width: 20px;
height: 20px;
margin-top: 2px;
display: inline-block;
&.wechatpay {
position: relative;
top: 3px;
width: 22px;
height: 19px;
background-image: url(//midas.gtimg.cn/enterprise/images/ep_new_sprites@2x.png);
background-repeat: no-repeat;
background-size: 60px 250px;
background-position: 0 -50px;
}
&.stripe {
position: relative;
top: 3px;
width: 22px;
height: 18px;
background-image: url(https://zhishuyun-1256437459.cos.ap-beijing.myqcloud.com/2023-08-27-164440.png);
background-size: contain;
background-repeat: no-repeat;
}
}
}
.btn-pay,
.btn-repay {
width: 150px;
border-radius: 20px;
}
</style>
+207
View File
@@ -0,0 +1,207 @@
<template>
<el-row class="panel">
<el-col :span="24">
<el-row>
<el-col :span="24">
<h2 class="title">{{ $t('common.title.allOrders') }}</h2>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-table v-loading="loading" :data="orders" stripe>
<el-table-column prop="id" :label="$t('order.field.id')" class-name="text-center" width="350px">
<template #default="scope">
<span class="key">{{ scope.row.id }}</span>
<span class="copy">
<copy-to-clipboard :content="scope.row.id" />
</span>
</template>
</el-table-column>
<el-table-column :label="$t('order.field.price')" width="100px">
<template #default="scope">
<span class="price">¥{{ scope.row?.price?.toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('order.field.createdAt')" width="180px">
<template #default="scope">
<span class="created-at">{{ $dayjs.format(scope.row.created_at) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('order.field.description')" width="300px">
<template #default="scope">
<span class="description">{{ scope.row.description }}</span>
</template>
</el-table-column>
<el-table-column prop="state" :label="$t('order.field.state')" class-name="text-center">
<template #default="scope">
<span v-if="scope.row.state === OrderState?.PENDING">
<el-tag type="info" class="mx-1" effect="dark">{{ $t('order.state.pending') }}</el-tag>
</span>
<span v-else-if="scope.row.state === OrderState?.PAID" class="state state-paid">
<el-tag type="success" class="mx-1" effect="dark">{{ $t('order.state.paid') }}</el-tag>
</span>
<span v-else-if="scope.row.state === OrderState?.EXPIRED" class="state state-expired">
<el-tag type="warning" class="mx-1" effect="dark">{{ $t('order.state.expired') }}</el-tag>
</span>
<span v-else-if="scope.row.state === OrderState?.FAILED" class="state state-failed">
<el-tag type="danger" class="mx-1" effect="dark"> {{ $t('order.state.failed') }}</el-tag>
</span>
</template>
</el-table-column>
<el-table-column min-width="120px">
<template #default="scope">
<div class="float-right">
<el-button
v-if="scope.row.state !== OrderState.PAID"
type="primary"
@click="
$router.push({
name: 'console-order-detail',
params: {
id: scope.row.id
}
})
"
>
{{ $t('order.button.continuePay') }}
</el-button>
<el-button
v-else
@click="
$router.push({
name: 'console-order-detail',
params: {
id: scope.row.id
}
})
"
>
{{ $t('order.button.checkDetail') }}
</el-button>
</div>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<el-row>
<el-col :span="10" :offset="14">
<div class="pagination m-v-lg">
<pagination :current-page="page" :page-size="limit" :total="total" @change="onPageChange"> </pagination>
</div>
</el-col>
</el-row>
</el-col>
</el-row>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { IOrder, IOrderListResponse, orderOperator, OrderState } from '@/operators/order';
import Pagination from '@/components/common/Pagination.vue';
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
import { ElRow, ElCol, ElTable, ElTableColumn, ElButton, ElTag, ElCard } from 'element-plus';
interface IData {
orders: IOrder[];
loading: boolean;
total: number | undefined;
limit: number;
OrderState: typeof OrderState;
}
export default defineComponent({
name: 'ConsoleOrderList',
components: {
Pagination,
CopyToClipboard,
ElRow,
ElCol,
ElTable,
ElTableColumn,
ElButton,
ElTag,
ElCard
},
data(): IData {
return {
OrderState: OrderState,
orders: [],
loading: false,
total: undefined,
// dynamic calculate the limit according to window height
limit: Math.floor((window.innerHeight - 200) / 50)
};
},
computed: {
redirect() {
return this.$route.query.redirect;
},
page() {
return parseInt(this.$route.query.page?.toString() || '1');
}
},
watch: {
page: {
handler() {
this.onFetchData();
}
}
},
mounted() {
this.onFetchData();
},
methods: {
onPageChange(page: number) {
this.$router.push({
name: this.$route.name?.toString(),
query: {
page: page
}
});
},
onFetchData() {
this.loading = true;
orderOperator
.getAll({
ordering: '-created_at',
limit: this.limit,
offset: (this.page - 1) * this.limit,
user_id: this.$store.getters.user.id
})
.then(({ data: data }: { data: IOrderListResponse }) => {
this.orders = data.items;
this.loading = false;
this.total = data.count;
})
.catch(() => {
this.loading = false;
});
}
}
});
</script>
<style lang="scss" scoped>
.panel {
padding: 30px;
width: calc(100% - 250px);
.title {
font-size: 26px;
font-weight: bold;
margin-bottom: 20px;
color: #333;
}
.el-table {
min-height: calc(100vh - 300px);
margin-bottom: 50px;
.el-button {
border-radius: 20px;
}
}
}
.pagination {
float: right;
}
</style>
+7 -1
View File
@@ -8,6 +8,7 @@ import {
faClock as faRegularClock
} from '@fortawesome/free-regular-svg-icons';
import {
faCompass as faSolidCompass,
faLocationArrow as faSolidLocationArrow,
faPaperclip as faSolidPaperclip,
faHashtag as faSolidHashtag,
@@ -30,6 +31,7 @@ import {
faBolt as faSolidBolt,
faQuestion as faSolidQuestion,
faWind as faSolidWind,
faStore as faSolidStore,
faTrash as faSolidTrash,
faChevronDown as faSolidChevronDown,
faArrowsRotate as faSolidArrowsRotate,
@@ -37,9 +39,13 @@ import {
faArrowRightFromBracket as faSolidArrowRightFromBracket,
faTriangleExclamation as faSolidTriangleExclamation,
faPenToSquare as faSolidPenToSquare,
faXmark as faSolidXmark
faXmark as faSolidXmark,
faCube as faSolidCube
} from '@fortawesome/free-solid-svg-icons';
library.add(faRegularCopy);
library.add(faSolidStore);
library.add(faSolidCube);
library.add(faSolidCompass);
library.add(faSolidPaperclip);
library.add(faSolidXmark);
library.add(faSolidRotateRight);
+44
View File
@@ -0,0 +1,44 @@
import {
ROUTE_CONSOLE_APPLICATION_BUY,
ROUTE_CONSOLE_APPLICATION_LIST,
ROUTE_CONSOLE_ORDER_DETAIL,
ROUTE_CONSOLE_ORDER_LIST,
ROUTE_CONSOLE_ROOT
} from './constants';
export default {
path: '/console',
meta: {
auth: true
},
component: () => import('@/layouts/Console.vue'),
children: [
{
path: '',
name: ROUTE_CONSOLE_ROOT,
redirect: {
name: ROUTE_CONSOLE_APPLICATION_LIST
}
},
{
path: 'orders',
name: ROUTE_CONSOLE_ORDER_LIST,
component: () => import('@/pages/console/order/List.vue')
},
{
path: 'orders/:id',
name: ROUTE_CONSOLE_ORDER_DETAIL,
component: () => import('@/pages/console/order/Detail.vue')
},
{
path: 'applications',
name: ROUTE_CONSOLE_APPLICATION_LIST,
component: () => import('@/pages/console/application/List.vue')
},
{
path: 'applications/:id/buy',
name: ROUTE_CONSOLE_APPLICATION_BUY,
component: () => import('@/pages/console/application/Buy.vue')
}
]
};
+6
View File
@@ -9,3 +9,9 @@ export const ROUTE_CHAT_CONVERSATION_NEW = 'chat-conversation-new';
export const ROUTE_MIDJOURNEY_INDEX = 'midjourney-index';
export const ROUTE_MIDJOURNEY_HISTORY = 'midjourney-history';
export const ROUTE_CONSOLE_ROOT = 'console-root';
export const ROUTE_CONSOLE_ORDER_LIST = 'console-order-list';
export const ROUTE_CONSOLE_ORDER_DETAIL = 'console-order-detail';
export const ROUTE_CONSOLE_APPLICATION_LIST = 'console-application-list';
export const ROUTE_CONSOLE_APPLICATION_BUY = 'console-application-buy';
+2
View File
@@ -1,5 +1,6 @@
import { createRouter, createWebHistory } from 'vue-router';
import auth from './auth';
import console from './console';
import chat from './chat';
import midjourney from './midjourney';
import { ROUTE_CHAT_INDEX, ROUTE_INDEX } from './constants';
@@ -12,6 +13,7 @@ const routes = [
name: ROUTE_CHAT_INDEX
}
},
console,
auth,
chat,
midjourney
+3 -97
View File
@@ -338,11 +338,6 @@
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
"@kurkle/color@^0.3.0":
version "0.3.2"
resolved "https://registry.yarnpkg.com/@kurkle/color/-/color-0.3.2.tgz#5acd38242e8bde4f9986e7913c8fdf49d3aa199f"
integrity sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==
"@lezer/common@^1.0.0":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@lezer/common/-/common-1.0.2.tgz#8fb9b86bdaa2ece57e7d59e5ffbcb37d71815087"
@@ -534,21 +529,6 @@
"@sentry/utils" "7.34.0"
tslib "^1.9.3"
"@sindresorhus/slugify@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@sindresorhus/slugify/-/slugify-2.2.1.tgz#fa2e2e25d6e1e74a2eeb5e2c37f5ccc516ed2c4b"
integrity sha512-MkngSCRZ8JdSOCHRaYd+D01XhvU3Hjy6MGl06zhOk614hp9EOAp5gIkBeQg7wtmxpitU6eAL4kdiRMcJa2dlrw==
dependencies:
"@sindresorhus/transliterate" "^1.0.0"
escape-string-regexp "^5.0.0"
"@sindresorhus/transliterate@^1.0.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/transliterate/-/transliterate-1.6.0.tgz#2309fff65a868047e6d2dd70dec747c5b36a8327"
integrity sha512-doH1gimEu3A46VX6aVxpHTeHrytJAG6HgdxntYnCFiIFHEM/ZGpG8KiZGBChchjQmG0XFIBL552kBTjVcMZXwQ==
dependencies:
escape-string-regexp "^5.0.0"
"@types/estree@0.0.39":
version "0.0.39"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
@@ -945,53 +925,6 @@
dependencies:
vue-demi "*"
"@zhishuyun/data@^0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@zhishuyun/data/-/data-0.1.0.tgz#07d92b3f448aa0ae465e5b4840fa303681b54cdc"
integrity sha512-hB1GP7lv+OIitm5jvTpLfzkdPSQVBl+XHOHTrargdKAH3AZBJx8at0rCGshRkGfw4Jq8tCrVTZSSCZ/l/AdJGw==
dependencies:
"@codemirror/lang-java" "^6.0.1"
"@codemirror/lang-javascript" "^6.1.2"
"@codemirror/lang-json" "^6.0.1"
"@codemirror/lang-php" "^6.0.1"
"@codemirror/lang-python" "^6.1.1"
"@codemirror/theme-one-dark" "^6.1.0"
"@fortawesome/fontawesome-svg-core" "^6.2.1"
"@fortawesome/free-brands-svg-icons" "^6.2.1"
"@fortawesome/free-regular-svg-icons" "^6.2.1"
"@fortawesome/free-solid-svg-icons" "^6.2.1"
"@fortawesome/vue-fontawesome" "^3.0.2"
"@sentry/tracing" "^7.34.0"
"@sentry/vue" "^7.34.0"
"@sindresorhus/slugify" "^2.2.1"
"@types/mustache" "^4.2.2"
"@types/uuid" "^8.3.4"
axios "^0.22.0"
chart.js "^4.3.0"
codemirror "^6.0.1"
copy-to-clipboard "^3.3.3"
dayjs "^1.10.7"
element-plus "^2.2.28"
github-markdown-css "^5.1.0"
highlight.js "^11.7.0"
jwt-decode "^3.1.2"
markdown-it "^13.0.1"
markdown-it-anchor "^8.6.7"
mustache "^4.2.0"
programming-languages-logos "^0.0.3"
qrcode.vue "^3.3.3"
query-string "^8.1.0"
typescript-cookie "^1.0.3"
url-join "^5.0.0"
uuid "^8.3.2"
vue "^3.2.6"
vue-chartjs "^5.2.0"
vue-codemirror "^6.1.1"
vue-i18n "^9.1.7"
vue-router "^4.0.11"
vuex "^4.0.2"
vuex-persistedstate "^4.0.0"
acorn-jsx@^5.3.1:
version "5.3.2"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
@@ -1216,9 +1149,9 @@ camelcase-css@^2.0.1:
integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==
caniuse-lite@^1.0.30001286, caniuse-lite@^1.0.30001297:
version "1.0.30001307"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001307.tgz#27a67f13ebc4aa9c977e6b8256a11d5eafb30f27"
integrity sha512-+MXEMczJ4FuxJAUp0jvAl6Df0NI/OfW1RWEE61eSmzS7hw6lz4IKutbhbXendwq8BljfFuHtu26VWsg4afQ7Ng==
version "1.0.30001572"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001572.tgz"
integrity sha512-1Pbh5FLmn5y4+QhNyJE9j3/7dK44dGB83/ZMjv/qJk86TvDbjk0LosiZo0i0WB0Vx607qMX9jYrn1VLHCkN4rw==
chalk@^2.0.0:
version "2.4.2"
@@ -1237,13 +1170,6 @@ chalk@^4.0.0, chalk@^4.1.2:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
chart.js@^4.3.0:
version "4.4.1"
resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-4.4.1.tgz#ac5dc0e69a7758909158a96fe80ce43b3bb96a9f"
integrity sha512-C74QN1bxwV1v2PEujhmKjOZ7iUM4w6BWs23Md/6aOZZSlwMzeCIDGuZay++rBgChYru7/+QFeoQW0fQoP534Dg==
dependencies:
"@kurkle/color" "^0.3.0"
"chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.2, chokidar@^3.5.3:
version "3.5.3"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
@@ -1769,11 +1695,6 @@ escape-string-regexp@^4.0.0:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
escape-string-regexp@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8"
integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==
eslint-config-prettier@^8.5.0:
version "8.5.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1"
@@ -2570,11 +2491,6 @@ jsonfile@^6.0.1:
optionalDependencies:
graceful-fs "^4.1.6"
jwt-decode@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-3.1.2.tgz#3fb319f3675a2df0c2895c8f5e9fa4b67b04ed59"
integrity sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==
levn@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
@@ -2669,11 +2585,6 @@ magic-string@^0.30.3:
dependencies:
"@jridgewell/sourcemap-codec" "^1.4.15"
markdown-it-anchor@^8.6.7:
version "8.6.7"
resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz#ee6926daf3ad1ed5e4e3968b1740eef1c6399634"
integrity sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==
markdown-it@^13.0.1:
version "13.0.1"
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-13.0.1.tgz#c6ecc431cacf1a5da531423fc6a42807814af430"
@@ -3545,11 +3456,6 @@ vite@^2.9.0:
optionalDependencies:
fsevents "~2.3.2"
vue-chartjs@^5.2.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/vue-chartjs/-/vue-chartjs-5.3.0.tgz#59920a07d72f37a2375d495256e486b92813bf6e"
integrity sha512-8XqX0JU8vFZ+WA2/knz4z3ThClduni2Nm0BMe2u0mXgTfd9pXrmJ07QBI+WAij5P/aPmPMX54HCE1seWL37ZdQ==
vue-codemirror@^6.1.1:
version "6.1.1"
resolved "https://registry.yarnpkg.com/vue-codemirror/-/vue-codemirror-6.1.1.tgz#246697ef4cfa6b2448dd592ade214bb7ff86611f"