Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
添加前端页面
Browse files Browse the repository at this point in the history
1. 删除不使用的示例代码
2. 添加加载页面
3. 添加登录页面
4. 添加策略卡片和主页
  • Loading branch information
lanthora committed Dec 16, 2023
1 parent b19d4ff commit 4a2ff68
Show file tree
Hide file tree
Showing 20 changed files with 210 additions and 381 deletions.
2 changes: 2 additions & 0 deletions webui/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_APP_MODE="Development"
VITE_APP_BASE_API="https://web.hackernel.org"
2 changes: 2 additions & 0 deletions webui/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_APP_MODE="Production"
VITE_APP_BASE_API=""
2 changes: 1 addition & 1 deletion webui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
<title>主机入侵防御系统</title>
</head>
<body>
<div id="app"></div>
Expand Down
79 changes: 2 additions & 77 deletions webui/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,85 +1,10 @@
<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'
import { RouterView } from 'vue-router'
</script>

<template>
<header>
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />

<div class="wrapper">
<HelloWorld msg="You did it!" />

<nav>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/about">About</RouterLink>
</nav>
</div>
</header>

<RouterView />
<RouterView />
</template>

<style scoped>
header {
line-height: 1.5;
max-height: 100vh;
}
.logo {
display: block;
margin: 0 auto 2rem;
}
nav {
width: 100%;
font-size: 12px;
text-align: center;
margin-top: 2rem;
}
nav a.router-link-exact-active {
color: var(--color-text);
}
nav a.router-link-exact-active:hover {
background-color: transparent;
}
nav a {
display: inline-block;
padding: 0 1rem;
border-left: 1px solid var(--color-border);
}
nav a:first-of-type {
border: 0;
}
@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}
.logo {
margin: 0 2rem 0 0;
}
header .wrapper {
display: flex;
place-items: flex-start;
flex-wrap: wrap;
}
nav {
text-align: left;
margin-left: -1rem;
font-size: 1rem;
padding: 1rem 0;
margin-top: 1rem;
}
}
</style>
1 change: 0 additions & 1 deletion webui/src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ a,

#app {
display: grid;
grid-template-columns: 1fr 1fr;
padding: 0 2rem;
}
}
41 changes: 0 additions & 41 deletions webui/src/components/HelloWorld.vue

This file was deleted.

51 changes: 51 additions & 0 deletions webui/src/components/PolicyCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<template>
<div class="process-card">
<div class="process-header">{{ title }}</div>
<div class="process-body">
<p class="process-text">当前状态: {{ status }}</p>
<p class="process-text">当前策略数: {{ policyCount }}</p>
<p class="process-text">未读事件数: {{ unreadCount }}</p>
</div>
</div>
</template>

<script setup lang="ts">
import { ref } from "vue";
// define the props object to receive the parameters
const props = defineProps({
title: String,
status: String,
policyCount: Number,
unreadCount: Number
});
// use the props to initialize the data
const title = ref(props.title);
const policyCount = ref(props.policyCount);
const unreadCount = ref(props.unreadCount);
const status = ref(props.status);
</script>

<style scoped>
.process-card {
border: 1px solid #0099ff;
margin: 1rem;
}
.process-header {
background-color: #0099ff;
color: white;
padding: 0.5rem;
}
.process-body {
padding: 0.5rem;
}
.process-text {
margin: 0;
}
</style>
86 changes: 0 additions & 86 deletions webui/src/components/TheWelcome.vue

This file was deleted.

87 changes: 0 additions & 87 deletions webui/src/components/WelcomeItem.vue

This file was deleted.

11 changes: 0 additions & 11 deletions webui/src/components/__tests__/HelloWorld.spec.ts

This file was deleted.

7 changes: 0 additions & 7 deletions webui/src/components/icons/IconCommunity.vue

This file was deleted.

Loading

0 comments on commit 4a2ff68

Please sign in to comment.