├── public ├── CNAME └── favicon.ico ├── commitlint.config.js ├── src ├── assets │ ├── logo.png │ └── img │ │ └── login-bg.jpg ├── store │ ├── modules │ │ ├── NumFactory │ │ │ ├── module.ts │ │ │ └── index.ts │ │ └── UserFactory │ │ │ ├── module.ts │ │ │ └── index.ts │ ├── module.ts │ └── index.ts ├── shims-vue.d.ts ├── views │ ├── stores │ │ └── PVPVC.vue │ ├── resource │ │ ├── Services.vue │ │ ├── Deployments.vue │ │ ├── StatefulSets.vue │ │ ├── PodInfo.vue │ │ └── Pod.vue │ ├── Stores.vue │ ├── Images.vue │ ├── Templeton.vue │ ├── rbac │ │ └── Namespaces.vue │ ├── Vuex.vue │ ├── Axios.vue │ ├── Xterm.vue │ ├── Resource.vue │ ├── Login.vue │ └── Home.vue ├── utils │ ├── import-ui-framework.ts │ └── axios.ts ├── main.ts ├── App.vue ├── style │ └── basic.styl ├── router │ └── index.ts └── components │ ├── Main.vue │ └── Header.vue ├── images └── README │ ├── image-20210608204425146.png │ ├── image-20210608204720670.png │ └── image-20210608204744563.png ├── .prettierrc ├── tests ├── Header.spec.ts └── Test.spec.ts ├── index.html ├── jest.config.js ├── .editorconfig ├── tsconfig.json ├── vite.config.ts ├── .gitignore ├── .eslintrc.js ├── README.md ├── .cz-config.js └── package.json /public/CNAME: -------------------------------------------------------------------------------- 1 | www.haozheyu.top 2 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] } 2 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haozheyu/k8s_dashboard/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haozheyu/k8s_dashboard/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/img/login-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haozheyu/k8s_dashboard/HEAD/src/assets/img/login-bg.jpg -------------------------------------------------------------------------------- /src/store/modules/NumFactory/module.ts: -------------------------------------------------------------------------------- 1 | export default interface NumFactoryStateTypes { 2 | name: string 3 | count: number 4 | } 5 | -------------------------------------------------------------------------------- /images/README/image-20210608204425146.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haozheyu/k8s_dashboard/HEAD/images/README/image-20210608204425146.png -------------------------------------------------------------------------------- /images/README/image-20210608204720670.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haozheyu/k8s_dashboard/HEAD/images/README/image-20210608204720670.png -------------------------------------------------------------------------------- /images/README/image-20210608204744563.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haozheyu/k8s_dashboard/HEAD/images/README/image-20210608204744563.png -------------------------------------------------------------------------------- /src/store/modules/UserFactory/module.ts: -------------------------------------------------------------------------------- 1 | export default interface UserFactoryStateTypes { 2 | username :string 3 | IsLogin : boolean 4 | } 5 | -------------------------------------------------------------------------------- /src/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import { DefineComponent } from 'vue' 3 | const component: DefineComponent<{}, {}, any> 4 | export default component 5 | } 6 | -------------------------------------------------------------------------------- /src/views/stores/PVPVC.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 | 14 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": false, 3 | "tabWidth": 2, 4 | "printWidth": 88, 5 | "singleQuote": true, 6 | "trailingComma": "none", 7 | "bracketSpacing": true, 8 | "semi": false 9 | } 10 | -------------------------------------------------------------------------------- /src/utils/import-ui-framework.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import ElementPlus from 'element-plus' 3 | import 'element-plus/lib/theme-chalk/index.css' 4 | 5 | export default function importUiFramework(app: App) { 6 | app.use(ElementPlus) 7 | return app 8 | } 9 | -------------------------------------------------------------------------------- /src/store/module.ts: -------------------------------------------------------------------------------- 1 | import NumFactoryStateTypes from './modules/NumFactory/module' 2 | 3 | export default interface RootStateTypes { 4 | text: string 5 | } 6 | 7 | export interface AllStateTypes extends RootStateTypes { 8 | numFactoryModule: NumFactoryStateTypes 9 | } 10 | -------------------------------------------------------------------------------- /src/views/resource/Services.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /src/views/resource/Deployments.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /src/views/resource/StatefulSets.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /tests/Header.spec.ts: -------------------------------------------------------------------------------- 1 | import { mount } from '@vue/test-utils' 2 | // @ts-ignore 3 | import Header from '../src/components/Header.vue' 4 | 5 | describe('Header.vue', () => { 6 | it('renders', () => { 7 | const wrapper = mount(Header) 8 | expect(wrapper.html()).toContain('Vite2.x + Vue3.x + TypeScript Starter') 9 | }) 10 | }) 11 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | k8s_vite 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/Test.spec.ts: -------------------------------------------------------------------------------- 1 | import { mount } from '@vue/test-utils' 2 | import Test from '../src/views/Test.vue' 3 | 4 | test('Test.vue', async () => { 5 | const wrapper = mount(Test) 6 | expect(wrapper.html()).toContain('Unit Test Page') 7 | expect(wrapper.html()).toContain('count is: 0') 8 | await wrapper.find('button').trigger('click') 9 | expect(wrapper.html()).toContain('count is: 1') 10 | }) 11 | -------------------------------------------------------------------------------- /src/views/Stores.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /src/views/Images.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 14 | 15 | 22 | -------------------------------------------------------------------------------- /src/views/Templeton.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 14 | 15 | 22 | -------------------------------------------------------------------------------- /src/views/rbac/Namespaces.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 14 | 15 | 22 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | moduleFileExtensions: ['vue', 'js', 'ts'], 3 | preset: 'ts-jest', 4 | testEnvironment: 'jsdom', 5 | transform: { 6 | '^.+\\.vue$': 'vue-jest', 7 | '^.+\\.ts$': 'ts-jest' 8 | }, 9 | // 匹配 __tests__ 目录下的 .js/.ts 文件 或 xx.test.js/ts xx.spec.js/ts 10 | testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(js|ts)$', 11 | moduleNameMapper: { 12 | '^@/(.*)$': '/src/$1' // 配置 jest 下 @ -> src 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import importUiFramework from '@/utils/import-ui-framework' 3 | import router from '@/router/index' 4 | import { key, store } from '@/store' 5 | import App from './App.vue' 6 | import '@/style/basic.styl' 7 | // eslint-disable-next-line import/order 8 | import * as echarts from 'echarts' 9 | 10 | const app = createApp(App) 11 | app.config.globalProperties.echarts = echarts 12 | importUiFramework(app).use(router).use(store, key).mount('#app') 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | 3 | # 表示最顶层的 EditorConfig 配置文件 4 | root = true 5 | 6 | [*] # 表示所有文件适用 7 | charset = utf-8 # 设置文件字符集为 utf-8 8 | indent_style = space # 缩进风格(tab | space) 9 | indent_size = 2 # 缩进大小 10 | end_of_line = lf # 控制换行类型(lf | cr | crlf) 11 | trim_trailing_whitespace = true # 去除行首的任意空白字符 12 | insert_final_newline = true # 始终在文件末尾插入一个新行 13 | 14 | [*.md] # 表示仅 md 文件适用以下规则 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "moduleResolution": "node", 6 | "strict": true, 7 | "jsx": "preserve", 8 | "sourceMap": true, 9 | "resolveJsonModule": true, 10 | "esModuleInterop": true, 11 | "lib": ["esnext", "dom"], 12 | "types": ["vite/client", "jest"], 13 | "baseUrl": "src", 14 | "paths": { 15 | "@/*": ["./*"] 16 | } 17 | }, 18 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] 19 | } 20 | -------------------------------------------------------------------------------- /src/store/modules/NumFactory/index.ts: -------------------------------------------------------------------------------- 1 | import { Module } from 'vuex' 2 | import NumFactoryStateTypes from './module' 3 | import RootStateTypes from '../../module' 4 | 5 | // Create a new store Modules. 6 | const numFactoryModule: Module = { 7 | namespaced: true, 8 | state: { 9 | name: 'numFactory-module', 10 | count: 1 11 | }, 12 | mutations: { 13 | DOUBLE_COUNT(state: NumFactoryStateTypes) { 14 | state.count *= 2 15 | } 16 | }, 17 | actions: {} 18 | } 19 | 20 | export default numFactoryModule 21 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import vue from '@vitejs/plugin-vue' 3 | // 如果编辑器提示 path 模块找不到,则可以安装一下 @types/node -> npm i @types/node -D 4 | import { resolve } from 'path' 5 | 6 | // https://vitejs.dev/config/ 7 | export default defineConfig({ 8 | plugins: [vue()], 9 | resolve: { 10 | alias: { 11 | '@': resolve(__dirname, 'src') // 设置 `@` 指向 `src` 目录 12 | } 13 | }, 14 | base: './', // 设置打包路径 15 | server: { 16 | port: 4500, // 设置服务启动端口号 17 | open: true, // 设置服务启动时是否自动打开浏览器 18 | cors: true // 允许跨域 19 | } 20 | }) 21 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 16 | 17 | 28 | -------------------------------------------------------------------------------- /src/style/basic.styl: -------------------------------------------------------------------------------- 1 | $font-color = #2c3e50 2 | $background-color = #fff 3 | $second-background-color = #f1f1f1 4 | 5 | html, body { 6 | position relative 7 | padding 0 8 | margin 0 9 | width 100% 10 | height 100% 11 | color $font-color 12 | } 13 | 14 | ul, 15 | li, 16 | ol { 17 | padding 0 18 | margin 0 19 | list-style none 20 | } 21 | 22 | .flex-center { 23 | display flex 24 | justify-content center 25 | align-items center 26 | } 27 | 28 | .page-container { 29 | width 100% 30 | height 100% 31 | box-sizing border-box 32 | text-align center 33 | } 34 | 35 | .page-title { 36 | font-size 28px 37 | font-weight bold 38 | padding 20px 39 | } 40 | -------------------------------------------------------------------------------- /src/store/modules/UserFactory/index.ts: -------------------------------------------------------------------------------- 1 | import { Module } from 'vuex' 2 | import UserFactoryStateTypes from './module' 3 | import RootStateTypes from '../../module' 4 | 5 | // Create a new store Modules. 6 | const UserFactoryModule: Module = { 7 | namespaced: true, 8 | state: { 9 | username: "", 10 | IsLogin: false, 11 | }, 12 | mutations: { 13 | IsLogin(state: UserFactoryStateTypes, name:string) { 14 | state.username = name 15 | state.IsLogin = true 16 | }, 17 | LogOut(state: UserFactoryStateTypes){ 18 | state.username = "" 19 | state.IsLogin = false 20 | } 21 | }, 22 | actions: {} 23 | } 24 | 25 | export default UserFactoryModule 26 | -------------------------------------------------------------------------------- /src/store/index.ts: -------------------------------------------------------------------------------- 1 | import { InjectionKey } from 'vue' 2 | import { createStore, Store, useStore as baseUseStore } from 'vuex' 3 | import RootStateTypes, { AllStateTypes } from './module' 4 | 5 | import numFactoryModule from './modules/NumFactory' 6 | import UserFactoryModule from "@/store/modules/UserFactory"; 7 | 8 | export const store = createStore({ 9 | state: { 10 | text: 'This is Vuex Root.state.text' 11 | }, 12 | getters: {}, 13 | mutations: {}, 14 | actions: {}, 15 | modules: { 16 | numFactoryModule, 17 | UserFactoryModule, 18 | } 19 | }) 20 | 21 | export const key: InjectionKey> = Symbol('vue-store') 22 | 23 | export function useStore() { 24 | return baseUseStore(key) 25 | } 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /dist-ssr 6 | /tmp 7 | /out-tsc 8 | 9 | # dependencies 10 | /node_modules 11 | *.local 12 | yarn.lock 13 | package-lock.json 14 | 15 | # IDEs and editors 16 | /.idea 17 | .project 18 | .classpath 19 | .c9/ 20 | *.launch 21 | .settings/ 22 | *.sublime-workspace 23 | 24 | # IDE - VSCode 25 | .vscode/* 26 | # !.vscode/settings.json 27 | # !.vscode/tasks.json 28 | # !.vscode/launch.json 29 | # !.vscode/extensions.json 30 | 31 | # misc 32 | /.sass-cache 33 | /connect.lock 34 | /coverage 35 | /libpeerconnection.log 36 | npm-debug.log 37 | testem.log 38 | /typings 39 | 40 | # e2e 41 | /e2e/src/*.js 42 | /e2e/src/*.map 43 | /cypress/screenshots 44 | 45 | # System Files 46 | .DS_Store 47 | Thumbs.db 48 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: true, 4 | es2021: true, 5 | node: true 6 | }, 7 | extends: [ 8 | 'plugin:vue/essential', 9 | 'airbnb-base', 10 | 'plugin:prettier/recommended', 11 | 'plugin:jest/recommended' 12 | ], 13 | parserOptions: { 14 | ecmaVersion: 12, 15 | parser: '@typescript-eslint/parser', 16 | sourceType: 'module' 17 | }, 18 | plugins: ['vue', '@typescript-eslint'], 19 | rules: { 20 | 'import/no-unresolved': 'off', 21 | 'import/extensions': 'off', 22 | 'import/no-absolute-path': 'off', 23 | 'import/no-extraneous-dependencies': 'off', 24 | 'vue/no-multiple-template-root': 'off', 25 | 'no-param-reassign': [ 26 | 'error', 27 | { 28 | props: true, 29 | ignorePropertyModificationsFor: ['state', 'config'] 30 | } 31 | ] 32 | }, 33 | settings: {} 34 | } 35 | -------------------------------------------------------------------------------- /src/views/Vuex.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vite2.x + Vue3.x + Xtermjs4 2 | 3 | [在线体验地址](http://114.67.110.204:4500) 4 | ## 相关信息 5 | - 编程语言:[TypeScript 4.x](https://www.typescriptlang.org/zh/) + [JavaScript](https://www.javascript.com/) 6 | - 构建工具:[Vite 2.x](https://cn.vitejs.dev/) 7 | - 前端框架:[Vue 3.x](https://v3.cn.vuejs.org/) 8 | - 路由工具:[Vue Router 4.x](https://next.router.vuejs.org/zh/index.html) 9 | - 状态管理:[Vuex 4.x](https://next.vuex.vuejs.org/) 10 | - UI 框架:[Element Plus](https://element-plus.org/#/zh-CN) 11 | - CSS 预编译:[Stylus](https://stylus-lang.com/) / [Sass](https://sass.bootcss.com/documentation) / [Less](http://lesscss.cn/) 12 | - HTTP 工具:[Axios](https://axios-http.com/) 13 | - 后端地址: [kube_web](https://github.com/haozheyu/kube_web) 14 | 15 | ### 安装依赖 16 | 17 | ```sh 18 | npm install 19 | # or 20 | yarn add 21 | ``` 22 | 23 | ### 启动项目 24 | 25 | ```sh 26 | npm run dev 27 | ``` 28 | 29 | ### 项目打包 30 | 31 | ```sh 32 | npm run build 33 | ``` 34 | 35 | ### 功能完成 36 | #### 2021/6/8 37 | pod 的ssh登录 38 | 39 | ![image-20210608204425146](images/README/image-20210608204425146.png) 40 | 41 | ![image-20210608204720670](images/README/image-20210608204720670.png) 42 | 43 | ![image-20210608204744563](images/README/image-20210608204744563.png) 44 | 45 | ![image-20210608204744563](images/README/image-20210608204744563.png) 46 | -------------------------------------------------------------------------------- /src/utils/axios.ts: -------------------------------------------------------------------------------- 1 | import Axios, { AxiosInstance } from 'axios' 2 | import { ElMessage } from 'element-plus' 3 | 4 | const baseURL = 'http://114.67.110.204:9997' 5 | 6 | const axios: AxiosInstance = Axios.create({ 7 | baseURL, 8 | timeout: 20000 // 请求超时 20s 9 | }) 10 | 11 | const addHeader = "Bearer "+localStorage.getItem('token') 12 | 13 | // 前置拦截器(发起请求之前的拦截) 14 | axios.interceptors.request.use( 15 | (config) => { 16 | /** 17 | * 根据你的项目实际情况来对 config 做处理 18 | */ 19 | config.headers['Authorization'] = addHeader || '' 20 | config.headers.post['Content-Type'] = 'application/json' 21 | return config 22 | }, 23 | (error) => { 24 | return Promise.reject(error) 25 | } 26 | ) 27 | 28 | // 后置拦截器(获取到响应时的拦截) 29 | axios.interceptors.response.use( 30 | (response) => { 31 | /** 32 | * 根据你的项目实际情况来对 response 和 error 做处理 33 | * 这里对 response 和 error 不做任何处理,直接返回 34 | */ 35 | return response.data 36 | }, 37 | (error) => { 38 | if (error.response && error.response.data) { 39 | const code = error.response.status 40 | const msg = error.response.data.message 41 | ElMessage.error(`Code: ${code}, Message: ${msg}`) 42 | console.error(`[Axios Error]`, error.response) 43 | } else { 44 | ElMessage.error(`${error}`) 45 | } 46 | return Promise.reject(error) 47 | } 48 | ) 49 | 50 | export default axios 51 | -------------------------------------------------------------------------------- /src/views/Axios.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 55 | 56 | 92 | -------------------------------------------------------------------------------- /src/router/index.ts: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHashHistory, Router, RouteRecordRaw } from 'vue-router' 2 | import Home from '@/views/Home.vue' 3 | import Vuex from '@/views/Vuex.vue' 4 | import Resource from '@/views/Resource.vue' 5 | import Pod from '@/views/resource/Pod.vue' 6 | import Templeton from '@/views/Templeton.vue' 7 | import Stores from '@/views/Stores.vue' 8 | import Images from '@/views/Images.vue' 9 | import PodInfo from '@/views/resource/PodInfo.vue' 10 | import webShell from '@/views/Xterm.vue' 11 | 12 | const routes: Array = [ 13 | { 14 | path: '/', 15 | name: 'Home', 16 | component: Home, 17 | props: true, 18 | }, 19 | { 20 | path: '/Resource', 21 | name: '资源中心', 22 | component: Resource 23 | }, 24 | { 25 | path: '/pod', 26 | name: 'pod', 27 | component: Pod, 28 | props: true, 29 | meta: { title: 'pod管理' } 30 | }, 31 | { 32 | path: '/podInfo', 33 | name: 'podInfo', 34 | component: PodInfo, 35 | props: true, 36 | meta: { title: 'pod详情页面' } 37 | }, 38 | { 39 | path: '/deployments', 40 | name: 'deployments', 41 | component: () => import('@/views/resource/Deployments.vue'), 42 | props: true, 43 | meta: { title: 'deployments' } 44 | }, 45 | { 46 | path: '/webShell', 47 | name: 'webShell', 48 | component: webShell, 49 | props: true, 50 | meta: { title: 'deployments' } 51 | }, 52 | { 53 | path: '/statefulSets', 54 | name: 'statefulSets', 55 | component: () => import('@/views/resource/StatefulSets.vue'), 56 | props: true, 57 | meta: { title: 'statefulSets' } 58 | }, 59 | { 60 | path: '/Stores', 61 | name: '存储管理', 62 | component: Stores 63 | }, 64 | { 65 | path: '/Templeton', 66 | name: '配置管理', 67 | component: Templeton 68 | }, 69 | { 70 | path: '/Images', 71 | name: '镜像管理', 72 | component: Images 73 | }, 74 | { 75 | path: '/vuex', 76 | name: 'Vuex', 77 | component: Vuex 78 | }, 79 | { 80 | path: '/axios', 81 | name: 'Axios', 82 | component: () => import('@/views/Axios.vue') // 懒加载 Axios 组件 83 | }, 84 | { 85 | path: '/login', 86 | name: 'login', 87 | component: () => import('@/views/Login.vue') // 懒加载 Axios 组件 88 | } 89 | ] 90 | 91 | const router: Router = createRouter({ 92 | // history: createWebHistory(), 93 | history: createWebHashHistory(), // 带# 94 | routes 95 | }) 96 | 97 | export default router 98 | -------------------------------------------------------------------------------- /.cz-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // type 类型(定义之后,可通过上下键选择) 3 | types: [ 4 | { value: 'feat', name: 'feat: 新增功能' }, 5 | { value: 'fix', name: 'fix: 修复 bug' }, 6 | { value: 'docs', name: 'docs: 文档变更' }, 7 | { 8 | value: 'style', 9 | name: 'style: 代码格式(不影响功能,例如空格、分号等格式修正)' 10 | }, 11 | { 12 | value: 'refactor', 13 | name: 'refactor: 代码重构(不包括 bug 修复、功能新增)' 14 | }, 15 | { value: 'perf', name: 'perf: 性能优化' }, 16 | { value: 'test', name: 'test: 添加、修改测试用例' }, 17 | { 18 | value: 'build', 19 | name: 20 | 'build: 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等)' 21 | }, 22 | { value: 'ci', name: 'ci: 修改 CI 配置、脚本' }, 23 | { 24 | value: 'chore', 25 | name: 'chore: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)' 26 | }, 27 | { value: 'revert', name: 'revert: 回滚 commit' } 28 | ], 29 | 30 | // scope 类型(定义之后,可通过上下键选择) 31 | scopes: [ 32 | ['components', '组件相关'], 33 | ['hooks', 'hook 相关'], 34 | ['utils', 'utils 相关'], 35 | ['element-ui', '对 element-ui 的调整'], 36 | ['styles', '样式相关'], 37 | ['deps', '项目依赖'], 38 | ['auth', '对 auth 修改'], 39 | ['other', '其他修改'], 40 | // 如果选择 custom,后面会让你再输入一个自定义的 scope。也可以不设置此项,把后面的 allowCustomScopes 设置为 true 41 | ['custom', '以上都不是?我要自定义'] 42 | ].map(([value, description]) => { 43 | return { 44 | value, 45 | name: `${value.padEnd(30)} (${description})` 46 | } 47 | }), 48 | 49 | // 是否允许自定义填写 scope,在 scope 选择的时候,会有 empty 和 custom 可以选择。 50 | // allowCustomScopes: true, 51 | 52 | // allowTicketNumber: false, 53 | // isTicketNumberRequired: false, 54 | // ticketNumberPrefix: 'TICKET-', 55 | // ticketNumberRegExp: '\\d{1,5}', 56 | 57 | // 针对每一个 type 去定义对应的 scopes,例如 fix 58 | /* 59 | scopeOverrides: { 60 | fix: [ 61 | { name: 'merge' }, 62 | { name: 'style' }, 63 | { name: 'e2eTest' }, 64 | { name: 'unitTest' } 65 | ] 66 | }, 67 | */ 68 | 69 | // 交互提示信息 70 | messages: { 71 | type: '确保本次提交遵循 Angular 规范!\n选择你要提交的类型:', 72 | scope: '\n选择一个 scope(可选):', 73 | // 选择 scope: custom 时会出下面的提示 74 | customScope: '请输入自定义的 scope:', 75 | subject: '填写简短精炼的变更描述:\n', 76 | body: '填写更加详细的变更描述(可选)。使用 "|" 换行:\n', 77 | breaking: '列举非兼容性重大的变更(可选):\n', 78 | footer: '列举出所有变更的 ISSUES CLOSED(可选)。 例如: #31, #34:\n', 79 | confirmCommit: '确认提交?' 80 | }, 81 | 82 | // 设置只有 type 选择了 feat 或 fix,才询问 breaking message 83 | allowBreakingChanges: ['feat', 'fix'], 84 | 85 | // 跳过要询问的步骤 86 | // skipQuestions: ['body', 'footer'], 87 | 88 | subjectLimit: 100, // subject 限制长度 89 | breaklineChar: '|' // 换行符,支持 body 和 footer 90 | // footerPrefix : 'ISSUES CLOSED:' 91 | // askForBreakingChangeFirst : true, 92 | } 93 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "k8s_vite", 3 | "version": "0.0.1", 4 | "private": false, 5 | "description": "k8s_vite", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "build-tsc": "vue-tsc --noEmit && vite build", 10 | "serve": "vite preview", 11 | "format": "prettier --write ./src", 12 | "lint": "eslint ./src --ext .vue,.js,.ts", 13 | "lint-fix": "eslint --fix ./src --ext .vue,.js,.ts", 14 | "prepare": "husky install", 15 | "test": "jest" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git+ssh://git@github.com/XPoet/vite-vue3-starter.git" 20 | }, 21 | "keywords": [ 22 | "Vite", 23 | "Vue3", 24 | "TypeScript", 25 | "Starter" 26 | ], 27 | "author": "XPoet", 28 | "license": "MIT", 29 | "bugs": { 30 | "url": "https://github.com/XPoet/vite-vue3-starter/issues" 31 | }, 32 | "homepage": "https://github.com/XPoet/vite-vue3-starter#readme", 33 | "lint-staged": { 34 | "*.{vue,js,ts}": "eslint --fix" 35 | }, 36 | "config": { 37 | "commitizen": { 38 | "path": "./node_modules/cz-customizable" 39 | } 40 | }, 41 | "dependencies": { 42 | "axios": "^0.21.1", 43 | "clipboard": "^2.0.8", 44 | "csss": "^1.1.1", 45 | "echarts": "^5.1.2", 46 | "element-plus": "^1.0.2-beta.44", 47 | "element3": "0.0.40", 48 | "jt-storage": "0.0.2", 49 | "pushstate-server": "^3.1.0", 50 | "vue": "^3.0.5", 51 | "vue-easy-form": "^1.8.4", 52 | "vue-router": "^4.0.6", 53 | "vuex": "^4.0.0", 54 | "vuex-persistedstate": "^4.0.0-beta.3", 55 | "xterm": "^4.12.0", 56 | "xterm-addon-fit": "^0.5.0" 57 | }, 58 | "devDependencies": { 59 | "@commitlint/cli": "^12.1.1", 60 | "@commitlint/config-conventional": "^12.1.1", 61 | "@types/jest": "^26.0.22", 62 | "@typescript-eslint/eslint-plugin": "^4.21.0", 63 | "@typescript-eslint/parser": "^4.21.0", 64 | "@vitejs/plugin-vue": "^1.2.1", 65 | "@vue/compiler-sfc": "^3.0.5", 66 | "@vue/test-utils": "^2.0.0-rc.4", 67 | "commitizen": "^4.2.3", 68 | "cz-conventional-changelog": "^3.3.0", 69 | "cz-customizable": "^6.3.0", 70 | "eslint": "^7.24.0", 71 | "eslint-config-airbnb-base": "^14.2.1", 72 | "eslint-config-prettier": "^8.1.0", 73 | "eslint-plugin-import": "^2.22.1", 74 | "eslint-plugin-jest": "^24.3.5", 75 | "eslint-plugin-prettier": "^3.3.1", 76 | "eslint-plugin-vue": "^7.8.0", 77 | "husky": "^6.0.0", 78 | "jest": "^26.6.3", 79 | "lint-staged": "^10.5.4", 80 | "prettier": "^2.2.1", 81 | "sass": "^1.34.1", 82 | "stylus": "^0.54.8", 83 | "ts-jest": "^26.5.4", 84 | "typescript": "^4.1.3", 85 | "vite": "^2.1.5", 86 | "vite-plugin-style-import": "^0.9.2", 87 | "vue-jest": "^5.0.0-alpha.7", 88 | "vue-tsc": "^0.0.15" 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/views/Xterm.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 95 | 96 | 99 | -------------------------------------------------------------------------------- /src/components/Main.vue: -------------------------------------------------------------------------------- 1 | 15 | 66 | 67 | 138 | -------------------------------------------------------------------------------- /src/views/Resource.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 86 | 87 | 115 | -------------------------------------------------------------------------------- /src/views/Login.vue: -------------------------------------------------------------------------------- 1 | 43 | 44 | 128 | 129 | 172 | -------------------------------------------------------------------------------- /src/views/resource/PodInfo.vue: -------------------------------------------------------------------------------- 1 | 58 | 59 | 148 | 149 | 152 | -------------------------------------------------------------------------------- /src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 159 | 160 | 195 | -------------------------------------------------------------------------------- /src/components/Header.vue: -------------------------------------------------------------------------------- 1 | 55 | 56 | 210 | 211 | 239 | -------------------------------------------------------------------------------- /src/views/resource/Pod.vue: -------------------------------------------------------------------------------- 1 | 97 | 98 | 99 | 204 | 205 | 208 | --------------------------------------------------------------------------------