Begin service token v3

This commit is contained in:
Tuan Dang
2023-09-18 22:15:48 +01:00
parent 4765dd0696
commit 1cdd840485
6 changed files with 62 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
import { Document, Schema, Types, model } from "mongoose";
export interface IServiceTokenV3 extends Document {
_id: Types.ObjectId;
name: string;
workspace: Types.ObjectId;
publicKey: string;
}
const serviceTokenV3Schema = new Schema(
{
name: {
type: String,
required: true
},
workspace: {
type: Schema.Types.ObjectId,
ref: "Workspace",
required: true
},
publicKey: {
type: String,
required: true
}
}
);
export const ServiceTokenV3 = model<IServiceTokenV3>("ServiceTokenV3", serviceTokenV3Schema);

View File

@@ -1,7 +1,11 @@
import { ServiceTokenSection } from "../ServiceTokenSection";
import { ServiceTokenV3Section } from "../ServiceTokenV3Section";
export const ProjectServiceTokensTab = () => {
return (
<ServiceTokenSection />
<>
<ServiceTokenV3Section />
<ServiceTokenSection />
</>
);
}

View File

@@ -0,0 +1,7 @@
export const AddServiceTokenV3Modal = () => {
return (
<div>
AddServiceTokenV3Modal
</div>
);
}

View File

@@ -0,0 +1,14 @@
import { AddServiceTokenV3Modal } from "./AddServiceTokenV3Modal";
import { ServiceTokenV3Table } from "./ServiceTokenV3Table";
export const ServiceTokenV3Section = () => {
return (
<div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
<p className="text-xl font-semibold text-mineshaft-100">
Service Tokens 2.0
</p>
<ServiceTokenV3Table />
<AddServiceTokenV3Modal />
</div>
);
}

View File

@@ -0,0 +1,7 @@
export const ServiceTokenV3Table = () => {
return (
<div>
ServiceTokenV3Table
</div>
);
}

View File

@@ -0,0 +1 @@
export { ServiceTokenV3Section } from "./ServiceTokenV3Section";