fix(costcenter): fix get price error (#4007)

This commit is contained in:
xudaotutou
2023-09-27 17:05:51 +08:00
committed by GitHub
parent b90a17e6f5
commit 0a45da3c74
3 changed files with 8 additions and 5 deletions
@@ -122,7 +122,10 @@ export function CommonBillingTable({ data }: { data: BillingItem[] }) {
orderId={item.order_id}
time={item.time}
appType={item.appType}
isDisabled={['TERMINAL', 'OTHER'].includes(item.appType)}
isDisabled={
['TERMINAL', 'OTHER'].includes(item.appType) ||
item.type !== BillingType.CONSUME
}
/>
</Td>
</Tr>
@@ -1,5 +1,5 @@
import { authSession } from '@/service/backend/auth';
import { CRDMeta, GetCRD } from '@/service/backend/kubernetes';
import { CRDMeta, GetCRD, GetUserDefaultNameSpace } from '@/service/backend/kubernetes';
import { jsonRes } from '@/service/backend/response';
import type { NextApiRequest, NextApiResponse } from 'next';
import { ApplyYaml } from '@/service/backend/kubernetes';
@@ -11,7 +11,7 @@ export default async function handler(req: NextApiRequest, resp: NextApiResponse
if (user === null) {
return jsonRes(resp, { code: 403, message: 'user null' });
}
const namespace = kc.getContexts()[0].namespace || 'ns-' + user.name;
const namespace = GetUserDefaultNameSpace(user.name);
const name = new Date().getTime() + 'appquery';
const crdSchema = {
apiVersion: `account.sealos.io/v1`,
@@ -1,5 +1,5 @@
import { authSession } from '@/service/backend/auth';
import { CRDMeta, GetCRD } from '@/service/backend/kubernetes';
import { CRDMeta, GetCRD, GetUserDefaultNameSpace } from '@/service/backend/kubernetes';
import { jsonRes } from '@/service/backend/response';
import type { NextApiRequest, NextApiResponse } from 'next';
import { ApplyYaml } from '@/service/backend/kubernetes';
@@ -14,7 +14,7 @@ export default async function handler(req: NextApiRequest, resp: NextApiResponse
if (user === null) {
return jsonRes(resp, { code: 403, message: 'user null' });
}
const namespace = kc.getContexts()[0].namespace || 'ns-' + user.name;
const namespace = GetUserDefaultNameSpace(user.name);
const name = 'price';
const crdSchema = {
apiVersion: `account.sealos.io/v1`,