first commit
This commit is contained in:
21
webui/.eslintrc.cjs
Normal file
21
webui/.eslintrc.cjs
Normal file
@@ -0,0 +1,21 @@
|
||||
/* eslint-env node */
|
||||
require('@rushstack/eslint-patch/modern-module-resolution')
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
'extends': [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended',
|
||||
'@vue/eslint-config-typescript',
|
||||
'@vue/eslint-config-prettier/skip-formatting'
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest'
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
amd: true,
|
||||
node: true,
|
||||
es2022: true,
|
||||
}
|
||||
}
|
||||
28
webui/.gitignore
vendored
Normal file
28
webui/.gitignore
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
8
webui/.prettierrc.json
Normal file
8
webui/.prettierrc.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/prettierrc",
|
||||
"semi": false,
|
||||
"tabWidth": 2,
|
||||
"singleQuote": true,
|
||||
"printWidth": 100,
|
||||
"trailingComma": "none"
|
||||
}
|
||||
8
webui/.vscode/extensions.json
vendored
Normal file
8
webui/.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"Vue.volar",
|
||||
"Vue.vscode-typescript-vue-plugin",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode"
|
||||
]
|
||||
}
|
||||
46
webui/README.md
Normal file
46
webui/README.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# pastebin
|
||||
|
||||
This template should help get you started developing with Vue 3 in Vite.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
||||
|
||||
## Type Support for `.vue` Imports in TS
|
||||
|
||||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
|
||||
|
||||
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
|
||||
|
||||
1. Disable the built-in TypeScript Extension
|
||||
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
||||
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
||||
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
||||
|
||||
## Customize configuration
|
||||
|
||||
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
||||
|
||||
## Project Setup
|
||||
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Type-Check, Compile and Minify for Production
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Lint with [ESLint](https://eslint.org/)
|
||||
|
||||
```sh
|
||||
npm run lint
|
||||
```
|
||||
1
webui/env.d.ts
vendored
Normal file
1
webui/env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
13
webui/index.html
Normal file
13
webui/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>粘贴箱 - Pastebin</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
4531
webui/package-lock.json
generated
Normal file
4531
webui/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
45
webui/package.json
Normal file
45
webui/package.json
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "pastebin",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc && vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@codemirror/lang-javascript": "github:codemirror/lang-javascript",
|
||||
"@codemirror/lang-json": "github:codemirror/lang-json",
|
||||
"@codemirror/lang-markdown": "github:codemirror/lang-markdown",
|
||||
"@codemirror/theme-one-dark": "github:codemirror/theme-one-dark",
|
||||
"@kyvg/vue3-notification": "^3.0.2",
|
||||
"axios": "^1.5.1",
|
||||
"codemirror": "^6.0.1",
|
||||
"pinia": "^2.1.6",
|
||||
"ts-proto": "^1.158.0",
|
||||
"vue": "^3.3.4",
|
||||
"vue-codemirror": "^6.1.1",
|
||||
"vue-router": "^4.2.4",
|
||||
"vue3-highlightjs": "^1.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.3.3",
|
||||
"@tsconfig/node18": "^18.2.2",
|
||||
"@types/node": "^18.17.17",
|
||||
"@vitejs/plugin-vue": "^4.3.4",
|
||||
"@vue/eslint-config-prettier": "^8.0.0",
|
||||
"@vue/eslint-config-typescript": "^12.0.0",
|
||||
"@vue/tsconfig": "^0.4.0",
|
||||
"autoprefixer": "^10.4.16",
|
||||
"daisyui": "^3.7.7",
|
||||
"eslint": "^8.49.0",
|
||||
"eslint-plugin-vue": "^9.17.0",
|
||||
"npm-run-all2": "^6.0.6",
|
||||
"postcss": "^8.4.30",
|
||||
"prettier": "^3.0.3",
|
||||
"tailwindcss": "^3.3.3",
|
||||
"typescript": "~5.2.0",
|
||||
"vite": "^4.4.9",
|
||||
"vue-tsc": "^1.8.11"
|
||||
}
|
||||
}
|
||||
6
webui/postcss.config.js
Normal file
6
webui/postcss.config.js
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
||||
BIN
webui/public/favicon.ico
Normal file
BIN
webui/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
25
webui/src/App.vue
Normal file
25
webui/src/App.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import { RouterLink, RouterView } from 'vue-router'
|
||||
|
||||
import {usePageStore} from "@/stores/counter";
|
||||
const pager = usePageStore()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="hero bg-base-200">
|
||||
<div class="hero-content text-center">
|
||||
<div class="max-w-md">
|
||||
<h1 class="text-5xl font-bold">Pastebin!</h1>
|
||||
<p class="py-6">本网站旨在用作各方之间粘贴信息的短期交换。提交的数据不保证是永久性的,并且可能随时被删除</p>
|
||||
<RouterLink :to="{name: pager.reversal()}" class="btn btn-primary">
|
||||
<span v-if="pager.reversal() === 'home'">首页</span>
|
||||
<span v-else>列表</span>
|
||||
</RouterLink>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<notifications />
|
||||
|
||||
<RouterView />
|
||||
</template>
|
||||
3
webui/src/assets/base.css
Normal file
3
webui/src/assets/base.css
Normal file
@@ -0,0 +1,3 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
1
webui/src/assets/logo.svg
Normal file
1
webui/src/assets/logo.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>
|
||||
|
After Width: | Height: | Size: 276 B |
41
webui/src/components/HelloWorld.vue
Normal file
41
webui/src/components/HelloWorld.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<script setup lang="ts">
|
||||
defineProps<{
|
||||
msg: string
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="greetings">
|
||||
<h1 class="green">{{ msg }}</h1>
|
||||
<h3>
|
||||
You’ve successfully created a project with
|
||||
<a href="https://vitejs.dev/" target="_blank" rel="noopener">Vite</a> +
|
||||
<a href="https://vuejs.org/" target="_blank" rel="noopener">Vue 3</a>. What's next?
|
||||
</h3>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
h1 {
|
||||
font-weight: 500;
|
||||
font-size: 2.6rem;
|
||||
position: relative;
|
||||
top: -10px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.greetings h1,
|
||||
.greetings h3 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.greetings h1,
|
||||
.greetings h3 {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
88
webui/src/components/TheWelcome.vue
Normal file
88
webui/src/components/TheWelcome.vue
Normal file
@@ -0,0 +1,88 @@
|
||||
<script setup lang="ts">
|
||||
import WelcomeItem from './WelcomeItem.vue'
|
||||
import DocumentationIcon from './icons/IconDocumentation.vue'
|
||||
import ToolingIcon from './icons/IconTooling.vue'
|
||||
import EcosystemIcon from './icons/IconEcosystem.vue'
|
||||
import CommunityIcon from './icons/IconCommunity.vue'
|
||||
import SupportIcon from './icons/IconSupport.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<WelcomeItem>
|
||||
<template #icon>
|
||||
<DocumentationIcon />
|
||||
</template>
|
||||
<template #heading>Documentation</template>
|
||||
|
||||
Vue’s
|
||||
<a href="https://vuejs.org/" target="_blank" rel="noopener">official documentation</a>
|
||||
provides you with all information you need to get started.
|
||||
</WelcomeItem>
|
||||
|
||||
<WelcomeItem>
|
||||
<template #icon>
|
||||
<ToolingIcon />
|
||||
</template>
|
||||
<template #heading>Tooling</template>
|
||||
|
||||
This project is served and bundled with
|
||||
<a href="https://vitejs.dev/guide/features.html" target="_blank" rel="noopener">Vite</a>. The
|
||||
recommended IDE setup is
|
||||
<a href="https://code.visualstudio.com/" target="_blank" rel="noopener">VSCode</a> +
|
||||
<a href="https://github.com/johnsoncodehk/volar" target="_blank" rel="noopener">Volar</a>. If
|
||||
you need to test your components and web pages, check out
|
||||
<a href="https://www.cypress.io/" target="_blank" rel="noopener">Cypress</a> and
|
||||
<a href="https://on.cypress.io/component" target="_blank" rel="noopener"
|
||||
>Cypress Component Testing</a
|
||||
>.
|
||||
|
||||
<br />
|
||||
|
||||
More instructions are available in <code>README.md</code>.
|
||||
</WelcomeItem>
|
||||
|
||||
<WelcomeItem>
|
||||
<template #icon>
|
||||
<EcosystemIcon />
|
||||
</template>
|
||||
<template #heading>Ecosystem</template>
|
||||
|
||||
Get official tools and libraries for your project:
|
||||
<a href="https://pinia.vuejs.org/" target="_blank" rel="noopener">Pinia</a>,
|
||||
<a href="https://router.vuejs.org/" target="_blank" rel="noopener">Vue Router</a>,
|
||||
<a href="https://test-utils.vuejs.org/" target="_blank" rel="noopener">Vue Test Utils</a>, and
|
||||
<a href="https://github.com/vuejs/devtools" target="_blank" rel="noopener">Vue Dev Tools</a>. If
|
||||
you need more resources, we suggest paying
|
||||
<a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">Awesome Vue</a>
|
||||
a visit.
|
||||
</WelcomeItem>
|
||||
|
||||
<WelcomeItem>
|
||||
<template #icon>
|
||||
<CommunityIcon />
|
||||
</template>
|
||||
<template #heading>Community</template>
|
||||
|
||||
Got stuck? Ask your question on
|
||||
<a href="https://chat.vuejs.org" target="_blank" rel="noopener">Vue Land</a>, our official
|
||||
Discord server, or
|
||||
<a href="https://stackoverflow.com/questions/tagged/vue.js" target="_blank" rel="noopener"
|
||||
>StackOverflow</a
|
||||
>. You should also subscribe to
|
||||
<a href="https://news.vuejs.org" target="_blank" rel="noopener">our mailing list</a> and follow
|
||||
the official
|
||||
<a href="https://twitter.com/vuejs" target="_blank" rel="noopener">@vuejs</a>
|
||||
twitter account for latest news in the Vue world.
|
||||
</WelcomeItem>
|
||||
|
||||
<WelcomeItem>
|
||||
<template #icon>
|
||||
<SupportIcon />
|
||||
</template>
|
||||
<template #heading>Support Vue</template>
|
||||
|
||||
As an independent project, Vue relies on community backing for its sustainability. You can help
|
||||
us by
|
||||
<a href="https://vuejs.org/sponsor/" target="_blank" rel="noopener">becoming a sponsor</a>.
|
||||
</WelcomeItem>
|
||||
</template>
|
||||
87
webui/src/components/WelcomeItem.vue
Normal file
87
webui/src/components/WelcomeItem.vue
Normal file
@@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<div class="item">
|
||||
<i>
|
||||
<slot name="icon"></slot>
|
||||
</i>
|
||||
<div class="details">
|
||||
<h3>
|
||||
<slot name="heading"></slot>
|
||||
</h3>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.item {
|
||||
margin-top: 2rem;
|
||||
display: flex;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.details {
|
||||
flex: 1;
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
i {
|
||||
display: flex;
|
||||
place-items: center;
|
||||
place-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 500;
|
||||
margin-bottom: 0.4rem;
|
||||
color: var(--color-heading);
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.item {
|
||||
margin-top: 0;
|
||||
padding: 0.4rem 0 1rem calc(var(--section-gap) / 2);
|
||||
}
|
||||
|
||||
i {
|
||||
top: calc(50% - 25px);
|
||||
left: -26px;
|
||||
position: absolute;
|
||||
border: 1px solid var(--color-border);
|
||||
background: var(--color-background);
|
||||
border-radius: 8px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.item:before {
|
||||
content: ' ';
|
||||
border-left: 1px solid var(--color-border);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: calc(50% + 25px);
|
||||
height: calc(50% - 25px);
|
||||
}
|
||||
|
||||
.item:after {
|
||||
content: ' ';
|
||||
border-left: 1px solid var(--color-border);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: calc(50% + 25px);
|
||||
height: calc(50% - 25px);
|
||||
}
|
||||
|
||||
.item:first-of-type:before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.item:last-of-type:after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
7
webui/src/components/icons/IconCommunity.vue
Normal file
7
webui/src/components/icons/IconCommunity.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor">
|
||||
<path
|
||||
d="M15 4a1 1 0 1 0 0 2V4zm0 11v-1a1 1 0 0 0-1 1h1zm0 4l-.707.707A1 1 0 0 0 16 19h-1zm-4-4l.707-.707A1 1 0 0 0 11 14v1zm-4.707-1.293a1 1 0 0 0-1.414 1.414l1.414-1.414zm-.707.707l-.707-.707.707.707zM9 11v-1a1 1 0 0 0-.707.293L9 11zm-4 0h1a1 1 0 0 0-1-1v1zm0 4H4a1 1 0 0 0 1.707.707L5 15zm10-9h2V4h-2v2zm2 0a1 1 0 0 1 1 1h2a3 3 0 0 0-3-3v2zm1 1v6h2V7h-2zm0 6a1 1 0 0 1-1 1v2a3 3 0 0 0 3-3h-2zm-1 1h-2v2h2v-2zm-3 1v4h2v-4h-2zm1.707 3.293l-4-4-1.414 1.414 4 4 1.414-1.414zM11 14H7v2h4v-2zm-4 0c-.276 0-.525-.111-.707-.293l-1.414 1.414C5.42 15.663 6.172 16 7 16v-2zm-.707 1.121l3.414-3.414-1.414-1.414-3.414 3.414 1.414 1.414zM9 12h4v-2H9v2zm4 0a3 3 0 0 0 3-3h-2a1 1 0 0 1-1 1v2zm3-3V3h-2v6h2zm0-6a3 3 0 0 0-3-3v2a1 1 0 0 1 1 1h2zm-3-3H3v2h10V0zM3 0a3 3 0 0 0-3 3h2a1 1 0 0 1 1-1V0zM0 3v6h2V3H0zm0 6a3 3 0 0 0 3 3v-2a1 1 0 0 1-1-1H0zm3 3h2v-2H3v2zm1-1v4h2v-4H4zm1.707 4.707l.586-.586-1.414-1.414-.586.586 1.414 1.414z"
|
||||
/>
|
||||
</svg>
|
||||
</template>
|
||||
7
webui/src/components/icons/IconDocumentation.vue
Normal file
7
webui/src/components/icons/IconDocumentation.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" fill="currentColor">
|
||||
<path
|
||||
d="M11 2.253a1 1 0 1 0-2 0h2zm-2 13a1 1 0 1 0 2 0H9zm.447-12.167a1 1 0 1 0 1.107-1.666L9.447 3.086zM1 2.253L.447 1.42A1 1 0 0 0 0 2.253h1zm0 13H0a1 1 0 0 0 1.553.833L1 15.253zm8.447.833a1 1 0 1 0 1.107-1.666l-1.107 1.666zm0-14.666a1 1 0 1 0 1.107 1.666L9.447 1.42zM19 2.253h1a1 1 0 0 0-.447-.833L19 2.253zm0 13l-.553.833A1 1 0 0 0 20 15.253h-1zm-9.553-.833a1 1 0 1 0 1.107 1.666L9.447 14.42zM9 2.253v13h2v-13H9zm1.553-.833C9.203.523 7.42 0 5.5 0v2c1.572 0 2.961.431 3.947 1.086l1.107-1.666zM5.5 0C3.58 0 1.797.523.447 1.42l1.107 1.666C2.539 2.431 3.928 2 5.5 2V0zM0 2.253v13h2v-13H0zm1.553 13.833C2.539 15.431 3.928 15 5.5 15v-2c-1.92 0-3.703.523-5.053 1.42l1.107 1.666zM5.5 15c1.572 0 2.961.431 3.947 1.086l1.107-1.666C9.203 13.523 7.42 13 5.5 13v2zm5.053-11.914C11.539 2.431 12.928 2 14.5 2V0c-1.92 0-3.703.523-5.053 1.42l1.107 1.666zM14.5 2c1.573 0 2.961.431 3.947 1.086l1.107-1.666C18.203.523 16.421 0 14.5 0v2zm3.5.253v13h2v-13h-2zm1.553 12.167C18.203 13.523 16.421 13 14.5 13v2c1.573 0 2.961.431 3.947 1.086l1.107-1.666zM14.5 13c-1.92 0-3.703.523-5.053 1.42l1.107 1.666C11.539 15.431 12.928 15 14.5 15v-2z"
|
||||
/>
|
||||
</svg>
|
||||
</template>
|
||||
7
webui/src/components/icons/IconEcosystem.vue
Normal file
7
webui/src/components/icons/IconEcosystem.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" fill="currentColor">
|
||||
<path
|
||||
d="M11.447 8.894a1 1 0 1 0-.894-1.789l.894 1.789zm-2.894-.789a1 1 0 1 0 .894 1.789l-.894-1.789zm0 1.789a1 1 0 1 0 .894-1.789l-.894 1.789zM7.447 7.106a1 1 0 1 0-.894 1.789l.894-1.789zM10 9a1 1 0 1 0-2 0h2zm-2 2.5a1 1 0 1 0 2 0H8zm9.447-5.606a1 1 0 1 0-.894-1.789l.894 1.789zm-2.894-.789a1 1 0 1 0 .894 1.789l-.894-1.789zm2 .789a1 1 0 1 0 .894-1.789l-.894 1.789zm-1.106-2.789a1 1 0 1 0-.894 1.789l.894-1.789zM18 5a1 1 0 1 0-2 0h2zm-2 2.5a1 1 0 1 0 2 0h-2zm-5.447-4.606a1 1 0 1 0 .894-1.789l-.894 1.789zM9 1l.447-.894a1 1 0 0 0-.894 0L9 1zm-2.447.106a1 1 0 1 0 .894 1.789l-.894-1.789zm-6 3a1 1 0 1 0 .894 1.789L.553 4.106zm2.894.789a1 1 0 1 0-.894-1.789l.894 1.789zm-2-.789a1 1 0 1 0-.894 1.789l.894-1.789zm1.106 2.789a1 1 0 1 0 .894-1.789l-.894 1.789zM2 5a1 1 0 1 0-2 0h2zM0 7.5a1 1 0 1 0 2 0H0zm8.553 12.394a1 1 0 1 0 .894-1.789l-.894 1.789zm-1.106-2.789a1 1 0 1 0-.894 1.789l.894-1.789zm1.106 1a1 1 0 1 0 .894 1.789l-.894-1.789zm2.894.789a1 1 0 1 0-.894-1.789l.894 1.789zM8 19a1 1 0 1 0 2 0H8zm2-2.5a1 1 0 1 0-2 0h2zm-7.447.394a1 1 0 1 0 .894-1.789l-.894 1.789zM1 15H0a1 1 0 0 0 .553.894L1 15zm1-2.5a1 1 0 1 0-2 0h2zm12.553 2.606a1 1 0 1 0 .894 1.789l-.894-1.789zM17 15l.447.894A1 1 0 0 0 18 15h-1zm1-2.5a1 1 0 1 0-2 0h2zm-7.447-5.394l-2 1 .894 1.789 2-1-.894-1.789zm-1.106 1l-2-1-.894 1.789 2 1 .894-1.789zM8 9v2.5h2V9H8zm8.553-4.894l-2 1 .894 1.789 2-1-.894-1.789zm.894 0l-2-1-.894 1.789 2 1 .894-1.789zM16 5v2.5h2V5h-2zm-4.553-3.894l-2-1-.894 1.789 2 1 .894-1.789zm-2.894-1l-2 1 .894 1.789 2-1L8.553.106zM1.447 5.894l2-1-.894-1.789-2 1 .894 1.789zm-.894 0l2 1 .894-1.789-2-1-.894 1.789zM0 5v2.5h2V5H0zm9.447 13.106l-2-1-.894 1.789 2 1 .894-1.789zm0 1.789l2-1-.894-1.789-2 1 .894 1.789zM10 19v-2.5H8V19h2zm-6.553-3.894l-2-1-.894 1.789 2 1 .894-1.789zM2 15v-2.5H0V15h2zm13.447 1.894l2-1-.894-1.789-2 1 .894 1.789zM18 15v-2.5h-2V15h2z"
|
||||
/>
|
||||
</svg>
|
||||
</template>
|
||||
7
webui/src/components/icons/IconSupport.vue
Normal file
7
webui/src/components/icons/IconSupport.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor">
|
||||
<path
|
||||
d="M10 3.22l-.61-.6a5.5 5.5 0 0 0-7.666.105 5.5 5.5 0 0 0-.114 7.665L10 18.78l8.39-8.4a5.5 5.5 0 0 0-.114-7.665 5.5 5.5 0 0 0-7.666-.105l-.61.61z"
|
||||
/>
|
||||
</svg>
|
||||
</template>
|
||||
19
webui/src/components/icons/IconTooling.vue
Normal file
19
webui/src/components/icons/IconTooling.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<!-- This icon is from <https://github.com/Templarian/MaterialDesign>, distributed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0) license-->
|
||||
<template>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
aria-hidden="true"
|
||||
role="img"
|
||||
class="iconify iconify--mdi"
|
||||
width="24"
|
||||
height="24"
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
d="M20 18v-4h-3v1h-2v-1H9v1H7v-1H4v4h16M6.33 8l-1.74 4H7v-1h2v1h6v-1h2v1h2.41l-1.74-4H6.33M9 5v1h6V5H9m12.84 7.61c.1.22.16.48.16.8V18c0 .53-.21 1-.6 1.41c-.4.4-.85.59-1.4.59H4c-.55 0-1-.19-1.4-.59C2.21 19 2 18.53 2 18v-4.59c0-.32.06-.58.16-.8L4.5 7.22C4.84 6.41 5.45 6 6.33 6H7V5c0-.55.18-1 .57-1.41C7.96 3.2 8.44 3 9 3h6c.56 0 1.04.2 1.43.59c.39.41.57.86.57 1.41v1h.67c.88 0 1.49.41 1.83 1.22l2.34 5.39z"
|
||||
fill="currentColor"
|
||||
></path>
|
||||
</svg>
|
||||
</template>
|
||||
965
webui/src/gen/api_services/v1/pastebin_module.ts
Normal file
965
webui/src/gen/api_services/v1/pastebin_module.ts
Normal file
@@ -0,0 +1,965 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "api_services.v1";
|
||||
|
||||
export enum ExpireLevel {
|
||||
Forever = 0,
|
||||
Day = 1,
|
||||
Week = 2,
|
||||
Month = 3,
|
||||
Year = 4,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function expireLevelFromJSON(object: any): ExpireLevel {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "Forever":
|
||||
return ExpireLevel.Forever;
|
||||
case 1:
|
||||
case "Day":
|
||||
return ExpireLevel.Day;
|
||||
case 2:
|
||||
case "Week":
|
||||
return ExpireLevel.Week;
|
||||
case 3:
|
||||
case "Month":
|
||||
return ExpireLevel.Month;
|
||||
case 4:
|
||||
case "Year":
|
||||
return ExpireLevel.Year;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return ExpireLevel.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function expireLevelToJSON(object: ExpireLevel): string {
|
||||
switch (object) {
|
||||
case ExpireLevel.Forever:
|
||||
return "Forever";
|
||||
case ExpireLevel.Day:
|
||||
return "Day";
|
||||
case ExpireLevel.Week:
|
||||
return "Week";
|
||||
case ExpireLevel.Month:
|
||||
return "Month";
|
||||
case ExpireLevel.Year:
|
||||
return "Year";
|
||||
case ExpireLevel.UNRECOGNIZED:
|
||||
default:
|
||||
return "UNRECOGNIZED";
|
||||
}
|
||||
}
|
||||
|
||||
export interface PastebinServiceRecord {
|
||||
/** 记录ID */
|
||||
id: number;
|
||||
/** 记录别名 */
|
||||
key: string;
|
||||
/** 记录标题 */
|
||||
title: string;
|
||||
/** 记录渲染后内容 */
|
||||
content: string;
|
||||
/** 记录创建时间 */
|
||||
created_at: string;
|
||||
/** 过期时间 */
|
||||
expired_at: string;
|
||||
/** 是否需要密码 */
|
||||
need_password: boolean;
|
||||
/** 是否可以修订 */
|
||||
editable: boolean;
|
||||
/** 指定记录有效期 */
|
||||
expire_level: ExpireLevel;
|
||||
/** 指定需要密码访问 */
|
||||
password: string;
|
||||
/** 指定语言 */
|
||||
lang: string;
|
||||
/** 作者 */
|
||||
author: string;
|
||||
}
|
||||
|
||||
export interface PastebinServiceListReq {
|
||||
/** 分页大小 */
|
||||
page_size: number;
|
||||
/** 当前页 从第一页开始 */
|
||||
current_page: number;
|
||||
}
|
||||
|
||||
export interface PastebinServiceListResp {
|
||||
/** 列表 */
|
||||
items: PastebinServiceRecord[];
|
||||
/** 是否有下一页 */
|
||||
has_more: boolean;
|
||||
}
|
||||
|
||||
export interface PastebinServiceAddReq {
|
||||
record: PastebinServiceRecord | undefined;
|
||||
}
|
||||
|
||||
export interface PastebinServiceAddResp {
|
||||
}
|
||||
|
||||
export interface PastebinServiceUpdateReq {
|
||||
record: PastebinServiceRecord | undefined;
|
||||
}
|
||||
|
||||
export interface PastebinServiceUpdateResp {
|
||||
}
|
||||
|
||||
export interface PastebinServiceGetReq {
|
||||
key: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface PastebinServiceGetResp {
|
||||
record: PastebinServiceRecord | undefined;
|
||||
}
|
||||
|
||||
function createBasePastebinServiceRecord(): PastebinServiceRecord {
|
||||
return {
|
||||
id: 0,
|
||||
key: "",
|
||||
title: "",
|
||||
content: "",
|
||||
created_at: "",
|
||||
expired_at: "",
|
||||
need_password: false,
|
||||
editable: false,
|
||||
expire_level: 0,
|
||||
password: "",
|
||||
lang: "",
|
||||
author: "",
|
||||
};
|
||||
}
|
||||
|
||||
export const PastebinServiceRecord = {
|
||||
encode(message: PastebinServiceRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).int64(message.id);
|
||||
}
|
||||
if (message.key !== "") {
|
||||
writer.uint32(18).string(message.key);
|
||||
}
|
||||
if (message.title !== "") {
|
||||
writer.uint32(26).string(message.title);
|
||||
}
|
||||
if (message.content !== "") {
|
||||
writer.uint32(42).string(message.content);
|
||||
}
|
||||
if (message.created_at !== "") {
|
||||
writer.uint32(50).string(message.created_at);
|
||||
}
|
||||
if (message.expired_at !== "") {
|
||||
writer.uint32(58).string(message.expired_at);
|
||||
}
|
||||
if (message.need_password === true) {
|
||||
writer.uint32(64).bool(message.need_password);
|
||||
}
|
||||
if (message.editable === true) {
|
||||
writer.uint32(72).bool(message.editable);
|
||||
}
|
||||
if (message.expire_level !== 0) {
|
||||
writer.uint32(80).int32(message.expire_level);
|
||||
}
|
||||
if (message.password !== "") {
|
||||
writer.uint32(90).string(message.password);
|
||||
}
|
||||
if (message.lang !== "") {
|
||||
writer.uint32(98).string(message.lang);
|
||||
}
|
||||
if (message.author !== "") {
|
||||
writer.uint32(106).string(message.author);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PastebinServiceRecord {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePastebinServiceRecord();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.string();
|
||||
continue;
|
||||
case 3:
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.title = reader.string();
|
||||
continue;
|
||||
case 5:
|
||||
if (tag !== 42) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.content = reader.string();
|
||||
continue;
|
||||
case 6:
|
||||
if (tag !== 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.created_at = reader.string();
|
||||
continue;
|
||||
case 7:
|
||||
if (tag !== 58) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.expired_at = reader.string();
|
||||
continue;
|
||||
case 8:
|
||||
if (tag !== 64) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.need_password = reader.bool();
|
||||
continue;
|
||||
case 9:
|
||||
if (tag !== 72) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.editable = reader.bool();
|
||||
continue;
|
||||
case 10:
|
||||
if (tag !== 80) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.expire_level = reader.int32() as any;
|
||||
continue;
|
||||
case 11:
|
||||
if (tag !== 90) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.password = reader.string();
|
||||
continue;
|
||||
case 12:
|
||||
if (tag !== 98) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.lang = reader.string();
|
||||
continue;
|
||||
case 13:
|
||||
if (tag !== 106) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.author = reader.string();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PastebinServiceRecord {
|
||||
return {
|
||||
id: isSet(object.id) ? Number(object.id) : 0,
|
||||
key: isSet(object.key) ? String(object.key) : "",
|
||||
title: isSet(object.title) ? String(object.title) : "",
|
||||
content: isSet(object.content) ? String(object.content) : "",
|
||||
created_at: isSet(object.createdAt) ? String(object.createdAt) : "",
|
||||
expired_at: isSet(object.expiredAt) ? String(object.expiredAt) : "",
|
||||
need_password: isSet(object.needPassword) ? Boolean(object.needPassword) : false,
|
||||
editable: isSet(object.editable) ? Boolean(object.editable) : false,
|
||||
expire_level: isSet(object.expireLevel) ? expireLevelFromJSON(object.expireLevel) : 0,
|
||||
password: isSet(object.password) ? String(object.password) : "",
|
||||
lang: isSet(object.lang) ? String(object.lang) : "",
|
||||
author: isSet(object.author) ? String(object.author) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PastebinServiceRecord): unknown {
|
||||
const obj: any = {};
|
||||
if (message.id !== 0) {
|
||||
obj.id = Math.round(message.id);
|
||||
}
|
||||
if (message.key !== "") {
|
||||
obj.key = message.key;
|
||||
}
|
||||
if (message.title !== "") {
|
||||
obj.title = message.title;
|
||||
}
|
||||
if (message.content !== "") {
|
||||
obj.content = message.content;
|
||||
}
|
||||
if (message.created_at !== "") {
|
||||
obj.createdAt = message.created_at;
|
||||
}
|
||||
if (message.expired_at !== "") {
|
||||
obj.expiredAt = message.expired_at;
|
||||
}
|
||||
if (message.need_password === true) {
|
||||
obj.needPassword = message.need_password;
|
||||
}
|
||||
if (message.editable === true) {
|
||||
obj.editable = message.editable;
|
||||
}
|
||||
if (message.expire_level !== 0) {
|
||||
obj.expireLevel = expireLevelToJSON(message.expire_level);
|
||||
}
|
||||
if (message.password !== "") {
|
||||
obj.password = message.password;
|
||||
}
|
||||
if (message.lang !== "") {
|
||||
obj.lang = message.lang;
|
||||
}
|
||||
if (message.author !== "") {
|
||||
obj.author = message.author;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PastebinServiceRecord>, I>>(base?: I): PastebinServiceRecord {
|
||||
return PastebinServiceRecord.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PastebinServiceRecord>, I>>(object: I): PastebinServiceRecord {
|
||||
const message = createBasePastebinServiceRecord();
|
||||
message.id = object.id ?? 0;
|
||||
message.key = object.key ?? "";
|
||||
message.title = object.title ?? "";
|
||||
message.content = object.content ?? "";
|
||||
message.created_at = object.created_at ?? "";
|
||||
message.expired_at = object.expired_at ?? "";
|
||||
message.need_password = object.need_password ?? false;
|
||||
message.editable = object.editable ?? false;
|
||||
message.expire_level = object.expire_level ?? 0;
|
||||
message.password = object.password ?? "";
|
||||
message.lang = object.lang ?? "";
|
||||
message.author = object.author ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePastebinServiceListReq(): PastebinServiceListReq {
|
||||
return { page_size: 0, current_page: 0 };
|
||||
}
|
||||
|
||||
export const PastebinServiceListReq = {
|
||||
encode(message: PastebinServiceListReq, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.page_size !== 0) {
|
||||
writer.uint32(8).int64(message.page_size);
|
||||
}
|
||||
if (message.current_page !== 0) {
|
||||
writer.uint32(16).int64(message.current_page);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PastebinServiceListReq {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePastebinServiceListReq();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.page_size = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.current_page = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PastebinServiceListReq {
|
||||
return {
|
||||
page_size: isSet(object.pageSize) ? Number(object.pageSize) : 0,
|
||||
current_page: isSet(object.currentPage) ? Number(object.currentPage) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PastebinServiceListReq): unknown {
|
||||
const obj: any = {};
|
||||
if (message.page_size !== 0) {
|
||||
obj.pageSize = Math.round(message.page_size);
|
||||
}
|
||||
if (message.current_page !== 0) {
|
||||
obj.currentPage = Math.round(message.current_page);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PastebinServiceListReq>, I>>(base?: I): PastebinServiceListReq {
|
||||
return PastebinServiceListReq.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PastebinServiceListReq>, I>>(object: I): PastebinServiceListReq {
|
||||
const message = createBasePastebinServiceListReq();
|
||||
message.page_size = object.page_size ?? 0;
|
||||
message.current_page = object.current_page ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePastebinServiceListResp(): PastebinServiceListResp {
|
||||
return { items: [], has_more: false };
|
||||
}
|
||||
|
||||
export const PastebinServiceListResp = {
|
||||
encode(message: PastebinServiceListResp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
for (const v of message.items) {
|
||||
PastebinServiceRecord.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
if (message.has_more === true) {
|
||||
writer.uint32(16).bool(message.has_more);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PastebinServiceListResp {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePastebinServiceListResp();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.items.push(PastebinServiceRecord.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.has_more = reader.bool();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PastebinServiceListResp {
|
||||
return {
|
||||
items: Array.isArray(object?.items) ? object.items.map((e: any) => PastebinServiceRecord.fromJSON(e)) : [],
|
||||
has_more: isSet(object.hasMore) ? Boolean(object.hasMore) : false,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PastebinServiceListResp): unknown {
|
||||
const obj: any = {};
|
||||
if (message.items?.length) {
|
||||
obj.items = message.items.map((e) => PastebinServiceRecord.toJSON(e));
|
||||
}
|
||||
if (message.has_more === true) {
|
||||
obj.hasMore = message.has_more;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PastebinServiceListResp>, I>>(base?: I): PastebinServiceListResp {
|
||||
return PastebinServiceListResp.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PastebinServiceListResp>, I>>(object: I): PastebinServiceListResp {
|
||||
const message = createBasePastebinServiceListResp();
|
||||
message.items = object.items?.map((e) => PastebinServiceRecord.fromPartial(e)) || [];
|
||||
message.has_more = object.has_more ?? false;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePastebinServiceAddReq(): PastebinServiceAddReq {
|
||||
return { record: undefined };
|
||||
}
|
||||
|
||||
export const PastebinServiceAddReq = {
|
||||
encode(message: PastebinServiceAddReq, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.record !== undefined) {
|
||||
PastebinServiceRecord.encode(message.record, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PastebinServiceAddReq {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePastebinServiceAddReq();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.record = PastebinServiceRecord.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PastebinServiceAddReq {
|
||||
return { record: isSet(object.record) ? PastebinServiceRecord.fromJSON(object.record) : undefined };
|
||||
},
|
||||
|
||||
toJSON(message: PastebinServiceAddReq): unknown {
|
||||
const obj: any = {};
|
||||
if (message.record !== undefined) {
|
||||
obj.record = PastebinServiceRecord.toJSON(message.record);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PastebinServiceAddReq>, I>>(base?: I): PastebinServiceAddReq {
|
||||
return PastebinServiceAddReq.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PastebinServiceAddReq>, I>>(object: I): PastebinServiceAddReq {
|
||||
const message = createBasePastebinServiceAddReq();
|
||||
message.record = (object.record !== undefined && object.record !== null)
|
||||
? PastebinServiceRecord.fromPartial(object.record)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePastebinServiceAddResp(): PastebinServiceAddResp {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const PastebinServiceAddResp = {
|
||||
encode(_: PastebinServiceAddResp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PastebinServiceAddResp {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePastebinServiceAddResp();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): PastebinServiceAddResp {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: PastebinServiceAddResp): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PastebinServiceAddResp>, I>>(base?: I): PastebinServiceAddResp {
|
||||
return PastebinServiceAddResp.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PastebinServiceAddResp>, I>>(_: I): PastebinServiceAddResp {
|
||||
const message = createBasePastebinServiceAddResp();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePastebinServiceUpdateReq(): PastebinServiceUpdateReq {
|
||||
return { record: undefined };
|
||||
}
|
||||
|
||||
export const PastebinServiceUpdateReq = {
|
||||
encode(message: PastebinServiceUpdateReq, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.record !== undefined) {
|
||||
PastebinServiceRecord.encode(message.record, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PastebinServiceUpdateReq {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePastebinServiceUpdateReq();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.record = PastebinServiceRecord.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PastebinServiceUpdateReq {
|
||||
return { record: isSet(object.record) ? PastebinServiceRecord.fromJSON(object.record) : undefined };
|
||||
},
|
||||
|
||||
toJSON(message: PastebinServiceUpdateReq): unknown {
|
||||
const obj: any = {};
|
||||
if (message.record !== undefined) {
|
||||
obj.record = PastebinServiceRecord.toJSON(message.record);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PastebinServiceUpdateReq>, I>>(base?: I): PastebinServiceUpdateReq {
|
||||
return PastebinServiceUpdateReq.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PastebinServiceUpdateReq>, I>>(object: I): PastebinServiceUpdateReq {
|
||||
const message = createBasePastebinServiceUpdateReq();
|
||||
message.record = (object.record !== undefined && object.record !== null)
|
||||
? PastebinServiceRecord.fromPartial(object.record)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePastebinServiceUpdateResp(): PastebinServiceUpdateResp {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const PastebinServiceUpdateResp = {
|
||||
encode(_: PastebinServiceUpdateResp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PastebinServiceUpdateResp {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePastebinServiceUpdateResp();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): PastebinServiceUpdateResp {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: PastebinServiceUpdateResp): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PastebinServiceUpdateResp>, I>>(base?: I): PastebinServiceUpdateResp {
|
||||
return PastebinServiceUpdateResp.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PastebinServiceUpdateResp>, I>>(_: I): PastebinServiceUpdateResp {
|
||||
const message = createBasePastebinServiceUpdateResp();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePastebinServiceGetReq(): PastebinServiceGetReq {
|
||||
return { key: "", password: "" };
|
||||
}
|
||||
|
||||
export const PastebinServiceGetReq = {
|
||||
encode(message: PastebinServiceGetReq, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.key !== "") {
|
||||
writer.uint32(10).string(message.key);
|
||||
}
|
||||
if (message.password !== "") {
|
||||
writer.uint32(18).string(message.password);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PastebinServiceGetReq {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePastebinServiceGetReq();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.string();
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.password = reader.string();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PastebinServiceGetReq {
|
||||
return {
|
||||
key: isSet(object.key) ? String(object.key) : "",
|
||||
password: isSet(object.password) ? String(object.password) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PastebinServiceGetReq): unknown {
|
||||
const obj: any = {};
|
||||
if (message.key !== "") {
|
||||
obj.key = message.key;
|
||||
}
|
||||
if (message.password !== "") {
|
||||
obj.password = message.password;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PastebinServiceGetReq>, I>>(base?: I): PastebinServiceGetReq {
|
||||
return PastebinServiceGetReq.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PastebinServiceGetReq>, I>>(object: I): PastebinServiceGetReq {
|
||||
const message = createBasePastebinServiceGetReq();
|
||||
message.key = object.key ?? "";
|
||||
message.password = object.password ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePastebinServiceGetResp(): PastebinServiceGetResp {
|
||||
return { record: undefined };
|
||||
}
|
||||
|
||||
export const PastebinServiceGetResp = {
|
||||
encode(message: PastebinServiceGetResp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.record !== undefined) {
|
||||
PastebinServiceRecord.encode(message.record, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PastebinServiceGetResp {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePastebinServiceGetResp();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.record = PastebinServiceRecord.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PastebinServiceGetResp {
|
||||
return { record: isSet(object.record) ? PastebinServiceRecord.fromJSON(object.record) : undefined };
|
||||
},
|
||||
|
||||
toJSON(message: PastebinServiceGetResp): unknown {
|
||||
const obj: any = {};
|
||||
if (message.record !== undefined) {
|
||||
obj.record = PastebinServiceRecord.toJSON(message.record);
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<PastebinServiceGetResp>, I>>(base?: I): PastebinServiceGetResp {
|
||||
return PastebinServiceGetResp.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<PastebinServiceGetResp>, I>>(object: I): PastebinServiceGetResp {
|
||||
const message = createBasePastebinServiceGetResp();
|
||||
message.record = (object.record !== undefined && object.record !== null)
|
||||
? PastebinServiceRecord.fromPartial(object.record)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @route_group: true
|
||||
* @base_url: /v1/pastebin
|
||||
* @gen_to: ./api_services/v1/pastebin_controller.go
|
||||
*/
|
||||
export interface PastebinService {
|
||||
/**
|
||||
* @desc: 列表
|
||||
* @author: Young Xu
|
||||
* @method: GET
|
||||
* @api: /list
|
||||
*/
|
||||
List(request: PastebinServiceListReq): Promise<PastebinServiceListResp>;
|
||||
/**
|
||||
* @desc: 新建
|
||||
* @author: Young Xu
|
||||
* @method: PUT
|
||||
* @api: /add
|
||||
*/
|
||||
Add(request: PastebinServiceAddReq): Promise<PastebinServiceAddResp>;
|
||||
/**
|
||||
* @desc: 更新
|
||||
* @author: Young Xu
|
||||
* @method: POST
|
||||
* @api: /update
|
||||
*/
|
||||
Update(request: PastebinServiceUpdateReq): Promise<PastebinServiceUpdateResp>;
|
||||
/**
|
||||
* @desc: 获取一条记录
|
||||
* @author: Young Xu
|
||||
* @method: GET
|
||||
* @api: /get
|
||||
*/
|
||||
Get(request: PastebinServiceGetReq): Promise<PastebinServiceGetResp>;
|
||||
}
|
||||
|
||||
export const PastebinServiceServiceName = "api_services.v1.PastebinService";
|
||||
export class PastebinServiceClientImpl implements PastebinService {
|
||||
private readonly rpc: Rpc;
|
||||
private readonly service: string;
|
||||
constructor(rpc: Rpc, opts?: { service?: string }) {
|
||||
this.service = opts?.service || PastebinServiceServiceName;
|
||||
this.rpc = rpc;
|
||||
this.List = this.List.bind(this);
|
||||
this.Add = this.Add.bind(this);
|
||||
this.Update = this.Update.bind(this);
|
||||
this.Get = this.Get.bind(this);
|
||||
}
|
||||
List(request: PastebinServiceListReq): Promise<PastebinServiceListResp> {
|
||||
const data = PastebinServiceListReq.encode(request).finish();
|
||||
const promise = this.rpc.request(this.service, "List", data);
|
||||
return promise.then((data) => PastebinServiceListResp.decode(_m0.Reader.create(data)));
|
||||
}
|
||||
|
||||
Add(request: PastebinServiceAddReq): Promise<PastebinServiceAddResp> {
|
||||
const data = PastebinServiceAddReq.encode(request).finish();
|
||||
const promise = this.rpc.request(this.service, "Add", data);
|
||||
return promise.then((data) => PastebinServiceAddResp.decode(_m0.Reader.create(data)));
|
||||
}
|
||||
|
||||
Update(request: PastebinServiceUpdateReq): Promise<PastebinServiceUpdateResp> {
|
||||
const data = PastebinServiceUpdateReq.encode(request).finish();
|
||||
const promise = this.rpc.request(this.service, "Update", data);
|
||||
return promise.then((data) => PastebinServiceUpdateResp.decode(_m0.Reader.create(data)));
|
||||
}
|
||||
|
||||
Get(request: PastebinServiceGetReq): Promise<PastebinServiceGetResp> {
|
||||
const data = PastebinServiceGetReq.encode(request).finish();
|
||||
const promise = this.rpc.request(this.service, "Get", data);
|
||||
return promise.then((data) => PastebinServiceGetResp.decode(_m0.Reader.create(data)));
|
||||
}
|
||||
}
|
||||
|
||||
interface Rpc {
|
||||
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
||||
}
|
||||
|
||||
declare const self: any | undefined;
|
||||
declare const window: any | undefined;
|
||||
declare const global: any | undefined;
|
||||
const tsProtoGlobalThis: any = (() => {
|
||||
if (typeof globalThis !== "undefined") {
|
||||
return globalThis;
|
||||
}
|
||||
if (typeof self !== "undefined") {
|
||||
return self;
|
||||
}
|
||||
if (typeof window !== "undefined") {
|
||||
return window;
|
||||
}
|
||||
if (typeof global !== "undefined") {
|
||||
return global;
|
||||
}
|
||||
throw "Unable to locate global object";
|
||||
})();
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
||||
|
||||
function longToNumber(long: Long): number {
|
||||
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
||||
throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
||||
}
|
||||
return long.toNumber();
|
||||
}
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
298
webui/src/gen/model/v1/pastebin_model.ts
Normal file
298
webui/src/gen/model/v1/pastebin_model.ts
Normal file
@@ -0,0 +1,298 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "model.v1";
|
||||
|
||||
/** @table_name: pastebin */
|
||||
export interface ModelPastebin {
|
||||
/** ID */
|
||||
id: number;
|
||||
/** 创建时间 */
|
||||
created_at: number;
|
||||
/** 过期时间 */
|
||||
expired_at: number;
|
||||
/** ID别名 */
|
||||
short_id: string;
|
||||
/** 标题 */
|
||||
title: string;
|
||||
/** 作者 */
|
||||
author: string;
|
||||
/** 内容 */
|
||||
content: string;
|
||||
/** 语言 */
|
||||
lang: string;
|
||||
/** 是否需要密码 */
|
||||
password: string;
|
||||
/** 是否需要密码 */
|
||||
need_password: boolean;
|
||||
/** 是否可以修改 */
|
||||
editable: boolean;
|
||||
}
|
||||
|
||||
function createBaseModelPastebin(): ModelPastebin {
|
||||
return {
|
||||
id: 0,
|
||||
created_at: 0,
|
||||
expired_at: 0,
|
||||
short_id: "",
|
||||
title: "",
|
||||
author: "",
|
||||
content: "",
|
||||
lang: "",
|
||||
password: "",
|
||||
need_password: false,
|
||||
editable: false,
|
||||
};
|
||||
}
|
||||
|
||||
export const ModelPastebin = {
|
||||
encode(message: ModelPastebin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).int64(message.id);
|
||||
}
|
||||
if (message.created_at !== 0) {
|
||||
writer.uint32(16).int64(message.created_at);
|
||||
}
|
||||
if (message.expired_at !== 0) {
|
||||
writer.uint32(24).int64(message.expired_at);
|
||||
}
|
||||
if (message.short_id !== "") {
|
||||
writer.uint32(34).string(message.short_id);
|
||||
}
|
||||
if (message.title !== "") {
|
||||
writer.uint32(42).string(message.title);
|
||||
}
|
||||
if (message.author !== "") {
|
||||
writer.uint32(50).string(message.author);
|
||||
}
|
||||
if (message.content !== "") {
|
||||
writer.uint32(58).string(message.content);
|
||||
}
|
||||
if (message.lang !== "") {
|
||||
writer.uint32(66).string(message.lang);
|
||||
}
|
||||
if (message.password !== "") {
|
||||
writer.uint32(74).string(message.password);
|
||||
}
|
||||
if (message.need_password === true) {
|
||||
writer.uint32(80).bool(message.need_password);
|
||||
}
|
||||
if (message.editable === true) {
|
||||
writer.uint32(88).bool(message.editable);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): ModelPastebin {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseModelPastebin();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.created_at = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 3:
|
||||
if (tag !== 24) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.expired_at = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 4:
|
||||
if (tag !== 34) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.short_id = reader.string();
|
||||
continue;
|
||||
case 5:
|
||||
if (tag !== 42) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.title = reader.string();
|
||||
continue;
|
||||
case 6:
|
||||
if (tag !== 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.author = reader.string();
|
||||
continue;
|
||||
case 7:
|
||||
if (tag !== 58) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.content = reader.string();
|
||||
continue;
|
||||
case 8:
|
||||
if (tag !== 66) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.lang = reader.string();
|
||||
continue;
|
||||
case 9:
|
||||
if (tag !== 74) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.password = reader.string();
|
||||
continue;
|
||||
case 10:
|
||||
if (tag !== 80) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.need_password = reader.bool();
|
||||
continue;
|
||||
case 11:
|
||||
if (tag !== 88) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.editable = reader.bool();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ModelPastebin {
|
||||
return {
|
||||
id: isSet(object.id) ? Number(object.id) : 0,
|
||||
created_at: isSet(object.createdAt) ? Number(object.createdAt) : 0,
|
||||
expired_at: isSet(object.expiredAt) ? Number(object.expiredAt) : 0,
|
||||
short_id: isSet(object.shortId) ? String(object.shortId) : "",
|
||||
title: isSet(object.title) ? String(object.title) : "",
|
||||
author: isSet(object.author) ? String(object.author) : "",
|
||||
content: isSet(object.content) ? String(object.content) : "",
|
||||
lang: isSet(object.lang) ? String(object.lang) : "",
|
||||
password: isSet(object.password) ? String(object.password) : "",
|
||||
need_password: isSet(object.needPassword) ? Boolean(object.needPassword) : false,
|
||||
editable: isSet(object.editable) ? Boolean(object.editable) : false,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ModelPastebin): unknown {
|
||||
const obj: any = {};
|
||||
if (message.id !== 0) {
|
||||
obj.id = Math.round(message.id);
|
||||
}
|
||||
if (message.created_at !== 0) {
|
||||
obj.createdAt = Math.round(message.created_at);
|
||||
}
|
||||
if (message.expired_at !== 0) {
|
||||
obj.expiredAt = Math.round(message.expired_at);
|
||||
}
|
||||
if (message.short_id !== "") {
|
||||
obj.shortId = message.short_id;
|
||||
}
|
||||
if (message.title !== "") {
|
||||
obj.title = message.title;
|
||||
}
|
||||
if (message.author !== "") {
|
||||
obj.author = message.author;
|
||||
}
|
||||
if (message.content !== "") {
|
||||
obj.content = message.content;
|
||||
}
|
||||
if (message.lang !== "") {
|
||||
obj.lang = message.lang;
|
||||
}
|
||||
if (message.password !== "") {
|
||||
obj.password = message.password;
|
||||
}
|
||||
if (message.need_password === true) {
|
||||
obj.needPassword = message.need_password;
|
||||
}
|
||||
if (message.editable === true) {
|
||||
obj.editable = message.editable;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<ModelPastebin>, I>>(base?: I): ModelPastebin {
|
||||
return ModelPastebin.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ModelPastebin>, I>>(object: I): ModelPastebin {
|
||||
const message = createBaseModelPastebin();
|
||||
message.id = object.id ?? 0;
|
||||
message.created_at = object.created_at ?? 0;
|
||||
message.expired_at = object.expired_at ?? 0;
|
||||
message.short_id = object.short_id ?? "";
|
||||
message.title = object.title ?? "";
|
||||
message.author = object.author ?? "";
|
||||
message.content = object.content ?? "";
|
||||
message.lang = object.lang ?? "";
|
||||
message.password = object.password ?? "";
|
||||
message.need_password = object.need_password ?? false;
|
||||
message.editable = object.editable ?? false;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
declare const self: any | undefined;
|
||||
declare const window: any | undefined;
|
||||
declare const global: any | undefined;
|
||||
const tsProtoGlobalThis: any = (() => {
|
||||
if (typeof globalThis !== "undefined") {
|
||||
return globalThis;
|
||||
}
|
||||
if (typeof self !== "undefined") {
|
||||
return self;
|
||||
}
|
||||
if (typeof window !== "undefined") {
|
||||
return window;
|
||||
}
|
||||
if (typeof global !== "undefined") {
|
||||
return global;
|
||||
}
|
||||
throw "Unable to locate global object";
|
||||
})();
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
||||
|
||||
function longToNumber(long: Long): number {
|
||||
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
||||
throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
||||
}
|
||||
return long.toNumber();
|
||||
}
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
19
webui/src/main.ts
Normal file
19
webui/src/main.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import './assets/base.css'
|
||||
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import Notifications from '@kyvg/vue3-notification'
|
||||
import VueHighlightJS from 'vue3-highlightjs'
|
||||
import 'vue3-highlightjs/styles/gruvbox-dark.css'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(createPinia())
|
||||
app.use(router)
|
||||
app.use(Notifications)
|
||||
app.use(VueHighlightJS)
|
||||
|
||||
app.mount('#app')
|
||||
27
webui/src/request/api.ts
Normal file
27
webui/src/request/api.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import axiosInstance from './request';
|
||||
|
||||
export interface ApiResult<T> {
|
||||
err_code: number;
|
||||
err_msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
export async function get<T>(url: string, params?: any): Promise<ApiResult<T>> {
|
||||
const response = await axiosInstance.get<ApiResult<T>>(url, { params });
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function post<T>(url: string, data?: any): Promise<ApiResult<T>> {
|
||||
const response = await axiosInstance.post<ApiResult<T>>(url, data);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function put<T>(url: string, data?: any): Promise<ApiResult<T>> {
|
||||
const response = await axiosInstance.put<ApiResult<T>>(url, data);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function del<T>(url: string, params?: any): Promise<ApiResult<T>> {
|
||||
const response = await axiosInstance.delete<ApiResult<T>>(url, { params });
|
||||
return response.data;
|
||||
}
|
||||
32
webui/src/request/request.ts
Normal file
32
webui/src/request/request.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import axios, {type AxiosInstance, type AxiosResponse, type InternalAxiosRequestConfig} from 'axios';
|
||||
|
||||
const axiosInstance: AxiosInstance = axios.create({
|
||||
baseURL: '/',
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
// 添加请求拦截器
|
||||
axiosInstance.interceptors.request.use(
|
||||
(config: InternalAxiosRequestConfig) => {
|
||||
// 在发送请求之前做些什么
|
||||
return config;
|
||||
},
|
||||
(error: any) => {
|
||||
// 处理请求错误
|
||||
return Promise.reject(error);
|
||||
},
|
||||
);
|
||||
|
||||
// 添加响应拦截器
|
||||
axiosInstance.interceptors.response.use(
|
||||
(response: AxiosResponse) => {
|
||||
// 对响应数据做点什么
|
||||
return response;
|
||||
},
|
||||
(error: any) => {
|
||||
// 处理响应错误
|
||||
return Promise.reject(error);
|
||||
},
|
||||
);
|
||||
|
||||
export default axiosInstance;
|
||||
24
webui/src/router/index.ts
Normal file
24
webui/src/router/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: () => import('../views/HomeView.vue')
|
||||
},
|
||||
{
|
||||
path: '/list',
|
||||
name: 'list',
|
||||
component: () => import('../views/ListView.vue')
|
||||
},
|
||||
{
|
||||
path: '/view/:id',
|
||||
name: 'view',
|
||||
component: () => import('../views/DocumentView.vue')
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
export default router
|
||||
16
webui/src/stores/counter.ts
Normal file
16
webui/src/stores/counter.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ref } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const usePageStore = defineStore('page', () => {
|
||||
const page = ref('home')
|
||||
function change(pageName:string) {
|
||||
page.value = pageName
|
||||
}
|
||||
|
||||
function reversal() {
|
||||
if (page.value === 'home') return 'list';
|
||||
if (page.value === 'list') return 'home';
|
||||
}
|
||||
|
||||
return { page, change,reversal }
|
||||
})
|
||||
90
webui/src/views/DocumentView.vue
Normal file
90
webui/src/views/DocumentView.vue
Normal file
@@ -0,0 +1,90 @@
|
||||
<script setup lang="ts">
|
||||
import {useRouter} from "vue-router";
|
||||
|
||||
const router = useRouter()
|
||||
let doc_id = ref(router.currentRoute.value.params.id);
|
||||
|
||||
import {get} from "../request/api";
|
||||
import {PastebinServiceGetResp, PastebinServiceRecord} from "@/gen/api_services/v1/pastebin_module.ts";
|
||||
import {onMounted, reactive, ref} from "vue";
|
||||
|
||||
import {useNotification} from "@kyvg/vue3-notification";
|
||||
|
||||
const notification = useNotification()
|
||||
|
||||
let doc_proxy: PastebinServiceRecord = {}
|
||||
let doc = reactive({instance: doc_proxy})
|
||||
|
||||
async function document() {
|
||||
let response = await get<PastebinServiceGetResp>("/v1/pastebin/get?key=" + doc_id.value)
|
||||
if (response.err_code != 0) {
|
||||
notification.notify({
|
||||
title: response.err_msg,
|
||||
type: "error",
|
||||
duration: 15000,
|
||||
});
|
||||
return
|
||||
}
|
||||
doc.instance = response.data.record
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await document()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-row w-full">
|
||||
<div class="basis-1/4"></div>
|
||||
<div class="basis-1/2">
|
||||
<div class="stats stats-vertical lg:stats-horizontal shadow">
|
||||
|
||||
<div class="stat">
|
||||
<div class="stat-title">作者</div>
|
||||
<div class="stat-value">{{ doc.instance.author }}</div>
|
||||
</div>
|
||||
|
||||
<div class="stat">
|
||||
<div class="stat-title">创建时间</div>
|
||||
<div class="stat-value">{{ doc.instance.created_at }}</div>
|
||||
</div>
|
||||
|
||||
<div class="stat">
|
||||
<div class="stat-title">过期时间</div>
|
||||
<div class="stat-value">{{ doc.instance.expired_at }}</div>
|
||||
</div>
|
||||
|
||||
<div class="stat">
|
||||
<div class="stat-title">使用语言</div>
|
||||
<div class="stat-value">{{ doc.instance.lang }}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="mockup-code">
|
||||
<pre v-highlightjs="doc.instance.content"><code :class="doc.instance.lang"></code></pre>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="join grid grid-cols-2 content-center place-items-center mt-8">
|
||||
<button class="join-item btn btn-neutral self-auto">查看原文</button>
|
||||
<button class="join-item btn btn-neutral self-auto" v-if="doc.instance.editable">编辑原文</button>
|
||||
<button class="join-item btn btn-neutral self-auto" v-else disabled>编辑原文</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="basis-1/4"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.mockup-code pre {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.mockup-code pre::before {
|
||||
margin-right: 0;
|
||||
}
|
||||
</style>
|
||||
138
webui/src/views/HomeView.vue
Normal file
138
webui/src/views/HomeView.vue
Normal file
@@ -0,0 +1,138 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { Codemirror } from 'vue-codemirror'
|
||||
import { javascript } from '@codemirror/lang-javascript'
|
||||
import { oneDark } from '@codemirror/theme-one-dark'
|
||||
import { useRouter } from "vue-router";
|
||||
const router = useRouter()
|
||||
|
||||
const extensions = [javascript(), oneDark]
|
||||
|
||||
import {usePageStore} from "@/stores/counter";
|
||||
const pager = usePageStore()
|
||||
pager.change('home')
|
||||
|
||||
import {put} from "../request/api";
|
||||
import {
|
||||
PastebinServiceAddReq,
|
||||
PastebinServiceAddResp,
|
||||
PastebinServiceRecord
|
||||
} from "@/gen/api_services/v1/pastebin_module";
|
||||
import { useNotification } from "@kyvg/vue3-notification";
|
||||
const notification = useNotification()
|
||||
|
||||
let document = ref({
|
||||
code: '',
|
||||
title: '',
|
||||
author: '',
|
||||
password: '',
|
||||
expire_level: 1,
|
||||
lang: 'plaintext',
|
||||
editable: false
|
||||
})
|
||||
|
||||
async function add() {
|
||||
let request:PastebinServiceAddReq = {}
|
||||
let record:PastebinServiceRecord = {}
|
||||
record.title = document.value.title
|
||||
record.author = document.value.author
|
||||
record.content = document.value.code
|
||||
record.password = document.value.password
|
||||
record.expire_level = Number(document.value.expire_level)
|
||||
record.lang = document.value.lang
|
||||
record.editable = Boolean(document.value.editable)
|
||||
request.record = record
|
||||
const response = await put<PastebinServiceAddResp>("/v1/pastebin/add", request)
|
||||
console.log("add response: ", response)
|
||||
if (response.err_code != 0) {
|
||||
notification.notify({
|
||||
title: response.err_msg,
|
||||
type: "error",
|
||||
duration: 15000,
|
||||
});
|
||||
return
|
||||
}
|
||||
await router.push({path: 'list'})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col w-full">
|
||||
<div class="basis-1/4"></div>
|
||||
<div class="basis-1/2 m-auto">
|
||||
<codemirror
|
||||
v-model="document.code"
|
||||
placeholder="Code goes here..."
|
||||
:style="{ height: '500px', fontSize: '16px' }"
|
||||
:autofocus="true"
|
||||
:indent-with-tab="true"
|
||||
:tab-size="2"
|
||||
:extensions="extensions"
|
||||
/>
|
||||
|
||||
<div class="flex flex-row w-full mt-2">
|
||||
<div class="join">
|
||||
<button class="btn join-item">标题</button>
|
||||
<input class="input input-bordered join-item" v-model="document.title"/>
|
||||
</div>
|
||||
|
||||
<div class="join">
|
||||
<button class="btn join-item ml-2">作者</button>
|
||||
<input class="input input-bordered join-item" v-model="document.author"/>
|
||||
</div>
|
||||
|
||||
<div class="join">
|
||||
<button class="btn join-item ml-2">需要密码</button>
|
||||
<input class="input input-bordered join-item" v-model="document.password"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid gap-4 grid-cols-3 mt-2">
|
||||
<div class="join self-auto">
|
||||
<button class="btn join-item">有效期?</button>
|
||||
<select class="select select-bordered w-full max-w-xs join-item" v-model="document.expire_level">
|
||||
<option value="1">1天</option>
|
||||
<option value="2">1周</option>
|
||||
<option value="3">1月</option>
|
||||
<option value="4">1年</option>
|
||||
<option value="0">永久</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="join self-auto">
|
||||
<button class="btn join-item">语言</button>
|
||||
<select class="select select-bordered w-full max-w-xs join-item" v-model="document.lang">
|
||||
<option value="plaintext">Plaintext</option>
|
||||
<option value="markdown">Markdown</option>
|
||||
<option value="bash">Bash</option>
|
||||
<option value="go">Golang</option>
|
||||
<option value="python">Python</option>
|
||||
<option value="java">Java</option>
|
||||
<option value="php">PHP</option>
|
||||
<option value="lua">Lua</option>
|
||||
<option value="javascript">Javascript</option>
|
||||
<option value="typescript">Typescript</option>
|
||||
<option value="html">HTML</option>
|
||||
<option value="css">CSS</option>
|
||||
<option value="sql">SQL</option>
|
||||
<option value="protocol">ProtocolBuffer</option>
|
||||
<option value="yaml">YAML</option>
|
||||
<option value="json">JSON</option>
|
||||
<option value="xml">XML</option>
|
||||
<option value="toml">TOML</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="join self-auto">
|
||||
<button class="btn join-item">是否可编辑?</button>
|
||||
<input class="join-item btn btn-ghost" type="radio" name="options" aria-label="是" value="true" v-model="document.editable" />
|
||||
<input class="join-item btn btn-ghost" type="radio" name="options" aria-label="否" value="false" v-model="document.editable" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid content-center place-items-center mt-8">
|
||||
<button class="btn btn-neutral" @click="add">提交</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="basis-1/4"></div>
|
||||
</div>
|
||||
</template>
|
||||
95
webui/src/views/ListView.vue
Normal file
95
webui/src/views/ListView.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<script setup lang="ts">
|
||||
import {usePageStore} from "@/stores/counter";
|
||||
const pager = usePageStore()
|
||||
pager.change('list')
|
||||
|
||||
import {get} from "../request/api";
|
||||
import {
|
||||
PastebinServiceListResp,
|
||||
PastebinServiceRecord
|
||||
} from "@/gen/api_services/v1/pastebin_module";
|
||||
import {onMounted, reactive, ref} from "vue";
|
||||
|
||||
import { useNotification } from "@kyvg/vue3-notification";
|
||||
const notification = useNotification()
|
||||
|
||||
let items_proxy:PastebinServiceRecord[] = []
|
||||
let pastebin_items = reactive({list: items_proxy})
|
||||
let current_page = ref(1)
|
||||
let pagination_next_disable = ref(false)
|
||||
|
||||
async function list() {
|
||||
const response = await get<PastebinServiceListResp>("/v1/pastebin/list?current_page="+current_page.value)
|
||||
if (response.err_code != 0) {
|
||||
notification.notify({
|
||||
title: response.err_msg,
|
||||
type: "error",
|
||||
duration: 15000,
|
||||
});
|
||||
return
|
||||
}
|
||||
pastebin_items.list = response.data.items
|
||||
if (!response.data.has_more) {
|
||||
pagination_next_disable.value = true
|
||||
}
|
||||
console.log("response: ", response)
|
||||
}
|
||||
|
||||
async function paginationPrev() {
|
||||
if (current_page.value <= 1) return
|
||||
current_page.value--
|
||||
pagination_next_disable.value = false
|
||||
await list()
|
||||
}
|
||||
|
||||
async function paginationNext() {
|
||||
if (pagination_next_disable.value) return
|
||||
current_page.value++
|
||||
await list()
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await list()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-row w-full">
|
||||
<div class="basis-1/4"></div>
|
||||
<div class="basis-1/2">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>标题</th>
|
||||
<th>作者</th>
|
||||
<th>语言</th>
|
||||
<th>ID</th>
|
||||
<th>发布时间</th>
|
||||
<th>过期时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in pastebin_items.list" :key="item.id">
|
||||
<td>{{item.title}}</td>
|
||||
<td>{{item.author}}</td>
|
||||
<td>{{item.lang}}</td>
|
||||
<td>{{item.key}}</td>
|
||||
<td>{{item.created_at}}</td>
|
||||
<td>{{item.expired_at}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="join grid content-center place-items-end mt-8">
|
||||
<div>
|
||||
<button class="join-item btn btn-outline self-auto" @click="paginationPrev" v-if="current_page != 1">Prev</button>
|
||||
<button class="join-item btn btn-outline self-auto" @click="paginationPrev" disabled v-else>Prev</button>
|
||||
<button class="join-item btn btn-outline self-auto" @click="paginationNext" v-if="!pagination_next_disable">Next</button>
|
||||
<button class="join-item btn btn-outline self-auto" @click="paginationNext" disabled v-else>Next</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="basis-1/4"></div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
12
webui/tailwind.config.js
Normal file
12
webui/tailwind.config.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
"./index.html",
|
||||
"./src/**/*.{vue,js,ts,jsx,tsx}",
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [require("daisyui")],
|
||||
}
|
||||
|
||||
26
webui/tsconfig.json
Normal file
26
webui/tsconfig.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"skipLibCheck": true,
|
||||
"types": ["node"],
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "preserve",
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
10
webui/tsconfig.node.json
Normal file
10
webui/tsconfig.node.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
16
webui/vite.config.ts
Normal file
16
webui/vite.config.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user