Skip to content

Commit

Permalink
Implement UI with Basic CRUD Functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
CaiHaosen committed Jul 12, 2024
1 parent 6cc79e2 commit 4ff8efb
Show file tree
Hide file tree
Showing 5 changed files with 576 additions and 173 deletions.
8 changes: 4 additions & 4 deletions ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { definePlugin } from "@halo-dev/console-shared";
import HomeView from "./views/HomeView.vue";
import HtmlInjectionList from "./views/HtmlInjectionList.vue";
import { IconPlug } from "@halo-dev/components";
import { markRaw } from "vue";

Expand All @@ -9,9 +9,9 @@ export default definePlugin({
{
parentName: "Root",
route: {
path: "/codes",
name: "InjectionCode",
component: HomeView,
path: "/HtmlInjection",
name: "HtmlInjection",
component: HtmlInjectionList,
meta: {
title: "代码注入管理",
searchable: true,
Expand Down
46 changes: 46 additions & 0 deletions ui/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
export interface Metadata {
name: string;
labels?: {
[key: string]: string;
} | null;
annotations?: {
[key: string]: string;
} | null;
version?: number | null;
creationTimestamp?: string | null;
deletionTimestamp?: string | null;
}

export interface HtmlInjectionSpec {
name: string;
description: string;
fragment: string;
injectionPoint: 'HEADER' | 'FOOTER';
pageRules: Set<String>;
enabled: boolean;
}

/**
* 与自定义模型 HtmlInjection 对应
*/
export interface HtmlInjection {
spec: HtmlInjectionSpec;
apiVersion: "theme.halo.run/v1alpha1"; // apiVersion=自定义模型的 group/version
kind: "HtmlInjection"; // Code 自定义模型中 @GVK 注解中的 kind
metadata: Metadata;
}

/**
* HtmlInjection 自定义模型生成 list API 所对应的类型
*/
export interface HtmlInjectionList {
page: number;
size: number;
total: number;
items: Array<HtmlInjection>;
first: boolean;
last: boolean;
hasNext: boolean;
hasPrevious: boolean;
totalPages: number;
}
169 changes: 0 additions & 169 deletions ui/src/views/HomeView.vue

This file was deleted.

Loading

0 comments on commit 4ff8efb

Please sign in to comment.