Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(costcenter): fix get price error #4007

Merged
merged 1 commit into from Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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>
Expand Down
@@ -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';
Expand All @@ -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`,
Expand Down
4 changes: 2 additions & 2 deletions frontend/providers/costcenter/src/pages/api/price/index.ts
@@ -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';
Expand All @@ -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`,
Expand Down