Fixed frontend
This commit is contained in:
parent
806563de4d
commit
7949110700
7
frontend/.prettierrc
Normal file
7
frontend/.prettierrc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"tabWidth": 4,
|
||||||
|
"useTabs": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"endOfLine": "lf"
|
||||||
|
}
|
@ -1,24 +0,0 @@
|
|||||||
# frontend
|
|
||||||
|
|
||||||
## Project setup
|
|
||||||
```
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
### Compiles and hot-reloads for development
|
|
||||||
```
|
|
||||||
npm run serve
|
|
||||||
```
|
|
||||||
|
|
||||||
### Compiles and minifies for production
|
|
||||||
```
|
|
||||||
npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
### Lints and fixes files
|
|
||||||
```
|
|
||||||
npm run lint
|
|
||||||
```
|
|
||||||
|
|
||||||
### Customize configuration
|
|
||||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
@ -1,3 +1,3 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
presets: ["@vue/cli-plugin-babel/preset"],
|
presets: ['@vue/cli-plugin-babel/preset']
|
||||||
};
|
};
|
||||||
|
29
frontend/eslintrc.js
Normal file
29
frontend/eslintrc.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
module.exports = {
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
parserOptions: {
|
||||||
|
project: 'tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
sourceType: 'module'
|
||||||
|
},
|
||||||
|
plugins: ['@typescript-eslint/eslint-plugin', 'no-relative-import-paths'],
|
||||||
|
extends: [
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
'plugin:prettier/recommended'
|
||||||
|
],
|
||||||
|
root: true,
|
||||||
|
env: {
|
||||||
|
node: true,
|
||||||
|
jest: true
|
||||||
|
},
|
||||||
|
ignorePatterns: ['.eslintrc.js'],
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/interface-name-prefix': 'off',
|
||||||
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||||
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'no-relative-import-paths/no-relative-import-paths': [
|
||||||
|
'error',
|
||||||
|
{ allowSameFolder: true, rootDir: 'src' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
@ -1,64 +1,64 @@
|
|||||||
{
|
{
|
||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service build --watch",
|
"serve": "vue-cli-service build --watch --dest ../run/static",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build",
|
||||||
"lint": "vue-cli-service lint"
|
"lint": "vue-cli-service lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
"class-validator": "^0.13.2",
|
"class-validator": "^0.13.2",
|
||||||
"core-js": "^3.8.3",
|
"core-js": "^3.8.3",
|
||||||
"filesize": "^9.0.11",
|
"filesize": "^9.0.11",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"naive-ui": "^2.32.1",
|
"naive-ui": "^2.32.1",
|
||||||
"stream-browserify": "^3.0.0",
|
"stream-browserify": "^3.0.0",
|
||||||
"util": "^0.12.4",
|
"util": "^0.12.4",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
"vue-router": "^4.0.3"
|
"vue-router": "^4.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
||||||
"@typescript-eslint/parser": "^5.4.0",
|
"@typescript-eslint/parser": "^5.4.0",
|
||||||
"@vue/cli-plugin-babel": "~5.0.0",
|
"@vue/cli-plugin-babel": "~5.0.0",
|
||||||
"@vue/cli-plugin-eslint": "~5.0.0",
|
"@vue/cli-plugin-eslint": "~5.0.0",
|
||||||
"@vue/cli-plugin-router": "~5.0.0",
|
"@vue/cli-plugin-router": "~5.0.0",
|
||||||
"@vue/cli-plugin-typescript": "~5.0.0",
|
"@vue/cli-plugin-typescript": "~5.0.0",
|
||||||
"@vue/cli-service": "~5.0.0",
|
"@vue/cli-service": "~5.0.0",
|
||||||
"@vue/eslint-config-typescript": "^9.1.0",
|
"@vue/eslint-config-typescript": "^9.1.0",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"eslint-plugin-vue": "^8.0.3",
|
"eslint-plugin-vue": "^8.0.3",
|
||||||
"prettier": "^2.4.1",
|
"prettier": "^2.4.1",
|
||||||
"sass": "^1.32.7",
|
"sass": "^1.32.7",
|
||||||
"sass-loader": "^12.0.0",
|
"sass-loader": "^12.0.0",
|
||||||
"typescript": "~4.5.5",
|
"typescript": "~4.5.5",
|
||||||
"vfonts": "^0.0.3"
|
"vfonts": "^0.0.3"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"root": true,
|
"root": true,
|
||||||
"env": {
|
"env": {
|
||||||
"node": true
|
"node": true
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
"plugin:vue/vue3-essential",
|
"plugin:vue/vue3-essential",
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
"@vue/typescript/recommended",
|
"@vue/typescript/recommended",
|
||||||
"plugin:prettier/recommended"
|
"plugin:prettier/recommended"
|
||||||
],
|
],
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 2020
|
"ecmaVersion": 2020
|
||||||
},
|
},
|
||||||
"rules": {}
|
"rules": {}
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"> 1%",
|
"> 1%",
|
||||||
"last 2 versions",
|
"last 2 versions",
|
||||||
"not dead",
|
"not dead",
|
||||||
"not ie 11"
|
"not ie 11"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,22 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="">
|
<html lang="">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||||
<!--suppress HtmlUnknownTarget -->
|
<!--suppress HtmlUnknownTarget -->
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
|
||||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript>
|
||||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
<strong
|
||||||
</noscript>
|
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't
|
||||||
<div id="app"></div>
|
work properly without JavaScript enabled. Please enable it to
|
||||||
<!-- built files will be auto injected -->
|
continue.</strong
|
||||||
</body>
|
>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<!-- built files will be auto injected -->
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,62 +1,62 @@
|
|||||||
<script setup async lang="ts">
|
<script setup async lang="ts">
|
||||||
import { provide, ref } from "vue";
|
import { provide, ref } from 'vue';
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from 'vue-router';
|
||||||
import { TokenInjectType } from "@/api";
|
import { TokenInjectType } from '@/api';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const jwt = ref<string | null>(localStorage.getItem("token"));
|
const jwt = ref<string | null>(localStorage.getItem('token'));
|
||||||
|
|
||||||
function setToken(token: string) {
|
function setToken(token: string) {
|
||||||
jwt.value = token;
|
jwt.value = token;
|
||||||
localStorage.setItem("token", token);
|
localStorage.setItem('token', token);
|
||||||
}
|
}
|
||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
jwt.value = null;
|
jwt.value = null;
|
||||||
localStorage.removeItem("token");
|
localStorage.removeItem('token');
|
||||||
router.push({ name: "login" });
|
router.push({ name: 'login' });
|
||||||
}
|
}
|
||||||
|
|
||||||
provide<TokenInjectType>("jwt", {
|
provide<TokenInjectType>('jwt', {
|
||||||
jwt,
|
jwt,
|
||||||
setToken,
|
setToken,
|
||||||
logout,
|
logout
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<nav>
|
<nav>
|
||||||
<template v-if="jwt != null">
|
<template v-if="jwt != null">
|
||||||
<router-link to="/">Files</router-link>
|
<router-link to="/">Files</router-link>
|
||||||
<span style="margin-left: 2em" />
|
<span style="margin-left: 2em" />
|
||||||
<router-link to="/profile">Profile</router-link>
|
<router-link to="/profile">Profile</router-link>
|
||||||
<span style="margin-left: 2em" />
|
<span style="margin-left: 2em" />
|
||||||
<router-link to="/login" @click="logout()">Logout</router-link>
|
<router-link to="/login" @click="logout()">Logout</router-link>
|
||||||
</template>
|
</template>
|
||||||
</nav>
|
</nav>
|
||||||
<router-view />
|
<router-view />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
#app {
|
#app {
|
||||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #2c3e50;
|
color: #2c3e50;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav {
|
nav {
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #2c3e50;
|
color: #2c3e50;
|
||||||
|
|
||||||
&.router-link-exact-active {
|
&.router-link-exact-active {
|
||||||
color: #42b983;
|
color: #42b983;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import App from "./App";
|
import App from './App';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Suspense>
|
<Suspense>
|
||||||
<App></App>
|
<App></App>
|
||||||
<template #fallback>
|
<template #fallback>
|
||||||
<div>Loading...</div>
|
<div>Loading...</div>
|
||||||
</template>
|
</template>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,54 +1,54 @@
|
|||||||
import { Requests, Responses, UserRole, get_token, post_token } from "./base";
|
import { Requests, Responses, UserRole, get_token, post_token } from './base';
|
||||||
|
|
||||||
export const get_users = (token: string): Promise<Responses.Admin.GetUsers> =>
|
export const get_users = (token: string): Promise<Responses.Admin.GetUsers> =>
|
||||||
get_token("/api/admin/users", token);
|
get_token('/api/admin/users', token);
|
||||||
|
|
||||||
export const set_role = (
|
export const set_role = (
|
||||||
user: number,
|
user: number,
|
||||||
role: UserRole,
|
role: UserRole,
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.Admin.SetUserRole | Responses.ErrorResponse> =>
|
): Promise<Responses.Admin.SetUserRole | Responses.ErrorResponse> =>
|
||||||
post_token<Requests.Admin.SetUserRole>(
|
post_token<Requests.Admin.SetUserRole>(
|
||||||
"/api/admin/set_role",
|
'/api/admin/set_role',
|
||||||
{
|
{
|
||||||
user,
|
user,
|
||||||
role,
|
role
|
||||||
},
|
},
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
|
|
||||||
export const logout = (
|
export const logout = (
|
||||||
user: number,
|
user: number,
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.Admin.LogoutAllUser | Responses.ErrorResponse> =>
|
): Promise<Responses.Admin.LogoutAllUser | Responses.ErrorResponse> =>
|
||||||
post_token<Requests.Admin.LogoutAll>(
|
post_token<Requests.Admin.LogoutAll>(
|
||||||
"/api/admin/logout",
|
'/api/admin/logout',
|
||||||
{
|
{
|
||||||
user,
|
user
|
||||||
},
|
},
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
|
|
||||||
export const delete_user = (
|
export const delete_user = (
|
||||||
user: number,
|
user: number,
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.Admin.DeleteUser | Responses.ErrorResponse> =>
|
): Promise<Responses.Admin.DeleteUser | Responses.ErrorResponse> =>
|
||||||
post_token<Requests.Admin.DeleteUser>(
|
post_token<Requests.Admin.DeleteUser>(
|
||||||
"/api/admin/delete",
|
'/api/admin/delete',
|
||||||
{
|
{
|
||||||
user,
|
user
|
||||||
},
|
},
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
|
|
||||||
export const disable_tfa = (
|
export const disable_tfa = (
|
||||||
user: number,
|
user: number,
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.Admin.DisableTfa | Responses.ErrorResponse> =>
|
): Promise<Responses.Admin.DisableTfa | Responses.ErrorResponse> =>
|
||||||
post_token<Requests.Admin.DisableTfa>(
|
post_token<Requests.Admin.DisableTfa>(
|
||||||
"/api/admin/disable_2fa",
|
'/api/admin/disable_2fa',
|
||||||
{
|
{
|
||||||
user,
|
user
|
||||||
},
|
},
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
|
@ -1,93 +1,93 @@
|
|||||||
import { Responses, Requests, post, post_token } from "./base";
|
import { Responses, Requests, post, post_token } from './base';
|
||||||
|
|
||||||
export const auth_login = (
|
export const auth_login = (
|
||||||
username: string,
|
username: string,
|
||||||
password: string,
|
password: string,
|
||||||
otp?: string
|
otp?: string
|
||||||
): Promise<
|
): Promise<
|
||||||
| Responses.Auth.LoginResponse
|
| Responses.Auth.LoginResponse
|
||||||
| Responses.Auth.TfaRequiredResponse
|
| Responses.Auth.TfaRequiredResponse
|
||||||
| Responses.ErrorResponse
|
| Responses.ErrorResponse
|
||||||
> =>
|
> =>
|
||||||
post<Requests.Auth.LoginRequest>("/api/auth/login", {
|
post<Requests.Auth.LoginRequest>('/api/auth/login', {
|
||||||
username: username,
|
username: username,
|
||||||
password: password,
|
password: password,
|
||||||
otp: otp,
|
otp: otp
|
||||||
});
|
});
|
||||||
|
|
||||||
export const auth_signup = (
|
export const auth_signup = (
|
||||||
username: string,
|
username: string,
|
||||||
password: string
|
password: string
|
||||||
): Promise<Responses.Auth.SignupResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.Auth.SignupResponse | Responses.ErrorResponse> =>
|
||||||
post<Requests.Auth.SignUpRequest>("/api/auth/signup", {
|
post<Requests.Auth.SignUpRequest>('/api/auth/signup', {
|
||||||
username: username,
|
username: username,
|
||||||
password: password,
|
password: password
|
||||||
});
|
});
|
||||||
|
|
||||||
export const refresh_token = (
|
export const refresh_token = (
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.Auth.RefreshResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.Auth.RefreshResponse | Responses.ErrorResponse> =>
|
||||||
post_token("/api/auth/refresh", {}, token);
|
post_token('/api/auth/refresh', {}, token);
|
||||||
|
|
||||||
export const change_password = (
|
export const change_password = (
|
||||||
oldPw: string,
|
oldPw: string,
|
||||||
newPw: string,
|
newPw: string,
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.Auth.ChangePasswordResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.Auth.ChangePasswordResponse | Responses.ErrorResponse> =>
|
||||||
post_token<Requests.Auth.ChangePasswordRequest>(
|
post_token<Requests.Auth.ChangePasswordRequest>(
|
||||||
"/api/auth/change_password",
|
'/api/auth/change_password',
|
||||||
{
|
{
|
||||||
oldPassword: oldPw,
|
oldPassword: oldPw,
|
||||||
newPassword: newPw,
|
newPassword: newPw
|
||||||
},
|
},
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
|
|
||||||
export const logout_all = (
|
export const logout_all = (
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.Auth.LogoutAllResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.Auth.LogoutAllResponse | Responses.ErrorResponse> =>
|
||||||
post_token("/api/auth/logout_all", {}, token);
|
post_token('/api/auth/logout_all', {}, token);
|
||||||
|
|
||||||
export function tfa_setup(
|
export function tfa_setup(
|
||||||
mail: false,
|
mail: false,
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.Auth.RequestTotpTfaResponse | Responses.ErrorResponse>;
|
): Promise<Responses.Auth.RequestTotpTfaResponse | Responses.ErrorResponse>;
|
||||||
export function tfa_setup(
|
export function tfa_setup(
|
||||||
mail: true,
|
mail: true,
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.Auth.RequestEmailTfaResponse | Responses.ErrorResponse>;
|
): Promise<Responses.Auth.RequestEmailTfaResponse | Responses.ErrorResponse>;
|
||||||
export function tfa_setup(
|
export function tfa_setup(
|
||||||
mail: boolean,
|
mail: boolean,
|
||||||
token: string
|
token: string
|
||||||
): Promise<
|
): Promise<
|
||||||
| Responses.Auth.RequestEmailTfaResponse
|
| Responses.Auth.RequestEmailTfaResponse
|
||||||
| Responses.Auth.RequestTotpTfaResponse
|
| Responses.Auth.RequestTotpTfaResponse
|
||||||
| Responses.ErrorResponse
|
| Responses.ErrorResponse
|
||||||
> {
|
> {
|
||||||
return post_token<Requests.Auth.TfaSetup>(
|
return post_token<Requests.Auth.TfaSetup>(
|
||||||
"/api/auth/2fa/setup",
|
'/api/auth/2fa/setup',
|
||||||
{
|
{
|
||||||
mail,
|
mail
|
||||||
},
|
},
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const tfa_complete = (
|
export const tfa_complete = (
|
||||||
mail: boolean,
|
mail: boolean,
|
||||||
code: string,
|
code: string,
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.Auth.TfaCompletedResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.Auth.TfaCompletedResponse | Responses.ErrorResponse> =>
|
||||||
post_token<Requests.Auth.TfaComplete>(
|
post_token<Requests.Auth.TfaComplete>(
|
||||||
"/api/auth/2fa/complete",
|
'/api/auth/2fa/complete',
|
||||||
{
|
{
|
||||||
mail,
|
mail,
|
||||||
code,
|
code
|
||||||
},
|
},
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
|
|
||||||
export const tfa_disable = (
|
export const tfa_disable = (
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.Auth.RemoveTfaResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.Auth.RemoveTfaResponse | Responses.ErrorResponse> =>
|
||||||
post_token("/api/auth/2fa/disable", {}, token);
|
post_token('/api/auth/2fa/disable', {}, token);
|
||||||
|
@ -1,62 +1,62 @@
|
|||||||
import axios from "axios";
|
import axios from 'axios';
|
||||||
import { Requests, Responses, UserRole } from "../dto";
|
import { Requests, Responses, UserRole } from '../dto';
|
||||||
export { Requests, Responses, UserRole };
|
export { Requests, Responses, UserRole };
|
||||||
|
|
||||||
export const post = <T extends Requests.BaseRequest>(url: string, data: T) =>
|
export const post = <T extends Requests.BaseRequest>(url: string, data: T) =>
|
||||||
axios
|
axios
|
||||||
.post(url, data, {
|
.post(url, data, {
|
||||||
headers: { "Content-type": "application/json" },
|
headers: { 'Content-type': 'application/json' }
|
||||||
})
|
})
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((err) => err.response.data);
|
.catch((err) => err.response.data);
|
||||||
|
|
||||||
export const post_token = <T extends Requests.BaseRequest>(
|
export const post_token = <T extends Requests.BaseRequest>(
|
||||||
url: string,
|
url: string,
|
||||||
data: T,
|
data: T,
|
||||||
token: string
|
token: string
|
||||||
) =>
|
) =>
|
||||||
axios
|
axios
|
||||||
.post(url, data, {
|
.post(url, data, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + token,
|
Authorization: 'Bearer ' + token,
|
||||||
"Content-type": "application/json",
|
'Content-type': 'application/json'
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((err) => err.response.data);
|
.catch((err) => err.response.data);
|
||||||
|
|
||||||
export const post_token_form = (
|
export const post_token_form = (
|
||||||
url: string,
|
url: string,
|
||||||
data: FormData,
|
data: FormData,
|
||||||
token: string,
|
token: string,
|
||||||
onProgress: (progressEvent: ProgressEvent) => void
|
onProgress: (progressEvent: ProgressEvent) => void
|
||||||
) =>
|
) =>
|
||||||
axios
|
axios
|
||||||
.post(url, data, {
|
.post(url, data, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + token,
|
Authorization: 'Bearer ' + token,
|
||||||
"Content-type": "multipart/form-data",
|
'Content-type': 'multipart/form-data'
|
||||||
},
|
},
|
||||||
onUploadProgress: onProgress,
|
onUploadProgress: onProgress
|
||||||
})
|
})
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((err) => err.response.data);
|
.catch((err) => err.response.data);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
export const get = (url: string) =>
|
export const get = (url: string) =>
|
||||||
axios
|
axios
|
||||||
.get(url)
|
.get(url)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((err) => err.response.data);
|
.catch((err) => err.response.data);
|
||||||
|
|
||||||
export const get_token = (url: string, token: string) =>
|
export const get_token = (url: string, token: string) =>
|
||||||
axios
|
axios
|
||||||
.get(url, {
|
.get(url, {
|
||||||
headers: { Authorization: "Bearer " + token },
|
headers: { Authorization: 'Bearer ' + token }
|
||||||
})
|
})
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
.catch((err) => err.response.data);
|
.catch((err) => err.response.data);
|
||||||
|
|
||||||
export const isErrorResponse = (
|
export const isErrorResponse = (
|
||||||
res: Responses.BaseResponse
|
res: Responses.BaseResponse
|
||||||
): res is Responses.ErrorResponse => res.statusCode != 200;
|
): res is Responses.ErrorResponse => res.statusCode != 200;
|
||||||
|
@ -1,84 +1,89 @@
|
|||||||
import {
|
import {
|
||||||
Responses,
|
Responses,
|
||||||
Requests,
|
Requests,
|
||||||
get_token,
|
get_token,
|
||||||
post_token,
|
post_token,
|
||||||
post_token_form,
|
post_token_form,
|
||||||
isErrorResponse,
|
isErrorResponse
|
||||||
} from "./base";
|
} from './base';
|
||||||
|
|
||||||
export const get_root = (
|
export const get_root = (
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.FS.GetRootResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.FS.GetRootResponse | Responses.ErrorResponse> =>
|
||||||
get_token("/api/fs/root", token);
|
get_token('/api/fs/root', token);
|
||||||
|
|
||||||
export const get_node = (
|
export const get_node = (
|
||||||
token: string,
|
token: string,
|
||||||
node: number
|
node: number
|
||||||
): Promise<Responses.FS.GetNodeResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.FS.GetNodeResponse | Responses.ErrorResponse> =>
|
||||||
get_token(`/api/fs/node/${node}`, token);
|
get_token(`/api/fs/node/${node}`, token);
|
||||||
|
|
||||||
export const get_path = (
|
export const get_path = (
|
||||||
token: string,
|
token: string,
|
||||||
node: number
|
node: number
|
||||||
): Promise<Responses.FS.GetPathResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.FS.GetPathResponse | Responses.ErrorResponse> =>
|
||||||
get_token(`/api/fs/path/${node}`, token);
|
get_token(`/api/fs/path/${node}`, token);
|
||||||
|
|
||||||
export const create_folder = (
|
export const create_folder = (
|
||||||
token: string,
|
token: string,
|
||||||
parent: number,
|
parent: number,
|
||||||
name: string
|
name: string
|
||||||
): Promise<Responses.FS.CreateFolderResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.FS.CreateFolderResponse | Responses.ErrorResponse> =>
|
||||||
post_token<Requests.FS.CreateFolderRequest>(
|
post_token<Requests.FS.CreateFolderRequest>(
|
||||||
"/api/fs/createFolder",
|
'/api/fs/createFolder',
|
||||||
{
|
{
|
||||||
parent: parent,
|
parent: parent,
|
||||||
name: name,
|
name: name
|
||||||
},
|
},
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
|
|
||||||
export const create_file = (
|
export const create_file = (
|
||||||
token: string,
|
token: string,
|
||||||
parent: number,
|
parent: number,
|
||||||
name: string
|
name: string
|
||||||
): Promise<Responses.FS.CreateFileResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.FS.CreateFileResponse | Responses.ErrorResponse> =>
|
||||||
post_token<Requests.FS.CreateFileRequest>(
|
post_token<Requests.FS.CreateFileRequest>(
|
||||||
"/api/fs/createFile",
|
'/api/fs/createFile',
|
||||||
{
|
{
|
||||||
parent: parent,
|
parent: parent,
|
||||||
name: name,
|
name: name
|
||||||
},
|
},
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
|
|
||||||
export const delete_node = (
|
export const delete_node = (
|
||||||
token: string,
|
token: string,
|
||||||
node: number
|
node: number
|
||||||
): Promise<Responses.FS.DeleteResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.FS.DeleteResponse | Responses.ErrorResponse> =>
|
||||||
post_token(`/api/fs/delete/${node}`, {}, token);
|
post_token(`/api/fs/delete/${node}`, {}, token);
|
||||||
|
|
||||||
export const upload_file = async (
|
export const upload_file = async (
|
||||||
token: string,
|
token: string,
|
||||||
parent: number,
|
parent: number,
|
||||||
file: File,
|
file: File,
|
||||||
onProgress: (progressEvent: ProgressEvent) => void
|
onProgress: (progressEvent: ProgressEvent) => void
|
||||||
): Promise<Responses.FS.UploadFileResponse | Responses.ErrorResponse> => {
|
): Promise<Responses.FS.UploadFileResponse | Responses.ErrorResponse> => {
|
||||||
const node = await create_file(token, parent, file.name);
|
const node = await create_file(token, parent, file.name);
|
||||||
if (isErrorResponse(node)) return node;
|
if (isErrorResponse(node)) return node;
|
||||||
|
|
||||||
const form = new FormData();
|
const form = new FormData();
|
||||||
form.set("file", file);
|
form.set('file', file);
|
||||||
return post_token_form(`/api/fs/upload/${node.id}`, form, token, onProgress);
|
return post_token_form(
|
||||||
|
`/api/fs/upload/${node.id}`,
|
||||||
|
form,
|
||||||
|
token,
|
||||||
|
onProgress
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export function download_file(token: string, id: number) {
|
export function download_file(token: string, id: number) {
|
||||||
const form = document.createElement("form");
|
const form = document.createElement('form');
|
||||||
form.method = "post";
|
form.method = 'post';
|
||||||
form.target = "_blank";
|
form.target = '_blank';
|
||||||
form.action = "/api/fs/download";
|
form.action = '/api/fs/download';
|
||||||
form.innerHTML = `<input type="hidden" name="jwtToken" value="${token}"><input type="hidden" name="id" value="${id}">`;
|
form.innerHTML = `<input type="hidden" name="jwtToken" value="${token}"><input type="hidden" name="id" value="${id}">`;
|
||||||
document.body.appendChild(form);
|
document.body.appendChild(form);
|
||||||
form.submit();
|
form.submit();
|
||||||
document.body.removeChild(form);
|
document.body.removeChild(form);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
export { Requests, Responses, UserRole, isErrorResponse } from "./base";
|
export { Requests, Responses, UserRole, isErrorResponse } from './base';
|
||||||
export * as Auth from "./auth";
|
export * as Auth from './auth';
|
||||||
export * as FS from "./fs";
|
export * as FS from './fs';
|
||||||
export * as User from "./user";
|
export * as User from './user';
|
||||||
export * as Admin from "./admin";
|
export * as Admin from './admin';
|
||||||
export * from "./util";
|
export * from './util';
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { Responses, get_token, post_token } from "@/api/base";
|
import { Responses, get_token, post_token } from '@/api/base';
|
||||||
|
|
||||||
export const get_user_info = (
|
export const get_user_info = (
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.User.UserInfoResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.User.UserInfoResponse | Responses.ErrorResponse> =>
|
||||||
get_token("/api/user/info", token);
|
get_token('/api/user/info', token);
|
||||||
|
|
||||||
export const delete_user = (
|
export const delete_user = (
|
||||||
token: string
|
token: string
|
||||||
): Promise<Responses.User.DeleteUserResponse | Responses.ErrorResponse> =>
|
): Promise<Responses.User.DeleteUserResponse | Responses.ErrorResponse> =>
|
||||||
post_token("/api/user/delete", {}, token);
|
post_token('/api/user/delete', {}, token);
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
import jwtDecode, { JwtPayload } from "jwt-decode";
|
import jwtDecode, { JwtPayload } from 'jwt-decode';
|
||||||
import { Ref, UnwrapRef } from "vue";
|
import { Ref, UnwrapRef } from 'vue';
|
||||||
import { isErrorResponse } from "./base";
|
import { isErrorResponse } from './base';
|
||||||
import { refresh_token } from "./auth";
|
import { refresh_token } from './auth';
|
||||||
|
|
||||||
export async function check_token(
|
export async function check_token(
|
||||||
token: TokenInjectType
|
token: TokenInjectType
|
||||||
): Promise<string | void> {
|
): Promise<string | void> {
|
||||||
if (!token.jwt.value) return token.logout();
|
if (!token.jwt.value) return token.logout();
|
||||||
const payload = jwtDecode<JwtPayload>(token.jwt.value);
|
const payload = jwtDecode<JwtPayload>(token.jwt.value);
|
||||||
if (!payload) return token.logout();
|
if (!payload) return token.logout();
|
||||||
// Expires in more than 60 Minute
|
// Expires in more than 60 Minute
|
||||||
if (payload.exp && payload.exp > Math.floor(Date.now() / 1000 + 60 * 60))
|
if (payload.exp && payload.exp > Math.floor(Date.now() / 1000 + 60 * 60))
|
||||||
return token.jwt.value;
|
return token.jwt.value;
|
||||||
const new_token = await refresh_token(token.jwt.value);
|
const new_token = await refresh_token(token.jwt.value);
|
||||||
if (isErrorResponse(new_token)) return token.logout();
|
if (isErrorResponse(new_token)) return token.logout();
|
||||||
token.setToken(new_token.jwt);
|
token.setToken(new_token.jwt);
|
||||||
return new_token.jwt;
|
return new_token.jwt;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TokenInjectType = {
|
export type TokenInjectType = {
|
||||||
jwt: Ref<UnwrapRef<string | null>>;
|
jwt: Ref<UnwrapRef<string | null>>;
|
||||||
setToken: (token: string) => void;
|
setToken: (token: string) => void;
|
||||||
logout: () => void;
|
logout: () => void;
|
||||||
};
|
};
|
||||||
|
@ -1,40 +1,40 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineEmits, defineProps, inject } from "vue";
|
import { defineEmits, defineProps, inject } from 'vue';
|
||||||
import { check_token, FS, Responses, TokenInjectType } from "@/api";
|
import { check_token, FS, Responses, TokenInjectType } from '@/api';
|
||||||
|
|
||||||
const jwt = inject<TokenInjectType>("jwt") as TokenInjectType;
|
const jwt = inject<TokenInjectType>('jwt') as TokenInjectType;
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
node: Responses.FS.GetNodeResponse;
|
node: Responses.FS.GetNodeResponse;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: "reloadNode"): void;
|
(e: 'reloadNode'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
async function del() {
|
async function del() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
await FS.delete_node(token, props.node.id);
|
await FS.delete_node(token, props.node.id);
|
||||||
emit("reloadNode");
|
emit('reloadNode');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function download() {
|
async function download() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
FS.download_file(token, props.node.id);
|
FS.download_file(token, props.node.id);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<td>
|
<td>
|
||||||
<router-link :to="'/fs/' + props.node.id">{{ node.name }}</router-link>
|
<router-link :to="'/fs/' + props.node.id">{{ node.name }}</router-link>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="#" @click="download()" v-if="props.node.isFile">Download</a>
|
<a href="#" @click="download()" v-if="props.node.isFile">Download</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="#" @click="del()" v-if="props.node.name !== '..'">delete</a>
|
<a href="#" @click="del()" v-if="props.node.name !== '..'">delete</a>
|
||||||
</td>
|
</td>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,101 +1,108 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineEmits, defineProps, inject, reactive, ref, watch } from "vue";
|
import { defineEmits, defineProps, inject, reactive, ref, watch } from 'vue';
|
||||||
import { FS, Responses, check_token, TokenInjectType } from "@/api";
|
import { FS, Responses, check_token, TokenInjectType } from '@/api';
|
||||||
import DirEntry from "@/components/FSView/DirEntry.vue";
|
import DirEntry from '@/components/FSView/DirEntry.vue';
|
||||||
import UploadFileDialog from "@/components/UploadDialog/UploadFileDialog.vue";
|
import UploadFileDialog from '@/components/UploadDialog/UploadFileDialog.vue';
|
||||||
import { NModal } from "naive-ui";
|
import { NModal } from 'naive-ui';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
node: Responses.FS.GetNodeResponse;
|
node: Responses.FS.GetNodeResponse;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const jwt = inject<TokenInjectType>("jwt") as TokenInjectType;
|
const jwt = inject<TokenInjectType>('jwt') as TokenInjectType;
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: "reloadNode"): void;
|
(e: 'reloadNode'): void;
|
||||||
(e: "gotoRoot"): void;
|
(e: 'gotoRoot'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const fileInput = ref<HTMLInputElement>();
|
const fileInput = ref<HTMLInputElement>();
|
||||||
const uploadDialog = ref();
|
const uploadDialog = ref();
|
||||||
const uploadDialogShow = ref(false);
|
const uploadDialogShow = ref(false);
|
||||||
|
|
||||||
const new_folder_name = ref("");
|
const new_folder_name = ref('');
|
||||||
const files = ref<File[]>([]);
|
const files = ref<File[]>([]);
|
||||||
const nodes = ref<Responses.FS.GetNodeResponse[]>([]);
|
const nodes = ref<Responses.FS.GetNodeResponse[]>([]);
|
||||||
const hasParent = ref(false);
|
const hasParent = ref(false);
|
||||||
const parentNode = reactive<Responses.FS.GetNodeResponse>({
|
const parentNode = reactive<Responses.FS.GetNodeResponse>({
|
||||||
id: 0,
|
id: 0,
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
isFile: false,
|
isFile: false,
|
||||||
parent: null,
|
parent: null,
|
||||||
name: "..",
|
name: '..'
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.node,
|
() => props.node,
|
||||||
async (to) => {
|
async (to) => {
|
||||||
parentNode.id = to.parent ?? 0;
|
parentNode.id = to.parent ?? 0;
|
||||||
hasParent.value = to.parent != null;
|
hasParent.value = to.parent != null;
|
||||||
nodes.value = [];
|
nodes.value = [];
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
to.children?.map(async (child) => {
|
to.children?.map(async (child) => {
|
||||||
nodes.value.push(
|
nodes.value.push(
|
||||||
(await FS.get_node(token, child)) as Responses.FS.GetNodeResponse
|
(await FS.get_node(
|
||||||
);
|
token,
|
||||||
}) ?? []
|
child
|
||||||
);
|
)) as Responses.FS.GetNodeResponse
|
||||||
},
|
);
|
||||||
{ immediate: true }
|
}) ?? []
|
||||||
|
);
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
async function newFolder() {
|
async function newFolder() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
await FS.create_folder(token, props.node.id, new_folder_name.value);
|
await FS.create_folder(token, props.node.id, new_folder_name.value);
|
||||||
emit("reloadNode");
|
emit('reloadNode');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function uploadFiles() {
|
async function uploadFiles() {
|
||||||
files.value = Array.from(fileInput.value?.files ?? []);
|
files.value = Array.from(fileInput.value?.files ?? []);
|
||||||
if (files.value.length == 0) return;
|
if (files.value.length == 0) return;
|
||||||
uploadDialogShow.value = true;
|
uploadDialogShow.value = true;
|
||||||
}
|
}
|
||||||
async function uploadFilesDialogOpen() {
|
async function uploadFilesDialogOpen() {
|
||||||
await uploadDialog.value?.startUpload(props.node.id);
|
await uploadDialog.value?.startUpload(props.node.id);
|
||||||
uploadDialogShow.value = false;
|
uploadDialogShow.value = false;
|
||||||
if (fileInput.value) fileInput.value.value = "";
|
if (fileInput.value) fileInput.value.value = '';
|
||||||
emit("reloadNode");
|
emit('reloadNode');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<input type="text" placeholder="Folder name" v-model="new_folder_name" />
|
<input
|
||||||
<a href="#" @click="newFolder()">create folder</a>
|
type="text"
|
||||||
</div>
|
placeholder="Folder name"
|
||||||
<div>
|
v-model="new_folder_name"
|
||||||
<input type="file" ref="fileInput" multiple />
|
/>
|
||||||
<a href="#" @click="uploadFiles()">upload files</a>
|
<a href="#" @click="newFolder()">create folder</a>
|
||||||
</div>
|
</div>
|
||||||
<table>
|
<div>
|
||||||
<tr v-if="hasParent">
|
<input type="file" ref="fileInput" multiple />
|
||||||
<DirEntry :node="parentNode" @reloadNode="emit('reloadNode')" />
|
<a href="#" @click="uploadFiles()">upload files</a>
|
||||||
</tr>
|
</div>
|
||||||
<tr v-for="n in nodes" :key="n.id">
|
<table>
|
||||||
<DirEntry :node="n" @reloadNode="emit('reloadNode')" />
|
<tr v-if="hasParent">
|
||||||
</tr>
|
<DirEntry :node="parentNode" @reloadNode="emit('reloadNode')" />
|
||||||
</table>
|
</tr>
|
||||||
<n-modal
|
<tr v-for="n in nodes" :key="n.id">
|
||||||
v-model:show="uploadDialogShow"
|
<DirEntry :node="n" @reloadNode="emit('reloadNode')" />
|
||||||
:close-on-esc="false"
|
</tr>
|
||||||
:mask-closable="false"
|
</table>
|
||||||
:on-after-enter="uploadFilesDialogOpen"
|
<n-modal
|
||||||
>
|
v-model:show="uploadDialogShow"
|
||||||
<UploadFileDialog ref="uploadDialog" :files="files" />
|
:close-on-esc="false"
|
||||||
</n-modal>
|
:mask-closable="false"
|
||||||
|
:on-after-enter="uploadFilesDialogOpen"
|
||||||
|
>
|
||||||
|
<UploadFileDialog ref="uploadDialog" :files="files" />
|
||||||
|
</n-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,38 +1,38 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineProps, inject } from "vue";
|
import { defineProps, inject } from 'vue';
|
||||||
import { check_token, FS, Responses, TokenInjectType } from "@/api";
|
import { check_token, FS, Responses, TokenInjectType } from '@/api';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
node: Responses.FS.GetNodeResponse;
|
node: Responses.FS.GetNodeResponse;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const jwt = inject<TokenInjectType>("jwt") as TokenInjectType;
|
const jwt = inject<TokenInjectType>('jwt') as TokenInjectType;
|
||||||
|
|
||||||
async function del() {
|
async function del() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
await FS.delete_node(token, props.node.id);
|
await FS.delete_node(token, props.node.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function download() {
|
async function download() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
FS.download_file(token, props.node.id);
|
FS.download_file(token, props.node.id);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<router-link :to="'/fs/' + props.node.parent ?? 0">..</router-link>
|
<router-link :to="'/fs/' + props.node.parent ?? 0">..</router-link>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a href="#" @click="download()" v-if="props.node.isFile">Download</a>
|
<a href="#" @click="download()" v-if="props.node.isFile">Download</a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<router-link :to="'/fs/' + props.node.parent ?? 0" @click="del()">
|
<router-link :to="'/fs/' + props.node.parent ?? 0" @click="del()">
|
||||||
delete
|
delete
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,140 +1,156 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="hello">
|
<div class="hello">
|
||||||
<h1>{{ msg }}</h1>
|
<h1>{{ msg }}</h1>
|
||||||
<p>
|
<p>
|
||||||
For a guide and recipes on how to configure / customize this project,<br />
|
For a guide and recipes on how to configure / customize this
|
||||||
check out the
|
project,<br />
|
||||||
<a href="https://cli.vuejs.org" target="_blank" rel="noopener"
|
check out the
|
||||||
>vue-cli documentation</a
|
<a href="https://cli.vuejs.org" target="_blank" rel="noopener"
|
||||||
>.
|
>vue-cli documentation</a
|
||||||
</p>
|
>.
|
||||||
<h3>Installed CLI Plugins</h3>
|
</p>
|
||||||
<ul>
|
<h3>Installed CLI Plugins</h3>
|
||||||
<li>
|
<ul>
|
||||||
<a
|
<li>
|
||||||
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
|
<a
|
||||||
target="_blank"
|
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
|
||||||
rel="noopener"
|
target="_blank"
|
||||||
>babel</a
|
rel="noopener"
|
||||||
>
|
>babel</a
|
||||||
</li>
|
>
|
||||||
<li>
|
</li>
|
||||||
<a
|
<li>
|
||||||
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router"
|
<a
|
||||||
target="_blank"
|
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router"
|
||||||
rel="noopener"
|
target="_blank"
|
||||||
>router</a
|
rel="noopener"
|
||||||
>
|
>router</a
|
||||||
</li>
|
>
|
||||||
<li>
|
</li>
|
||||||
<a
|
<li>
|
||||||
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex"
|
<a
|
||||||
target="_blank"
|
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex"
|
||||||
rel="noopener"
|
target="_blank"
|
||||||
>vuex</a
|
rel="noopener"
|
||||||
>
|
>vuex</a
|
||||||
</li>
|
>
|
||||||
<li>
|
</li>
|
||||||
<a
|
<li>
|
||||||
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
|
<a
|
||||||
target="_blank"
|
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
|
||||||
rel="noopener"
|
target="_blank"
|
||||||
>eslint</a
|
rel="noopener"
|
||||||
>
|
>eslint</a
|
||||||
</li>
|
>
|
||||||
<li>
|
</li>
|
||||||
<a
|
<li>
|
||||||
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-typescript"
|
<a
|
||||||
target="_blank"
|
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-typescript"
|
||||||
rel="noopener"
|
target="_blank"
|
||||||
>typescript</a
|
rel="noopener"
|
||||||
>
|
>typescript</a
|
||||||
</li>
|
>
|
||||||
</ul>
|
</li>
|
||||||
<h3>Essential Links</h3>
|
</ul>
|
||||||
<ul>
|
<h3>Essential Links</h3>
|
||||||
<li>
|
<ul>
|
||||||
<a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a>
|
<li>
|
||||||
</li>
|
<a href="https://vuejs.org" target="_blank" rel="noopener"
|
||||||
<li>
|
>Core Docs</a
|
||||||
<a href="https://forum.vuejs.org" target="_blank" rel="noopener"
|
>
|
||||||
>Forum</a
|
</li>
|
||||||
>
|
<li>
|
||||||
</li>
|
<a href="https://forum.vuejs.org" target="_blank" rel="noopener"
|
||||||
<li>
|
>Forum</a
|
||||||
<a href="https://chat.vuejs.org" target="_blank" rel="noopener"
|
>
|
||||||
>Community Chat</a
|
</li>
|
||||||
>
|
<li>
|
||||||
</li>
|
<a href="https://chat.vuejs.org" target="_blank" rel="noopener"
|
||||||
<li>
|
>Community Chat</a
|
||||||
<a href="https://twitter.com/vuejs" target="_blank" rel="noopener"
|
>
|
||||||
>Twitter</a
|
</li>
|
||||||
>
|
<li>
|
||||||
</li>
|
<a
|
||||||
<li>
|
href="https://twitter.com/vuejs"
|
||||||
<a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a>
|
target="_blank"
|
||||||
</li>
|
rel="noopener"
|
||||||
</ul>
|
>Twitter</a
|
||||||
<h3>Ecosystem</h3>
|
>
|
||||||
<ul>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://router.vuejs.org" target="_blank" rel="noopener"
|
<a href="https://news.vuejs.org" target="_blank" rel="noopener"
|
||||||
>vue-router</a
|
>News</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
</ul>
|
||||||
<a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a>
|
<h3>Ecosystem</h3>
|
||||||
</li>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
href="https://github.com/vuejs/vue-devtools#vue-devtools"
|
href="https://router.vuejs.org"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
>vue-devtools</a
|
>vue-router</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener"
|
<a href="https://vuex.vuejs.org" target="_blank" rel="noopener"
|
||||||
>vue-loader</a
|
>vuex</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
href="https://github.com/vuejs/awesome-vue"
|
href="https://github.com/vuejs/vue-devtools#vue-devtools"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
>awesome-vue</a
|
>vue-devtools</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
<li>
|
||||||
</div>
|
<a
|
||||||
|
href="https://vue-loader.vuejs.org"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
>vue-loader</a
|
||||||
|
>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://github.com/vuejs/awesome-vue"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
>awesome-vue</a
|
||||||
|
>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from "vue";
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "HelloWorld",
|
name: 'HelloWorld',
|
||||||
props: {
|
props: {
|
||||||
msg: String,
|
msg: String
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
h3 {
|
h3 {
|
||||||
margin: 40px 0 0;
|
margin: 40px 0 0;
|
||||||
}
|
}
|
||||||
ul {
|
ul {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
li {
|
li {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
color: #42b983;
|
color: #42b983;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,51 +1,51 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineProps, defineExpose, ref } from "vue";
|
import { defineProps, defineExpose, ref } from 'vue';
|
||||||
import { isErrorResponse, FS } from "@/api";
|
import { isErrorResponse, FS } from '@/api';
|
||||||
import { NProgress } from "naive-ui";
|
import { NProgress } from 'naive-ui';
|
||||||
import filesize from "filesize";
|
import filesize from 'filesize';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
file: File;
|
file: File;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const progress = ref(0);
|
const progress = ref(0);
|
||||||
const percentage = ref(0);
|
const percentage = ref(0);
|
||||||
const err = ref("");
|
const err = ref('');
|
||||||
const status = ref("info");
|
const status = ref('info');
|
||||||
|
|
||||||
async function startUpload(parent: number, token: string) {
|
async function startUpload(parent: number, token: string) {
|
||||||
const resp = await FS.upload_file(token, parent, props.file, (e) => {
|
const resp = await FS.upload_file(token, parent, props.file, (e) => {
|
||||||
progress.value = e.loaded;
|
progress.value = e.loaded;
|
||||||
percentage.value = (e.loaded / e.total) * 100;
|
percentage.value = (e.loaded / e.total) * 100;
|
||||||
});
|
});
|
||||||
percentage.value = 100;
|
percentage.value = 100;
|
||||||
if (isErrorResponse(resp)) {
|
if (isErrorResponse(resp)) {
|
||||||
err.value = resp.message ?? "Error";
|
err.value = resp.message ?? 'Error';
|
||||||
status.value = "error";
|
status.value = 'error';
|
||||||
} else status.value = "success";
|
} else status.value = 'success';
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
startUpload,
|
startUpload
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="percentage < 100">
|
<div v-if="percentage < 100">
|
||||||
{{ file.name }} - {{ filesize(progress) }} / {{ filesize(file.size) }} -
|
{{ file.name }} - {{ filesize(progress) }} / {{ filesize(file.size) }} -
|
||||||
{{ Math.floor(percentage * 1000) / 1000 }}%
|
{{ Math.floor(percentage * 1000) / 1000 }}%
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="err !== ''">{{ file.name }} - Error: {{ err }}</div>
|
<div v-else-if="err !== ''">{{ file.name }} - Error: {{ err }}</div>
|
||||||
<div v-else>{{ file.name }} - Completed</div>
|
<div v-else>{{ file.name }} - Completed</div>
|
||||||
<n-progress
|
<n-progress
|
||||||
type="line"
|
type="line"
|
||||||
:percentage="percentage"
|
:percentage="percentage"
|
||||||
:height="20"
|
:height="20"
|
||||||
:status="status"
|
:status="status"
|
||||||
border-radius="10px 0"
|
border-radius="10px 0"
|
||||||
fill-border-radius="10px 0"
|
fill-border-radius="10px 0"
|
||||||
:show-indicator="false"
|
:show-indicator="false"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineProps, defineExpose, ref, inject } from "vue";
|
import { defineProps, defineExpose, ref, inject } from 'vue';
|
||||||
import { check_token, TokenInjectType } from "@/api";
|
import { check_token, TokenInjectType } from '@/api';
|
||||||
import UploadEntry from "@/components/UploadDialog/UploadEntry.vue";
|
import UploadEntry from '@/components/UploadDialog/UploadEntry.vue';
|
||||||
import { NCard } from "naive-ui";
|
import { NCard } from 'naive-ui';
|
||||||
|
|
||||||
const jwt = inject<TokenInjectType>("jwt") as TokenInjectType;
|
const jwt = inject<TokenInjectType>('jwt') as TokenInjectType;
|
||||||
|
|
||||||
const entries = ref<typeof UploadEntry[]>([]);
|
const entries = ref<typeof UploadEntry[]>([]);
|
||||||
const done = ref(false);
|
const done = ref(false);
|
||||||
@ -12,32 +12,37 @@ let canCloseResolve = null;
|
|||||||
const canClose = new Promise((r) => (canCloseResolve = r));
|
const canClose = new Promise((r) => (canCloseResolve = r));
|
||||||
|
|
||||||
async function startUpload(parent: number) {
|
async function startUpload(parent: number) {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
entries.value.map((entry) => entry.startUpload(parent, token))
|
entries.value.map((entry) => entry.startUpload(parent, token))
|
||||||
);
|
);
|
||||||
done.value = true;
|
done.value = true;
|
||||||
await canClose;
|
await canClose;
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
startUpload,
|
startUpload
|
||||||
});
|
});
|
||||||
defineProps<{
|
defineProps<{
|
||||||
files: File[];
|
files: File[];
|
||||||
}>();
|
}>();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<n-card title="Upload Files">
|
<n-card title="Upload Files">
|
||||||
<div>
|
<div>
|
||||||
<UploadEntry v-for="f in files" :key="f.name" ref="entries" :file="f" />
|
<UploadEntry
|
||||||
</div>
|
v-for="f in files"
|
||||||
<div>
|
:key="f.name"
|
||||||
<button v-if="done" @click="canCloseResolve()">Close</button>
|
ref="entries"
|
||||||
</div>
|
:file="f"
|
||||||
</n-card>
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button v-if="done" @click="canCloseResolve()">Close</button>
|
||||||
|
</div>
|
||||||
|
</n-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
export * as Requests from "./requests";
|
export * as Requests from './requests';
|
||||||
export * as Responses from "./responses";
|
export * as Responses from './responses';
|
||||||
export {
|
export {
|
||||||
UserRole,
|
UserRole,
|
||||||
validateSync,
|
validateSync,
|
||||||
validateAsync,
|
validateAsync,
|
||||||
validateAsyncInline,
|
validateAsyncInline
|
||||||
} from "./utils";
|
} from './utils';
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import { BaseRequest } from "./base";
|
import { BaseRequest } from './base';
|
||||||
import { IsEnum, IsNumber } from "class-validator";
|
import { IsEnum, IsNumber } from 'class-validator';
|
||||||
import { UserRole } from "../utils";
|
import { UserRole } from '@/dto';
|
||||||
|
|
||||||
export class AdminRequest extends BaseRequest {
|
export class AdminRequest extends BaseRequest {
|
||||||
@IsNumber()
|
@IsNumber()
|
||||||
user: number;
|
user: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SetUserRole extends AdminRequest {
|
export class SetUserRole extends AdminRequest {
|
||||||
@IsEnum(UserRole)
|
@IsEnum(UserRole)
|
||||||
role: UserRole;
|
role: UserRole;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class LogoutAll extends AdminRequest {}
|
export class LogoutAll extends AdminRequest {}
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
import { BaseRequest } from "./base";
|
import { BaseRequest } from './base';
|
||||||
import {
|
import {
|
||||||
IsBoolean,
|
IsBoolean,
|
||||||
IsEmail,
|
IsEmail,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
IsOptional,
|
IsOptional,
|
||||||
IsString,
|
IsString
|
||||||
} from "class-validator";
|
} from 'class-validator';
|
||||||
|
|
||||||
export class SignUpRequest extends BaseRequest {
|
export class SignUpRequest extends BaseRequest {
|
||||||
@IsEmail()
|
@IsEmail()
|
||||||
username: string;
|
username: string;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsString()
|
@IsString()
|
||||||
password: string;
|
password: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class LoginRequest extends SignUpRequest {
|
export class LoginRequest extends SignUpRequest {
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsString()
|
@IsString()
|
||||||
otp?: string;
|
otp?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TfaSetup extends BaseRequest {
|
export class TfaSetup extends BaseRequest {
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
mail: boolean;
|
mail: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TfaComplete extends BaseRequest {
|
export class TfaComplete extends BaseRequest {
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
mail: boolean;
|
mail: boolean;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsString()
|
@IsString()
|
||||||
code: string;
|
code: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ChangePasswordRequest extends BaseRequest {
|
export class ChangePasswordRequest extends BaseRequest {
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsString()
|
@IsString()
|
||||||
oldPassword: string;
|
oldPassword: string;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsString()
|
@IsString()
|
||||||
newPassword: string;
|
newPassword: string;
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import { BaseRequest } from "./base";
|
import { BaseRequest } from './base';
|
||||||
import { IsInt, IsNotEmpty, IsString, Min } from "class-validator";
|
import { IsInt, IsNotEmpty, IsString, Min } from 'class-validator';
|
||||||
|
|
||||||
export class CreateFolderRequest extends BaseRequest {
|
export class CreateFolderRequest extends BaseRequest {
|
||||||
@IsInt()
|
@IsInt()
|
||||||
@Min(1)
|
@Min(1)
|
||||||
parent: number;
|
parent: number;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsString()
|
@IsString()
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateFileRequest extends CreateFolderRequest {}
|
export class CreateFileRequest extends CreateFolderRequest {}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export * from "./base";
|
export * from './base';
|
||||||
export * as Auth from "./auth";
|
export * as Auth from './auth';
|
||||||
export * as FS from "./fs";
|
export * as FS from './fs';
|
||||||
export * as Admin from "./admin";
|
export * as Admin from './admin';
|
||||||
|
@ -1,58 +1,58 @@
|
|||||||
import { SuccessResponse } from "./base";
|
import { SuccessResponse } from './base';
|
||||||
import {
|
import {
|
||||||
IsArray,
|
IsArray,
|
||||||
IsBoolean,
|
IsBoolean,
|
||||||
IsEnum,
|
IsEnum,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
IsNumber,
|
IsNumber,
|
||||||
IsString,
|
IsString,
|
||||||
ValidateNested,
|
ValidateNested
|
||||||
} from "class-validator";
|
} from 'class-validator';
|
||||||
import { UserRole, ValidateConstructor } from "../utils";
|
import { UserRole, ValidateConstructor } from '../utils';
|
||||||
|
|
||||||
@ValidateConstructor
|
@ValidateConstructor
|
||||||
export class GetUsersEntry {
|
export class GetUsersEntry {
|
||||||
constructor(
|
constructor(
|
||||||
id: number,
|
id: number,
|
||||||
gitlab: boolean,
|
gitlab: boolean,
|
||||||
name: string,
|
name: string,
|
||||||
role: UserRole,
|
role: UserRole,
|
||||||
tfaEnabled: boolean
|
tfaEnabled: boolean
|
||||||
) {
|
) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.gitlab = gitlab;
|
this.gitlab = gitlab;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.role = role;
|
this.role = role;
|
||||||
this.tfaEnabled = tfaEnabled;
|
this.tfaEnabled = tfaEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@IsNumber()
|
@IsNumber()
|
||||||
id: number;
|
id: number;
|
||||||
|
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
gitlab: boolean;
|
gitlab: boolean;
|
||||||
|
|
||||||
@IsString()
|
@IsString()
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@IsEnum(UserRole)
|
@IsEnum(UserRole)
|
||||||
role: UserRole;
|
role: UserRole;
|
||||||
|
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
tfaEnabled: boolean;
|
tfaEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ValidateConstructor
|
@ValidateConstructor
|
||||||
export class GetUsers extends SuccessResponse {
|
export class GetUsers extends SuccessResponse {
|
||||||
constructor(users: GetUsersEntry[]) {
|
constructor(users: GetUsersEntry[]) {
|
||||||
super();
|
super();
|
||||||
this.users = users;
|
this.users = users;
|
||||||
}
|
}
|
||||||
|
|
||||||
@IsArray()
|
@IsArray()
|
||||||
@ValidateNested({ each: true })
|
@ValidateNested({ each: true })
|
||||||
users: GetUsersEntry[];
|
users: GetUsersEntry[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export class LogoutAllUser extends SuccessResponse {}
|
export class LogoutAllUser extends SuccessResponse {}
|
||||||
|
@ -1,33 +1,33 @@
|
|||||||
import { SuccessResponse } from "./base";
|
import { SuccessResponse } from './base';
|
||||||
import { IsBase32, IsJWT, IsNotEmpty } from "class-validator";
|
import { IsBase32, IsJWT, IsNotEmpty } from 'class-validator';
|
||||||
import { ValidateConstructor } from "../utils";
|
import { ValidateConstructor } from '../utils';
|
||||||
|
|
||||||
@ValidateConstructor
|
@ValidateConstructor
|
||||||
export class LoginResponse extends SuccessResponse {
|
export class LoginResponse extends SuccessResponse {
|
||||||
constructor(jwt: string) {
|
constructor(jwt: string) {
|
||||||
super();
|
super();
|
||||||
this.jwt = jwt;
|
this.jwt = jwt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsJWT()
|
@IsJWT()
|
||||||
jwt: string;
|
jwt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ValidateConstructor
|
@ValidateConstructor
|
||||||
export class RequestTotpTfaResponse extends SuccessResponse {
|
export class RequestTotpTfaResponse extends SuccessResponse {
|
||||||
constructor(qrCode: string, secret: string) {
|
constructor(qrCode: string, secret: string) {
|
||||||
super();
|
super();
|
||||||
this.qrCode = qrCode;
|
this.qrCode = qrCode;
|
||||||
this.secret = secret;
|
this.secret = secret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
qrCode: string;
|
qrCode: string;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsBase32()
|
@IsBase32()
|
||||||
secret: string;
|
secret: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TfaRequiredResponse extends SuccessResponse {}
|
export class TfaRequiredResponse extends SuccessResponse {}
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
import { IsNumber, Max, Min } from "class-validator";
|
import { IsNumber, Max, Min } from 'class-validator';
|
||||||
|
|
||||||
export class BaseResponse {
|
export class BaseResponse {
|
||||||
constructor(statusCode: number) {
|
constructor(statusCode: number) {
|
||||||
this.statusCode = statusCode;
|
this.statusCode = statusCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@IsNumber()
|
@IsNumber()
|
||||||
@Min(100)
|
@Min(100)
|
||||||
@Max(599)
|
@Max(599)
|
||||||
statusCode: number;
|
statusCode: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SuccessResponse extends BaseResponse {
|
export class SuccessResponse extends BaseResponse {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(200);
|
super(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
declare statusCode: 200;
|
declare statusCode: 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ErrorResponse extends BaseResponse {
|
export class ErrorResponse extends BaseResponse {
|
||||||
declare statusCode: 400 | 401 | 403;
|
declare statusCode: 400 | 401 | 403;
|
||||||
message?: string;
|
message?: string;
|
||||||
}
|
}
|
||||||
|
@ -1,87 +1,87 @@
|
|||||||
import { SuccessResponse } from "./base";
|
import { SuccessResponse } from './base';
|
||||||
import {
|
import {
|
||||||
IsBoolean,
|
IsBoolean,
|
||||||
IsInt,
|
IsInt,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
IsOptional,
|
IsOptional,
|
||||||
IsString,
|
IsString,
|
||||||
Min,
|
Min
|
||||||
} from "class-validator";
|
} from 'class-validator';
|
||||||
import { ValidateConstructor } from "../utils";
|
import { ValidateConstructor } from '../utils';
|
||||||
|
|
||||||
@ValidateConstructor
|
@ValidateConstructor
|
||||||
export class GetRootResponse extends SuccessResponse {
|
export class GetRootResponse extends SuccessResponse {
|
||||||
constructor(rootId: number) {
|
constructor(rootId: number) {
|
||||||
super();
|
super();
|
||||||
this.rootId = rootId;
|
this.rootId = rootId;
|
||||||
}
|
}
|
||||||
@IsInt()
|
@IsInt()
|
||||||
@Min(1)
|
@Min(1)
|
||||||
rootId: number;
|
rootId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class GetNodeResponse extends SuccessResponse {
|
export class GetNodeResponse extends SuccessResponse {
|
||||||
constructor(
|
constructor(
|
||||||
id: number,
|
id: number,
|
||||||
name: string,
|
name: string,
|
||||||
isFile: boolean,
|
isFile: boolean,
|
||||||
parent: number | null
|
parent: number | null
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.isFile = isFile;
|
this.isFile = isFile;
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@IsInt()
|
@IsInt()
|
||||||
@Min(1)
|
@Min(1)
|
||||||
id: number;
|
id: number;
|
||||||
|
|
||||||
@IsString()
|
@IsString()
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
isFile: boolean;
|
isFile: boolean;
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsInt()
|
@IsInt()
|
||||||
@Min(1)
|
@Min(1)
|
||||||
parent: number | null;
|
parent: number | null;
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsInt({ each: true })
|
@IsInt({ each: true })
|
||||||
@Min(1, { each: true })
|
@Min(1, { each: true })
|
||||||
children?: number[];
|
children?: number[];
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsInt()
|
@IsInt()
|
||||||
@Min(0)
|
@Min(0)
|
||||||
size?: number;
|
size?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ValidateConstructor
|
@ValidateConstructor
|
||||||
export class GetPathResponse extends SuccessResponse {
|
export class GetPathResponse extends SuccessResponse {
|
||||||
constructor(path: string) {
|
constructor(path: string) {
|
||||||
super();
|
super();
|
||||||
this.path = path;
|
this.path = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsString()
|
@IsString()
|
||||||
path: string;
|
path: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ValidateConstructor
|
@ValidateConstructor
|
||||||
export class CreateFolderResponse extends SuccessResponse {
|
export class CreateFolderResponse extends SuccessResponse {
|
||||||
constructor(id: number) {
|
constructor(id: number) {
|
||||||
super();
|
super();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@IsInt()
|
@IsInt()
|
||||||
@Min(1)
|
@Min(1)
|
||||||
id: number;
|
id: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UploadFileResponse extends SuccessResponse {}
|
export class UploadFileResponse extends SuccessResponse {}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export * from "./base";
|
export * from './base';
|
||||||
export * as Auth from "./auth";
|
export * as Auth from './auth';
|
||||||
export * as FS from "./fs";
|
export * as FS from './fs';
|
||||||
export * as User from "./user";
|
export * as User from './user';
|
||||||
export * as Admin from "./admin";
|
export * as Admin from './admin';
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
import { SuccessResponse } from "./base";
|
import { SuccessResponse } from './base';
|
||||||
import { ValidateConstructor } from "../utils";
|
import { ValidateConstructor } from '../utils';
|
||||||
import { IsBoolean, IsNotEmpty, IsString } from "class-validator";
|
import { IsBoolean, IsNotEmpty, IsString } from 'class-validator';
|
||||||
|
|
||||||
@ValidateConstructor
|
@ValidateConstructor
|
||||||
export class UserInfoResponse extends SuccessResponse {
|
export class UserInfoResponse extends SuccessResponse {
|
||||||
constructor(name: string, gitlab: boolean, tfaEnabled: boolean) {
|
constructor(name: string, gitlab: boolean, tfaEnabled: boolean) {
|
||||||
super();
|
super();
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.gitlab = gitlab;
|
this.gitlab = gitlab;
|
||||||
this.tfaEnabled = tfaEnabled;
|
this.tfaEnabled = tfaEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsString()
|
@IsString()
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
gitlab: boolean;
|
gitlab: boolean;
|
||||||
|
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
tfaEnabled: boolean;
|
tfaEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DeleteUserResponse extends SuccessResponse {}
|
export class DeleteUserResponse extends SuccessResponse {}
|
||||||
|
@ -1,41 +1,43 @@
|
|||||||
import { validate, validateSync as _validateSync } from "class-validator";
|
import { validate, validateSync as _validateSync } from 'class-validator';
|
||||||
|
|
||||||
export enum UserRole {
|
export enum UserRole {
|
||||||
ADMIN = 2,
|
ADMIN = 2,
|
||||||
USER = 1,
|
USER = 1,
|
||||||
DISABLED = 0,
|
DISABLED = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export function validateSync<T extends object>(data: T): void {
|
export function validateSync<T extends object>(data: T): void {
|
||||||
const errors = _validateSync(data);
|
const errors = _validateSync(data);
|
||||||
if (errors.length > 0) {
|
if (errors.length > 0) {
|
||||||
console.error("Validation failed, errors: ", errors);
|
console.error('Validation failed, errors: ', errors);
|
||||||
throw new Error("Validation failed");
|
throw new Error('Validation failed');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function validateAsync<T extends object>(data: T): Promise<void> {
|
export async function validateAsync<T extends object>(data: T): Promise<void> {
|
||||||
const errors = await validate(data);
|
const errors = await validate(data);
|
||||||
if (errors.length > 0) {
|
if (errors.length > 0) {
|
||||||
console.error("Validation failed, errors: ", errors);
|
console.error('Validation failed, errors: ', errors);
|
||||||
throw new Error("Validation failed");
|
throw new Error('Validation failed');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function validateAsyncInline<T extends object>(
|
export async function validateAsyncInline<T extends object>(
|
||||||
data: T
|
data: T
|
||||||
): Promise<T> {
|
): Promise<T> {
|
||||||
await validateAsync(data);
|
await validateAsync(data);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ValidateConstructor<T extends { new (...args: any[]): any }>(
|
export function ValidateConstructor<
|
||||||
constr: T
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
) {
|
T extends { new (...args: any[]): any }
|
||||||
return class extends constr {
|
>(constr: T) {
|
||||||
constructor(...args: any[]) {
|
return class extends constr {
|
||||||
super(...args);
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
validateSync(this);
|
constructor(...args: any[]) {
|
||||||
}
|
super(...args);
|
||||||
};
|
validateSync(this);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { createApp } from "vue";
|
import { createApp } from 'vue';
|
||||||
import router from "./router";
|
import router from './router';
|
||||||
import AppAsyncWrapper from "./AppAsyncWrapper.vue";
|
import AppAsyncWrapper from './AppAsyncWrapper.vue';
|
||||||
|
|
||||||
const app = createApp(AppAsyncWrapper);
|
const app = createApp(AppAsyncWrapper);
|
||||||
app.use(router);
|
app.use(router);
|
||||||
app.config.unwrapInjectedRef = true;
|
app.config.unwrapInjectedRef = true;
|
||||||
app.mount("#app");
|
app.mount('#app');
|
||||||
|
@ -1,63 +1,63 @@
|
|||||||
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
|
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
|
||||||
import LoginView from "@/views/LoginView.vue";
|
import LoginView from '@/views/LoginView.vue';
|
||||||
import SignupView from "@/views/SignupView.vue";
|
import SignupView from '@/views/SignupView.vue';
|
||||||
import HomeView from "@/views/HomeView.vue";
|
import HomeView from '@/views/HomeView.vue';
|
||||||
import AboutView from "@/views/AboutView.vue";
|
import AboutView from '@/views/AboutView.vue';
|
||||||
import FSView from "@/views/FSView.vue";
|
import FSView from '@/views/FSView.vue';
|
||||||
import SetTokenView from "@/views/SetTokenView.vue";
|
import SetTokenView from '@/views/SetTokenView.vue';
|
||||||
import ProfileView from "@/views/ProfileView.vue";
|
import ProfileView from '@/views/ProfileView.vue';
|
||||||
import TFAView from "@/views/TFAView.vue";
|
import TFAView from '@/views/TFAView.vue';
|
||||||
import AdminView from "@/views/AdminView.vue";
|
import AdminView from '@/views/AdminView.vue';
|
||||||
|
|
||||||
const routes: Array<RouteRecordRaw> = [
|
const routes: Array<RouteRecordRaw> = [
|
||||||
{
|
{
|
||||||
path: "/",
|
path: '/',
|
||||||
name: "home",
|
name: 'home',
|
||||||
component: HomeView,
|
component: HomeView
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/profile",
|
path: '/profile',
|
||||||
name: "profile",
|
name: 'profile',
|
||||||
component: ProfileView,
|
component: ProfileView
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/profile/2fa-enable",
|
path: '/profile/2fa-enable',
|
||||||
name: "2fa",
|
name: '2fa',
|
||||||
component: TFAView,
|
component: TFAView
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/admin",
|
path: '/admin',
|
||||||
component: AdminView,
|
component: AdminView
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/about",
|
path: '/about',
|
||||||
component: AboutView,
|
component: AboutView
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/login",
|
path: '/login',
|
||||||
name: "login",
|
name: 'login',
|
||||||
component: LoginView,
|
component: LoginView
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/signup",
|
path: '/signup',
|
||||||
name: "signup",
|
name: 'signup',
|
||||||
component: SignupView,
|
component: SignupView
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/fs/:node_id",
|
path: '/fs/:node_id',
|
||||||
name: "fs",
|
name: 'fs',
|
||||||
component: FSView,
|
component: FSView
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: "/set_token",
|
path: '/set_token',
|
||||||
component: SetTokenView,
|
component: SetTokenView
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(process.env.BASE_URL),
|
history: createWebHistory(process.env.BASE_URL),
|
||||||
routes,
|
routes
|
||||||
});
|
});
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
6
frontend/src/shims-vue.d.ts
vendored
6
frontend/src/shims-vue.d.ts
vendored
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
declare module '*.vue' {
|
declare module '*.vue' {
|
||||||
import type { DefineComponent } from 'vue'
|
import type { DefineComponent } from 'vue';
|
||||||
const component: DefineComponent<{}, {}, any>
|
const component: DefineComponent<{}, {}, any>;
|
||||||
export default component
|
export default component;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="about">
|
<div class="about">
|
||||||
<h1>This is an about page</h1>
|
<h1>This is an about page</h1>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,109 +1,109 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { inject, onBeforeMount, ref } from "vue";
|
import { inject, onBeforeMount, ref } from 'vue';
|
||||||
import {
|
import {
|
||||||
Responses,
|
Responses,
|
||||||
check_token,
|
check_token,
|
||||||
TokenInjectType,
|
TokenInjectType,
|
||||||
Admin,
|
Admin,
|
||||||
isErrorResponse,
|
isErrorResponse
|
||||||
} from "@/api";
|
} from '@/api';
|
||||||
import { onBeforeRouteUpdate } from "vue-router";
|
import { onBeforeRouteUpdate } from 'vue-router';
|
||||||
import router from "@/router";
|
import router from '@/router';
|
||||||
|
|
||||||
const jwt = inject<TokenInjectType>("jwt") as TokenInjectType;
|
const jwt = inject<TokenInjectType>('jwt') as TokenInjectType;
|
||||||
|
|
||||||
const users = ref<Responses.Admin.GetUsersEntry[]>([]);
|
const users = ref<Responses.Admin.GetUsersEntry[]>([]);
|
||||||
|
|
||||||
onBeforeRouteUpdate(async () => {
|
onBeforeRouteUpdate(async () => {
|
||||||
await updatePanel();
|
await updatePanel();
|
||||||
});
|
});
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
await updatePanel();
|
await updatePanel();
|
||||||
});
|
});
|
||||||
async function updatePanel() {
|
async function updatePanel() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
|
|
||||||
const res = await Admin.get_users(token);
|
const res = await Admin.get_users(token);
|
||||||
if (isErrorResponse(res)) return router.replace({ path: "/" });
|
if (isErrorResponse(res)) return router.replace({ path: '/' });
|
||||||
users.value = res.users;
|
users.value = res.users;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setRole(user: number, roleStr: string) {
|
async function setRole(user: number, roleStr: string) {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
|
|
||||||
const res = await Admin.set_role(user, parseInt(roleStr, 10), token);
|
const res = await Admin.set_role(user, parseInt(roleStr, 10), token);
|
||||||
if (isErrorResponse(res)) console.error(res.message);
|
if (isErrorResponse(res)) console.error(res.message);
|
||||||
await updatePanel();
|
await updatePanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function disableTfa(user: number) {
|
async function disableTfa(user: number) {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
|
|
||||||
const res = await Admin.disable_tfa(user, token);
|
const res = await Admin.disable_tfa(user, token);
|
||||||
if (isErrorResponse(res)) console.error(res.message);
|
if (isErrorResponse(res)) console.error(res.message);
|
||||||
await updatePanel();
|
await updatePanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function logoutUser(user: number) {
|
async function logoutUser(user: number) {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
|
|
||||||
const res = await Admin.logout(user, token);
|
const res = await Admin.logout(user, token);
|
||||||
if (isErrorResponse(res)) console.error(res.message);
|
if (isErrorResponse(res)) console.error(res.message);
|
||||||
await updatePanel();
|
await updatePanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteUser(user: number) {
|
async function deleteUser(user: number) {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
|
|
||||||
const res = await Admin.delete_user(user, token);
|
const res = await Admin.delete_user(user, token);
|
||||||
if (isErrorResponse(res)) console.error(res.message);
|
if (isErrorResponse(res)) console.error(res.message);
|
||||||
await updatePanel();
|
await updatePanel();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Type</th>
|
<th>Type</th>
|
||||||
<th>Role</th>
|
<th>Role</th>
|
||||||
<th>Tfa Status</th>
|
<th>Tfa Status</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="user in users" :key="user.id">
|
<tr v-for="user in users" :key="user.id">
|
||||||
<td>{{ user.name }}</td>
|
<td>{{ user.name }}</td>
|
||||||
<td>{{ user.gitlab ? "Gitlab" : "Password" }}</td>
|
<td>{{ user.gitlab ? 'Gitlab' : 'Password' }}</td>
|
||||||
<td>
|
<td>
|
||||||
<select @change="setRole(user.id, $event.target.value)">
|
<select @change="setRole(user.id, $event.target.value)">
|
||||||
<option value="0" :selected="user.role === 0 ? true : null">
|
<option value="0" :selected="user.role === 0 ? true : null">
|
||||||
Disabled
|
Disabled
|
||||||
</option>
|
</option>
|
||||||
<option value="1" :selected="user.role === 1 ? true : null">
|
<option value="1" :selected="user.role === 1 ? true : null">
|
||||||
User
|
User
|
||||||
</option>
|
</option>
|
||||||
<option value="2" :selected="user.role === 2 ? true : null">
|
<option value="2" :selected="user.role === 2 ? true : null">
|
||||||
Admin
|
Admin
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td v-if="user.gitlab"></td>
|
<td v-if="user.gitlab"></td>
|
||||||
<td v-else>
|
<td v-else>
|
||||||
{{ user.tfaEnabled ? "Enabled" : "Disabled" }}
|
{{ user.tfaEnabled ? 'Enabled' : 'Disabled' }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button v-if="user.tfaEnabled" @click="disableTfa(user.id)">
|
<button v-if="user.tfaEnabled" @click="disableTfa(user.id)">
|
||||||
Disable Tfa
|
Disable Tfa
|
||||||
</button>
|
</button>
|
||||||
<button @click="logoutUser(user.id)">Logout all</button>
|
<button @click="logoutUser(user.id)">Logout all</button>
|
||||||
<button @click="deleteUser(user.id)">Delete</button>
|
<button @click="deleteUser(user.id)">Delete</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,70 +1,70 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onBeforeRouteUpdate, useRoute, useRouter } from "vue-router";
|
import { onBeforeRouteUpdate, useRoute, useRouter } from 'vue-router';
|
||||||
import { inject, onBeforeMount, ref } from "vue";
|
import { inject, onBeforeMount, ref } from 'vue';
|
||||||
import {
|
import {
|
||||||
check_token,
|
check_token,
|
||||||
FS,
|
FS,
|
||||||
Responses,
|
Responses,
|
||||||
isErrorResponse,
|
isErrorResponse,
|
||||||
TokenInjectType,
|
TokenInjectType
|
||||||
} from "@/api";
|
} from '@/api';
|
||||||
import DirViewer from "@/components/FSView/DirViewer.vue";
|
import DirViewer from '@/components/FSView/DirViewer.vue';
|
||||||
import FileViewer from "@/components/FSView/FileViewer.vue";
|
import FileViewer from '@/components/FSView/FileViewer.vue';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const jwt = inject<TokenInjectType>("jwt") as TokenInjectType;
|
const jwt = inject<TokenInjectType>('jwt') as TokenInjectType;
|
||||||
|
|
||||||
const path = ref("");
|
const path = ref('');
|
||||||
const node = ref<Responses.FS.GetNodeResponse | null>(null);
|
const node = ref<Responses.FS.GetNodeResponse | null>(null);
|
||||||
|
|
||||||
async function fetch_node(node_id: number) {
|
async function fetch_node(node_id: number) {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
let [p, n] = [
|
let [p, n] = [
|
||||||
await FS.get_path(token, node_id),
|
await FS.get_path(token, node_id),
|
||||||
await FS.get_node(token, node_id),
|
await FS.get_node(token, node_id)
|
||||||
];
|
];
|
||||||
if (isErrorResponse(p)) return gotoRoot();
|
if (isErrorResponse(p)) return gotoRoot();
|
||||||
if (isErrorResponse(n)) return gotoRoot();
|
if (isErrorResponse(n)) return gotoRoot();
|
||||||
[path.value, node.value] = [p.path, n];
|
[path.value, node.value] = [p.path, n];
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeRouteUpdate(async (to) => {
|
onBeforeRouteUpdate(async (to) => {
|
||||||
await fetch_node(Number(to.params.node_id));
|
await fetch_node(Number(to.params.node_id));
|
||||||
});
|
});
|
||||||
|
|
||||||
async function reloadNode() {
|
async function reloadNode() {
|
||||||
await fetch_node(Number(route.params.node_id));
|
await fetch_node(Number(route.params.node_id));
|
||||||
}
|
}
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
await reloadNode();
|
await reloadNode();
|
||||||
});
|
});
|
||||||
|
|
||||||
async function gotoRoot() {
|
async function gotoRoot() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
const rootRes = await FS.get_root(token);
|
const rootRes = await FS.get_root(token);
|
||||||
if (isErrorResponse(rootRes)) return jwt.logout();
|
if (isErrorResponse(rootRes)) return jwt.logout();
|
||||||
const root = rootRes.rootId;
|
const root = rootRes.rootId;
|
||||||
await router.replace({
|
await router.replace({
|
||||||
name: "fs",
|
name: 'fs',
|
||||||
params: { node_id: root },
|
params: { node_id: root }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="node">
|
<div v-if="node">
|
||||||
<div>Path: {{ path }}</div>
|
<div>Path: {{ path }}</div>
|
||||||
<DirViewer
|
<DirViewer
|
||||||
v-if="!node.isFile"
|
v-if="!node.isFile"
|
||||||
:node="node"
|
:node="node"
|
||||||
@reloadNode="reloadNode"
|
@reloadNode="reloadNode"
|
||||||
@gotoRoot="gotoRoot"
|
@gotoRoot="gotoRoot"
|
||||||
/>
|
/>
|
||||||
<FileViewer v-else :node="node" />
|
<FileViewer v-else :node="node" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
<template><p></p></template>
|
<template><p></p></template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onBeforeRouteUpdate, useRouter } from "vue-router";
|
import { onBeforeRouteUpdate, useRouter } from 'vue-router';
|
||||||
import { inject, onBeforeMount } from "vue";
|
import { inject, onBeforeMount } from 'vue';
|
||||||
import { FS, check_token, isErrorResponse, TokenInjectType } from "@/api";
|
import { FS, check_token, isErrorResponse, TokenInjectType } from '@/api';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const jwt = inject<TokenInjectType>("jwt") as TokenInjectType;
|
const jwt = inject<TokenInjectType>('jwt') as TokenInjectType;
|
||||||
|
|
||||||
async function start_redirect() {
|
async function start_redirect() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
const root = await FS.get_root(token);
|
const root = await FS.get_root(token);
|
||||||
if (isErrorResponse(root)) return jwt.logout();
|
if (isErrorResponse(root)) return jwt.logout();
|
||||||
await router.replace({
|
await router.replace({
|
||||||
name: "fs",
|
name: 'fs',
|
||||||
params: { node_id: root.rootId },
|
params: { node_id: root.rootId }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeRouteUpdate(async () => {
|
onBeforeRouteUpdate(async () => {
|
||||||
await start_redirect();
|
await start_redirect();
|
||||||
});
|
});
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
await start_redirect();
|
await start_redirect();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,61 +1,61 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, inject } from "vue";
|
import { ref, inject } from 'vue';
|
||||||
import { Auth, FS, isErrorResponse, TokenInjectType } from "@/api";
|
import { Auth, FS, isErrorResponse, TokenInjectType } from '@/api';
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const username = ref("");
|
const username = ref('');
|
||||||
const password = ref("");
|
const password = ref('');
|
||||||
const otp = ref("");
|
const otp = ref('');
|
||||||
|
|
||||||
const error = ref("");
|
const error = ref('');
|
||||||
|
|
||||||
const requestOtp = ref(false);
|
const requestOtp = ref(false);
|
||||||
|
|
||||||
const jwt = inject<TokenInjectType>("jwt") as TokenInjectType;
|
const jwt = inject<TokenInjectType>('jwt') as TokenInjectType;
|
||||||
|
|
||||||
async function login() {
|
async function login() {
|
||||||
error.value = "";
|
error.value = '';
|
||||||
if (username.value === "" || password.value === "") {
|
if (username.value === '' || password.value === '') {
|
||||||
error.value = "Email and/or Password missing";
|
error.value = 'Email and/or Password missing';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const res = await (requestOtp.value
|
const res = await (requestOtp.value
|
||||||
? Auth.auth_login(username.value, password.value, otp.value)
|
? Auth.auth_login(username.value, password.value, otp.value)
|
||||||
: Auth.auth_login(username.value, password.value));
|
: Auth.auth_login(username.value, password.value));
|
||||||
if (isErrorResponse(res)) error.value = "Login failed: " + res.message;
|
if (isErrorResponse(res)) error.value = 'Login failed: ' + res.message;
|
||||||
else if ("jwt" in res) {
|
else if ('jwt' in res) {
|
||||||
const root = await FS.get_root(res.jwt);
|
const root = await FS.get_root(res.jwt);
|
||||||
if (isErrorResponse(root)) {
|
if (isErrorResponse(root)) {
|
||||||
error.value = "Get root failed: " + root.message;
|
error.value = 'Get root failed: ' + root.message;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
jwt.setToken(res.jwt);
|
jwt.setToken(res.jwt);
|
||||||
await router.push({
|
await router.push({
|
||||||
name: "fs",
|
name: 'fs',
|
||||||
params: { node_id: root.rootId },
|
params: { node_id: root.rootId }
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
error.value = "";
|
error.value = '';
|
||||||
requestOtp.value = true;
|
requestOtp.value = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="error !== ''" v-text="error"></div>
|
<div v-if="error !== ''" v-text="error"></div>
|
||||||
<template v-if="!requestOtp">
|
<template v-if="!requestOtp">
|
||||||
<input type="email" placeholder="Email" v-model="username" />
|
<input type="email" placeholder="Email" v-model="username" />
|
||||||
<input type="password" placeholder="Password" v-model="password" />
|
<input type="password" placeholder="Password" v-model="password" />
|
||||||
<a href="/api/auth/gitlab">Login with gitlab</a>
|
<a href="/api/auth/gitlab">Login with gitlab</a>
|
||||||
<router-link to="signup">Signup instead?</router-link>
|
<router-link to="signup">Signup instead?</router-link>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div>Please input your 2 factor authentication code</div>
|
<div>Please input your 2 factor authentication code</div>
|
||||||
<input type="text" placeholder="Code" v-model="otp" />
|
<input type="text" placeholder="Code" v-model="otp" />
|
||||||
</template>
|
</template>
|
||||||
<button @click="login()">Login</button>
|
<button @click="login()">Login</button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,112 +1,124 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, inject, onBeforeMount } from "vue";
|
import { ref, inject, onBeforeMount } from 'vue';
|
||||||
import {
|
import {
|
||||||
Auth,
|
Auth,
|
||||||
User,
|
User,
|
||||||
check_token,
|
check_token,
|
||||||
isErrorResponse,
|
isErrorResponse,
|
||||||
TokenInjectType,
|
TokenInjectType,
|
||||||
Responses,
|
Responses
|
||||||
} from "@/api";
|
} from '@/api';
|
||||||
import { onBeforeRouteUpdate } from "vue-router";
|
import { onBeforeRouteUpdate } from 'vue-router';
|
||||||
|
|
||||||
const error = ref("");
|
const error = ref('');
|
||||||
const oldPw = ref("");
|
const oldPw = ref('');
|
||||||
const newPw = ref("");
|
const newPw = ref('');
|
||||||
const newPw2 = ref("");
|
const newPw2 = ref('');
|
||||||
const user = ref<Responses.User.UserInfoResponse | null>(null);
|
const user = ref<Responses.User.UserInfoResponse | null>(null);
|
||||||
|
|
||||||
const jwt = inject<TokenInjectType>("jwt") as TokenInjectType;
|
const jwt = inject<TokenInjectType>('jwt') as TokenInjectType;
|
||||||
|
|
||||||
onBeforeRouteUpdate(async () => {
|
onBeforeRouteUpdate(async () => {
|
||||||
await updateProfile();
|
await updateProfile();
|
||||||
});
|
});
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
await updateProfile();
|
await updateProfile();
|
||||||
});
|
});
|
||||||
async function updateProfile() {
|
async function updateProfile() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
|
|
||||||
const res = await User.get_user_info(token);
|
const res = await User.get_user_info(token);
|
||||||
if (isErrorResponse(res)) return jwt.logout();
|
if (isErrorResponse(res)) return jwt.logout();
|
||||||
user.value = res;
|
user.value = res;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteUser() {
|
async function deleteUser() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
await User.delete_user(token);
|
await User.delete_user(token);
|
||||||
jwt.logout();
|
jwt.logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function logoutAll() {
|
async function logoutAll() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
await Auth.logout_all(token);
|
await Auth.logout_all(token);
|
||||||
jwt.logout();
|
jwt.logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function changePw() {
|
async function changePw() {
|
||||||
if (oldPw.value === "" || newPw.value === "" || newPw2.value === "") {
|
if (oldPw.value === '' || newPw.value === '' || newPw2.value === '') {
|
||||||
error.value = "Password missing";
|
error.value = 'Password missing';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (newPw.value !== newPw2.value) {
|
if (newPw.value !== newPw2.value) {
|
||||||
error.value = "Passwords don't match";
|
error.value = "Passwords don't match";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
const res = await Auth.change_password(oldPw.value, newPw.value, token);
|
const res = await Auth.change_password(oldPw.value, newPw.value, token);
|
||||||
if (isErrorResponse(res))
|
if (isErrorResponse(res))
|
||||||
error.value = "Password change failed: " + res.message;
|
error.value = 'Password change failed: ' + res.message;
|
||||||
else jwt.logout();
|
else jwt.logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function tfaDisable() {
|
async function tfaDisable() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
await Auth.tfa_disable(token);
|
await Auth.tfa_disable(token);
|
||||||
jwt.logout();
|
jwt.logout();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<template v-if="user">
|
<template v-if="user">
|
||||||
<div v-if="error !== ''" v-text="error"></div>
|
<div v-if="error !== ''" v-text="error"></div>
|
||||||
<div>User: {{ user.name }}</div>
|
<div>User: {{ user.name }}</div>
|
||||||
<div>Signed in with {{ user.gitlab ? "gitlab" : "password" }}</div>
|
<div>Signed in with {{ user.gitlab ? 'gitlab' : 'password' }}</div>
|
||||||
<template v-if="!user.gitlab">
|
<template v-if="!user.gitlab">
|
||||||
<div>
|
<div>
|
||||||
<input type="password" placeholder="Old password" v-model="oldPw" />
|
<input
|
||||||
<input type="password" placeholder="New password" v-model="newPw" />
|
type="password"
|
||||||
<input
|
placeholder="Old password"
|
||||||
type="password"
|
v-model="oldPw"
|
||||||
placeholder="Repeat new password"
|
/>
|
||||||
v-model="newPw2"
|
<input
|
||||||
/>
|
type="password"
|
||||||
<button @click="changePw">Change</button>
|
placeholder="New password"
|
||||||
</div>
|
v-model="newPw"
|
||||||
<div>
|
/>
|
||||||
<div>
|
<input
|
||||||
2 Factor authentication:
|
type="password"
|
||||||
{{ user.tfaEnabled ? "Enabled" : "Disabled" }}
|
placeholder="Repeat new password"
|
||||||
</div>
|
v-model="newPw2"
|
||||||
<div>
|
/>
|
||||||
<a href="#" v-if="user.tfaEnabled" @click="tfaDisable"> Disable </a>
|
<button @click="changePw">Change</button>
|
||||||
<router-link to="/profile/2fa-enable" v-else> Enable </router-link>
|
</div>
|
||||||
</div>
|
<div>
|
||||||
</div>
|
<div>
|
||||||
</template>
|
2 Factor authentication:
|
||||||
<div>
|
{{ user.tfaEnabled ? 'Enabled' : 'Disabled' }}
|
||||||
<a href="#" @click="logoutAll">Logout everywhere</a>
|
</div>
|
||||||
<a href="#" @click="deleteUser">Delete Account</a>
|
<div>
|
||||||
</div>
|
<a href="#" v-if="user.tfaEnabled" @click="tfaDisable">
|
||||||
</template>
|
Disable
|
||||||
<template v-else>
|
</a>
|
||||||
<div>Loading...</div>
|
<router-link to="/profile/2fa-enable" v-else>
|
||||||
</template>
|
Enable
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div>
|
||||||
|
<a href="#" @click="logoutAll">Logout everywhere</a>
|
||||||
|
<a href="#" @click="deleteUser">Delete Account</a>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<div>Loading...</div>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { inject } from "vue";
|
import { inject } from 'vue';
|
||||||
import { TokenInjectType } from "@/api";
|
import { TokenInjectType } from '@/api';
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const jwt = inject<TokenInjectType>("jwt") as TokenInjectType;
|
const jwt = inject<TokenInjectType>('jwt') as TokenInjectType;
|
||||||
|
|
||||||
if ("token" in route.query) jwt.setToken(route.query["token"] as string);
|
if ('token' in route.query) jwt.setToken(route.query['token'] as string);
|
||||||
router.replace({ path: "/" });
|
router.replace({ path: '/' });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<router-link to="/">Click here to go home</router-link>
|
<router-link to="/">Click here to go home</router-link>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue';
|
||||||
import { Auth, isErrorResponse } from "@/api";
|
import { Auth, isErrorResponse } from '@/api';
|
||||||
|
|
||||||
const username = ref("");
|
const username = ref('');
|
||||||
const password = ref("");
|
const password = ref('');
|
||||||
const password2 = ref("");
|
const password2 = ref('');
|
||||||
const error = ref("");
|
const error = ref('');
|
||||||
|
|
||||||
async function signup() {
|
async function signup() {
|
||||||
if (username.value === "" || password.value === "") {
|
if (username.value === '' || password.value === '') {
|
||||||
error.value = "Email and/or Password missing";
|
error.value = 'Email and/or Password missing';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (password.value !== password2.value) {
|
if (password.value !== password2.value) {
|
||||||
error.value = "Passwords don't match";
|
error.value = "Passwords don't match";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const res = await Auth.auth_signup(username.value, password.value);
|
const res = await Auth.auth_signup(username.value, password.value);
|
||||||
error.value = isErrorResponse(res)
|
error.value = isErrorResponse(res)
|
||||||
? "Signup failed: " + res.message
|
? 'Signup failed: ' + res.message
|
||||||
: "Signup successful, please wait till an admin unlocks your account.";
|
: 'Signup successful, please wait till an admin unlocks your account.';
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="error !== ''" v-text="error"></div>
|
<div v-if="error !== ''" v-text="error"></div>
|
||||||
<input type="email" placeholder="Email" v-model="username" />
|
<input type="email" placeholder="Email" v-model="username" />
|
||||||
<input type="password" placeholder="Password" v-model="password" />
|
<input type="password" placeholder="Password" v-model="password" />
|
||||||
<input type="password" placeholder="Repeat password" v-model="password2" />
|
<input type="password" placeholder="Repeat password" v-model="password2" />
|
||||||
<button @click="signup()">Signup</button>
|
<button @click="signup()">Signup</button>
|
||||||
<router-link to="login">Login instead?</router-link>
|
<router-link to="login">Login instead?</router-link>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,89 +1,89 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, inject } from "vue";
|
import { ref, inject } from 'vue';
|
||||||
import { Auth, check_token, isErrorResponse, TokenInjectType } from "@/api";
|
import { Auth, check_token, isErrorResponse, TokenInjectType } from '@/api';
|
||||||
|
|
||||||
enum state {
|
enum state {
|
||||||
SELECT,
|
SELECT,
|
||||||
MAIL,
|
MAIL,
|
||||||
TOTP,
|
TOTP
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentState = ref<state>(state.SELECT);
|
const currentState = ref<state>(state.SELECT);
|
||||||
|
|
||||||
const error = ref("");
|
const error = ref('');
|
||||||
const qrImage = ref("");
|
const qrImage = ref('');
|
||||||
const secret = ref("");
|
const secret = ref('');
|
||||||
const code = ref("");
|
const code = ref('');
|
||||||
|
|
||||||
const jwt = inject<TokenInjectType>("jwt") as TokenInjectType;
|
const jwt = inject<TokenInjectType>('jwt') as TokenInjectType;
|
||||||
|
|
||||||
async function selectMail() {
|
async function selectMail() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
error.value = "Working...";
|
error.value = 'Working...';
|
||||||
const res = await Auth.tfa_setup(true, token);
|
const res = await Auth.tfa_setup(true, token);
|
||||||
if (isErrorResponse(res))
|
if (isErrorResponse(res))
|
||||||
error.value = "Failed to select 2fa type: " + res.message;
|
error.value = 'Failed to select 2fa type: ' + res.message;
|
||||||
else {
|
else {
|
||||||
error.value = "";
|
error.value = '';
|
||||||
currentState.value = state.MAIL;
|
currentState.value = state.MAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function selectTotp() {
|
async function selectTotp() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
error.value = "Working...";
|
error.value = 'Working...';
|
||||||
const res = await Auth.tfa_setup(false, token);
|
const res = await Auth.tfa_setup(false, token);
|
||||||
if (isErrorResponse(res))
|
if (isErrorResponse(res))
|
||||||
error.value = "Failed to select 2fa type: " + res.message;
|
error.value = 'Failed to select 2fa type: ' + res.message;
|
||||||
else {
|
else {
|
||||||
qrImage.value = res.qrCode;
|
qrImage.value = res.qrCode;
|
||||||
secret.value = res.secret;
|
secret.value = res.secret;
|
||||||
error.value = "";
|
error.value = '';
|
||||||
currentState.value = state.TOTP;
|
currentState.value = state.TOTP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function submit() {
|
async function submit() {
|
||||||
const token = await check_token(jwt);
|
const token = await check_token(jwt);
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
error.value = "Working...";
|
error.value = 'Working...';
|
||||||
const res = await Auth.tfa_complete(
|
const res = await Auth.tfa_complete(
|
||||||
currentState.value === state.MAIL,
|
currentState.value === state.MAIL,
|
||||||
code.value,
|
code.value,
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
if (isErrorResponse(res))
|
if (isErrorResponse(res))
|
||||||
error.value = "Failed to submit code: " + res.message;
|
error.value = 'Failed to submit code: ' + res.message;
|
||||||
else jwt.logout();
|
else jwt.logout();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="error !== ''" v-text="error"></div>
|
<div v-if="error !== ''" v-text="error"></div>
|
||||||
<template v-if="currentState === state.SELECT">
|
<template v-if="currentState === state.SELECT">
|
||||||
<div>Select 2 Factor authentication type:</div>
|
<div>Select 2 Factor authentication type:</div>
|
||||||
<div>
|
<div>
|
||||||
<button @click="selectMail">Mail</button>
|
<button @click="selectMail">Mail</button>
|
||||||
<button @click="selectTotp">Google Authenticator</button>
|
<button @click="selectTotp">Google Authenticator</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="currentState === state.MAIL">
|
<template v-else-if="currentState === state.MAIL">
|
||||||
<div>Please enter the code you got by mail</div>
|
<div>Please enter the code you got by mail</div>
|
||||||
<input type="text" placeholder="Code" v-model="code" />
|
<input type="text" placeholder="Code" v-model="code" />
|
||||||
<button @click="submit()">Submit</button>
|
<button @click="submit()">Submit</button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<img :src="qrImage" alt="QrCode" />
|
<img :src="qrImage" alt="QrCode" />
|
||||||
<details>
|
<details>
|
||||||
<summary>Show manual input code</summary>
|
<summary>Show manual input code</summary>
|
||||||
{{ secret }}
|
{{ secret }}
|
||||||
</details>
|
</details>
|
||||||
<div>Please enter the current code</div>
|
<div>Please enter the current code</div>
|
||||||
<input type="text" placeholder="Code" v-model="code" />
|
<input type="text" placeholder="Code" v-model="code" />
|
||||||
<button @click="submit()">Submit</button>
|
<button @click="submit()">Submit</button>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,43 +1,32 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"strictPropertyInitialization": false,
|
"strictPropertyInitialization": false,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"types": [
|
"types": ["webpack-env"],
|
||||||
"webpack-env"
|
"paths": {
|
||||||
],
|
"@/*": ["src/*"]
|
||||||
"paths": {
|
},
|
||||||
"@/*": [
|
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
|
||||||
"src/*"
|
},
|
||||||
]
|
"include": [
|
||||||
},
|
"src/**/*.ts",
|
||||||
"lib": [
|
"src/**/*.tsx",
|
||||||
"esnext",
|
"src/**/*.vue",
|
||||||
"dom",
|
"tests/**/*.ts",
|
||||||
"dom.iterable",
|
"tests/**/*.tsx"
|
||||||
"scripthost"
|
],
|
||||||
]
|
"exclude": ["node_modules"]
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"src/**/*.ts",
|
|
||||||
"src/**/*.tsx",
|
|
||||||
"src/**/*.vue",
|
|
||||||
"tests/**/*.ts",
|
|
||||||
"tests/**/*.tsx"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
const { defineConfig } = require("@vue/cli-service");
|
const { defineConfig } = require('@vue/cli-service');
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
transpileDependencies: true,
|
transpileDependencies: true,
|
||||||
configureWebpack: {
|
configureWebpack: {
|
||||||
resolve: {
|
resolve: {
|
||||||
fallback: {
|
fallback: {
|
||||||
crypto: false,
|
crypto: false,
|
||||||
stream: require.resolve("stream-browserify"),
|
stream: require.resolve('stream-browserify')
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
@ -1254,9 +1254,9 @@
|
|||||||
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==
|
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==
|
||||||
|
|
||||||
"@types/node@*":
|
"@types/node@*":
|
||||||
version "18.7.11"
|
version "18.7.14"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.11.tgz#486e72cfccde88da24e1f23ff1b7d8bfb64e6250"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.14.tgz#0fe081752a3333392d00586d815485a17c2cf3c9"
|
||||||
integrity sha512-KZhFpSLlmK/sdocfSAjqPETTMd0ug6HIMIAwkwUpU79olnZdQtMxpQP+G1wDzCH7na+FltSIhbaZuKdwZ8RDrw==
|
integrity sha512-6bbDaETVi8oyIARulOE9qF1/Qdi/23z6emrUh0fNJRUmjznqrixD4MpGDdgOFk5Xb0m2H6Xu42JGdvAxaJR/wA==
|
||||||
|
|
||||||
"@types/node@~17.0.5":
|
"@types/node@~17.0.5":
|
||||||
version "17.0.45"
|
version "17.0.45"
|
||||||
@ -1323,13 +1323,13 @@
|
|||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
"@typescript-eslint/eslint-plugin@^5.4.0":
|
"@typescript-eslint/eslint-plugin@^5.4.0":
|
||||||
version "5.34.0"
|
version "5.36.1"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.34.0.tgz#d690f60e335596f38b01792e8f4b361d9bd0cb35"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.36.1.tgz#471f64dc53600025e470dad2ca4a9f2864139019"
|
||||||
integrity sha512-eRfPPcasO39iwjlUAMtjeueRGuIrW3TQ9WseIDl7i5UWuFbf83yYaU7YPs4j8+4CxUMIsj1k+4kV+E+G+6ypDQ==
|
integrity sha512-iC40UK8q1tMepSDwiLbTbMXKDxzNy+4TfPWgIL661Ym0sD42vRcQU93IsZIrmi+x292DBr60UI/gSwfdVYexCA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/scope-manager" "5.34.0"
|
"@typescript-eslint/scope-manager" "5.36.1"
|
||||||
"@typescript-eslint/type-utils" "5.34.0"
|
"@typescript-eslint/type-utils" "5.36.1"
|
||||||
"@typescript-eslint/utils" "5.34.0"
|
"@typescript-eslint/utils" "5.36.1"
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
functional-red-black-tree "^1.0.1"
|
functional-red-black-tree "^1.0.1"
|
||||||
ignore "^5.2.0"
|
ignore "^5.2.0"
|
||||||
@ -1338,74 +1338,75 @@
|
|||||||
tsutils "^3.21.0"
|
tsutils "^3.21.0"
|
||||||
|
|
||||||
"@typescript-eslint/parser@^5.4.0":
|
"@typescript-eslint/parser@^5.4.0":
|
||||||
version "5.34.0"
|
version "5.36.1"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.34.0.tgz#ca710858ea85dbfd30c9b416a335dc49e82dbc07"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.36.1.tgz#931c22c7bacefd17e29734628cdec8b2acdcf1ce"
|
||||||
integrity sha512-SZ3NEnK4usd2CXkoV3jPa/vo1mWX1fqRyIVUQZR4As1vyp4fneknBNJj+OFtV8WAVgGf+rOHMSqQbs2Qn3nFZQ==
|
integrity sha512-/IsgNGOkBi7CuDfUbwt1eOqUXF9WGVBW9dwEe1pi+L32XrTsZIgmDFIi2RxjzsvB/8i+MIf5JIoTEH8LOZ368A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/scope-manager" "5.34.0"
|
"@typescript-eslint/scope-manager" "5.36.1"
|
||||||
"@typescript-eslint/types" "5.34.0"
|
"@typescript-eslint/types" "5.36.1"
|
||||||
"@typescript-eslint/typescript-estree" "5.34.0"
|
"@typescript-eslint/typescript-estree" "5.36.1"
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
|
|
||||||
"@typescript-eslint/scope-manager@5.34.0":
|
"@typescript-eslint/scope-manager@5.36.1":
|
||||||
version "5.34.0"
|
version "5.36.1"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.34.0.tgz#14efd13dc57602937e25f188fd911f118781e527"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.36.1.tgz#23c49b7ddbcffbe09082e6694c2524950766513f"
|
||||||
integrity sha512-HNvASMQlah5RsBW6L6c7IJ0vsm+8Sope/wu5sEAf7joJYWNb1LDbJipzmdhdUOnfrDFE6LR1j57x1EYVxrY4ow==
|
integrity sha512-pGC2SH3/tXdu9IH3ItoqciD3f3RRGCh7hb9zPdN2Drsr341zgd6VbhP5OHQO/reUqihNltfPpMpTNihFMarP2w==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/types" "5.34.0"
|
"@typescript-eslint/types" "5.36.1"
|
||||||
"@typescript-eslint/visitor-keys" "5.34.0"
|
"@typescript-eslint/visitor-keys" "5.36.1"
|
||||||
|
|
||||||
"@typescript-eslint/type-utils@5.34.0":
|
"@typescript-eslint/type-utils@5.36.1":
|
||||||
version "5.34.0"
|
version "5.36.1"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.34.0.tgz#7a324ab9ddd102cd5e1beefc94eea6f3eb32d32d"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.36.1.tgz#016fc2bff6679f54c0b2df848a493f0ca3d4f625"
|
||||||
integrity sha512-Pxlno9bjsQ7hs1pdWRUv9aJijGYPYsHpwMeCQ/Inavhym3/XaKt1ZKAA8FIw4odTBfowBdZJDMxf2aavyMDkLg==
|
integrity sha512-xfZhfmoQT6m3lmlqDvDzv9TiCYdw22cdj06xY0obSznBsT///GK5IEZQdGliXpAOaRL34o8phEvXzEo/VJx13Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/utils" "5.34.0"
|
"@typescript-eslint/typescript-estree" "5.36.1"
|
||||||
|
"@typescript-eslint/utils" "5.36.1"
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
tsutils "^3.21.0"
|
tsutils "^3.21.0"
|
||||||
|
|
||||||
"@typescript-eslint/types@5.34.0":
|
"@typescript-eslint/types@5.36.1":
|
||||||
version "5.34.0"
|
version "5.36.1"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.34.0.tgz#217bf08049e9e7b86694d982e88a2c1566330c78"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.36.1.tgz#1cf0e28aed1cb3ee676917966eb23c2f8334ce2c"
|
||||||
integrity sha512-49fm3xbbUPuzBIOcy2CDpYWqy/X7VBkxVN+DC21e0zIm3+61Z0NZi6J9mqPmSW1BDVk9FIOvuCFyUPjXz93sjA==
|
integrity sha512-jd93ShpsIk1KgBTx9E+hCSEuLCUFwi9V/urhjOWnOaksGZFbTOxAT47OH2d4NLJnLhkVD+wDbB48BuaycZPLBg==
|
||||||
|
|
||||||
"@typescript-eslint/typescript-estree@5.34.0":
|
"@typescript-eslint/typescript-estree@5.36.1":
|
||||||
version "5.34.0"
|
version "5.36.1"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.34.0.tgz#ba7b83f4bf8ccbabf074bbf1baca7a58de3ccb9a"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.36.1.tgz#b857f38d6200f7f3f4c65cd0a5afd5ae723f2adb"
|
||||||
integrity sha512-mXHAqapJJDVzxauEkfJI96j3D10sd567LlqroyCeJaHnu42sDbjxotGb3XFtGPYKPD9IyLjhsoULML1oI3M86A==
|
integrity sha512-ih7V52zvHdiX6WcPjsOdmADhYMDN15SylWRZrT2OMy80wzKbc79n8wFW0xpWpU0x3VpBz/oDgTm2xwDAnFTl+g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/types" "5.34.0"
|
"@typescript-eslint/types" "5.36.1"
|
||||||
"@typescript-eslint/visitor-keys" "5.34.0"
|
"@typescript-eslint/visitor-keys" "5.36.1"
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
globby "^11.1.0"
|
globby "^11.1.0"
|
||||||
is-glob "^4.0.3"
|
is-glob "^4.0.3"
|
||||||
semver "^7.3.7"
|
semver "^7.3.7"
|
||||||
tsutils "^3.21.0"
|
tsutils "^3.21.0"
|
||||||
|
|
||||||
"@typescript-eslint/utils@5.34.0":
|
"@typescript-eslint/utils@5.36.1":
|
||||||
version "5.34.0"
|
version "5.36.1"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.34.0.tgz#0cae98f48d8f9e292e5caa9343611b6faf49e743"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.36.1.tgz#136d5208cc7a3314b11c646957f8f0b5c01e07ad"
|
||||||
integrity sha512-kWRYybU4Rn++7lm9yu8pbuydRyQsHRoBDIo11k7eqBWTldN4xUdVUMCsHBiE7aoEkFzrUEaZy3iH477vr4xHAQ==
|
integrity sha512-lNj4FtTiXm5c+u0pUehozaUWhh7UYKnwryku0nxJlYUEWetyG92uw2pr+2Iy4M/u0ONMKzfrx7AsGBTCzORmIg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/json-schema" "^7.0.9"
|
"@types/json-schema" "^7.0.9"
|
||||||
"@typescript-eslint/scope-manager" "5.34.0"
|
"@typescript-eslint/scope-manager" "5.36.1"
|
||||||
"@typescript-eslint/types" "5.34.0"
|
"@typescript-eslint/types" "5.36.1"
|
||||||
"@typescript-eslint/typescript-estree" "5.34.0"
|
"@typescript-eslint/typescript-estree" "5.36.1"
|
||||||
eslint-scope "^5.1.1"
|
eslint-scope "^5.1.1"
|
||||||
eslint-utils "^3.0.0"
|
eslint-utils "^3.0.0"
|
||||||
|
|
||||||
"@typescript-eslint/visitor-keys@5.34.0":
|
"@typescript-eslint/visitor-keys@5.36.1":
|
||||||
version "5.34.0"
|
version "5.36.1"
|
||||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.34.0.tgz#d0fb3e31033e82ddd5de048371ad39eb342b2d40"
|
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.36.1.tgz#7731175312d65738e501780f923896d200ad1615"
|
||||||
integrity sha512-O1moYjOSrab0a2fUvFpsJe0QHtvTC+cR+ovYpgKrAVXzqQyc74mv76TgY6z+aEtjQE2vgZux3CQVtGryqdcOAw==
|
integrity sha512-ojB9aRyRFzVMN3b5joSYni6FAS10BBSCAfKJhjJAV08t/a95aM6tAhz+O1jF+EtgxktuSO3wJysp2R+Def/IWQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/types" "5.34.0"
|
"@typescript-eslint/types" "5.36.1"
|
||||||
eslint-visitor-keys "^3.3.0"
|
eslint-visitor-keys "^3.3.0"
|
||||||
|
|
||||||
"@vue/babel-helper-vue-jsx-merge-props@^1.2.1":
|
"@vue/babel-helper-vue-jsx-merge-props@^1.4.0":
|
||||||
version "1.2.1"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.2.1.tgz#31624a7a505fb14da1d58023725a4c5f270e6a81"
|
resolved "https://registry.yarnpkg.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.4.0.tgz#8d53a1e21347db8edbe54d339902583176de09f2"
|
||||||
integrity sha512-QOi5OW45e2R20VygMSNhyQHvpdUwQZqGPc748JLGCYEy+yp8fNFNdbNIGAgZmi9e+2JHPd6i6idRuqivyicIkA==
|
integrity sha512-JkqXfCkUDp4PIlFdDQ0TdXoIejMtTHP67/pvxlgeY+u5k3LEdKuWZ3LK6xkxo52uDoABIVyRwqVkfLQJhk7VBA==
|
||||||
|
|
||||||
"@vue/babel-helper-vue-transform-on@^1.0.2":
|
"@vue/babel-helper-vue-transform-on@^1.0.2":
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
@ -1427,14 +1428,14 @@
|
|||||||
html-tags "^3.1.0"
|
html-tags "^3.1.0"
|
||||||
svg-tags "^1.0.0"
|
svg-tags "^1.0.0"
|
||||||
|
|
||||||
"@vue/babel-plugin-transform-vue-jsx@^1.2.1":
|
"@vue/babel-plugin-transform-vue-jsx@^1.4.0":
|
||||||
version "1.2.1"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.2.1.tgz#646046c652c2f0242727f34519d917b064041ed7"
|
resolved "https://registry.yarnpkg.com/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.4.0.tgz#4d4b3d46a39ea62b7467dd6e26ce47f7ceafb2fe"
|
||||||
integrity sha512-HJuqwACYehQwh1fNT8f4kyzqlNMpBuUK4rSiSES5D4QsYncv5fxFsLyrxFPG2ksO7t5WP+Vgix6tt6yKClwPzA==
|
integrity sha512-Fmastxw4MMx0vlgLS4XBX0XiBbUFzoMGeVXuMV08wyOfXdikAFqBTuYPR0tlk+XskL19EzHc39SgjrPGY23JnA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/helper-module-imports" "^7.0.0"
|
"@babel/helper-module-imports" "^7.0.0"
|
||||||
"@babel/plugin-syntax-jsx" "^7.2.0"
|
"@babel/plugin-syntax-jsx" "^7.2.0"
|
||||||
"@vue/babel-helper-vue-jsx-merge-props" "^1.2.1"
|
"@vue/babel-helper-vue-jsx-merge-props" "^1.4.0"
|
||||||
html-tags "^2.0.0"
|
html-tags "^2.0.0"
|
||||||
lodash.kebabcase "^4.1.1"
|
lodash.kebabcase "^4.1.1"
|
||||||
svg-tags "^1.0.0"
|
svg-tags "^1.0.0"
|
||||||
@ -1462,66 +1463,66 @@
|
|||||||
semver "^7.3.4"
|
semver "^7.3.4"
|
||||||
|
|
||||||
"@vue/babel-preset-jsx@^1.1.2":
|
"@vue/babel-preset-jsx@^1.1.2":
|
||||||
version "1.3.1"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/babel-preset-jsx/-/babel-preset-jsx-1.3.1.tgz#10789417a17680d9855bd96fd9894d9b51fd979b"
|
resolved "https://registry.yarnpkg.com/@vue/babel-preset-jsx/-/babel-preset-jsx-1.4.0.tgz#f4914ba314235ab097bc4372ed67473c0780bfcc"
|
||||||
integrity sha512-ml+nqcSKp8uAqFZLNc7OWLMzR7xDBsUfkomF98DtiIBlLqlq4jCQoLINARhgqRIyKdB+mk/94NWpIb4pL6D3xw==
|
integrity sha512-QmfRpssBOPZWL5xw7fOuHNifCQcNQC1PrOo/4fu6xlhlKJJKSA3HqX92Nvgyx8fqHZTUGMPHmFA+IDqwXlqkSA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@vue/babel-helper-vue-jsx-merge-props" "^1.2.1"
|
"@vue/babel-helper-vue-jsx-merge-props" "^1.4.0"
|
||||||
"@vue/babel-plugin-transform-vue-jsx" "^1.2.1"
|
"@vue/babel-plugin-transform-vue-jsx" "^1.4.0"
|
||||||
"@vue/babel-sugar-composition-api-inject-h" "^1.3.0"
|
"@vue/babel-sugar-composition-api-inject-h" "^1.4.0"
|
||||||
"@vue/babel-sugar-composition-api-render-instance" "^1.3.0"
|
"@vue/babel-sugar-composition-api-render-instance" "^1.4.0"
|
||||||
"@vue/babel-sugar-functional-vue" "^1.2.2"
|
"@vue/babel-sugar-functional-vue" "^1.4.0"
|
||||||
"@vue/babel-sugar-inject-h" "^1.2.2"
|
"@vue/babel-sugar-inject-h" "^1.4.0"
|
||||||
"@vue/babel-sugar-v-model" "^1.3.0"
|
"@vue/babel-sugar-v-model" "^1.4.0"
|
||||||
"@vue/babel-sugar-v-on" "^1.3.0"
|
"@vue/babel-sugar-v-on" "^1.4.0"
|
||||||
|
|
||||||
"@vue/babel-sugar-composition-api-inject-h@^1.3.0":
|
"@vue/babel-sugar-composition-api-inject-h@^1.4.0":
|
||||||
version "1.3.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-composition-api-inject-h/-/babel-sugar-composition-api-inject-h-1.3.0.tgz#1402f34cea217c7117fb66fdcbd94e1c370cd9c0"
|
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-composition-api-inject-h/-/babel-sugar-composition-api-inject-h-1.4.0.tgz#187e1389f8871d89ece743bb50aed713be9d6c85"
|
||||||
integrity sha512-pIDOutEpqbURdVw7xhgxmuDW8Tl+lTgzJZC5jdlUu0lY2+izT9kz3Umd/Tbu0U5cpCJ2Yhu87BZFBzWpS0Xemg==
|
integrity sha512-VQq6zEddJHctnG4w3TfmlVp5FzDavUSut/DwR0xVoe/mJKXyMcsIibL42wPntozITEoY90aBV0/1d2KjxHU52g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/plugin-syntax-jsx" "^7.2.0"
|
"@babel/plugin-syntax-jsx" "^7.2.0"
|
||||||
|
|
||||||
"@vue/babel-sugar-composition-api-render-instance@^1.3.0":
|
"@vue/babel-sugar-composition-api-render-instance@^1.4.0":
|
||||||
version "1.3.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-composition-api-render-instance/-/babel-sugar-composition-api-render-instance-1.3.0.tgz#3039d3d9eca09e56d41a56a03d73a146211c18a5"
|
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-composition-api-render-instance/-/babel-sugar-composition-api-render-instance-1.4.0.tgz#2c1607ae6dffdab47e785bc01fa45ba756e992c1"
|
||||||
integrity sha512-NYNnU2r7wkJLMV5p9Zj4pswmCs037O/N2+/Fs6SyX7aRFzXJRP1/2CZh5cIwQxWQajHXuCUd5mTb7DxoBVWyTg==
|
integrity sha512-6ZDAzcxvy7VcnCjNdHJ59mwK02ZFuP5CnucloidqlZwVQv5CQLijc3lGpR7MD3TWFi78J7+a8J56YxbCtHgT9Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/plugin-syntax-jsx" "^7.2.0"
|
"@babel/plugin-syntax-jsx" "^7.2.0"
|
||||||
|
|
||||||
"@vue/babel-sugar-functional-vue@^1.2.2":
|
"@vue/babel-sugar-functional-vue@^1.4.0":
|
||||||
version "1.2.2"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.2.2.tgz#267a9ac8d787c96edbf03ce3f392c49da9bd2658"
|
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.4.0.tgz#60da31068567082287c7337c66ef4df04e0a1029"
|
||||||
integrity sha512-JvbgGn1bjCLByIAU1VOoepHQ1vFsroSA/QkzdiSs657V79q6OwEWLCQtQnEXD/rLTA8rRit4rMOhFpbjRFm82w==
|
integrity sha512-lTEB4WUFNzYt2In6JsoF9sAYVTo84wC4e+PoZWSgM6FUtqRJz7wMylaEhSRgG71YF+wfLD6cc9nqVeXN2rwBvw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/plugin-syntax-jsx" "^7.2.0"
|
"@babel/plugin-syntax-jsx" "^7.2.0"
|
||||||
|
|
||||||
"@vue/babel-sugar-inject-h@^1.2.2":
|
"@vue/babel-sugar-inject-h@^1.4.0":
|
||||||
version "1.2.2"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.2.2.tgz#d738d3c893367ec8491dcbb669b000919293e3aa"
|
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.4.0.tgz#bf39aa6631fb1d0399b1c49b4c59e1c8899b4363"
|
||||||
integrity sha512-y8vTo00oRkzQTgufeotjCLPAvlhnpSkcHFEp60+LJUwygGcd5Chrpn5480AQp/thrxVm8m2ifAk0LyFel9oCnw==
|
integrity sha512-muwWrPKli77uO2fFM7eA3G1lAGnERuSz2NgAxuOLzrsTlQl8W4G+wwbM4nB6iewlKbwKRae3nL03UaF5ffAPMA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/plugin-syntax-jsx" "^7.2.0"
|
"@babel/plugin-syntax-jsx" "^7.2.0"
|
||||||
|
|
||||||
"@vue/babel-sugar-v-model@^1.3.0":
|
"@vue/babel-sugar-v-model@^1.4.0":
|
||||||
version "1.3.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.3.0.tgz#e4da7ae27a74c473b1abba060260ecaa8cb6e46b"
|
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.4.0.tgz#a51d986609f430c4f70ada3a93cc560a2970f720"
|
||||||
integrity sha512-zcsabmdX48JmxTObn3xmrvvdbEy8oo63DphVyA3WRYGp4SEvJRpu/IvZCVPl/dXLuob2xO/QRuncqPgHvZPzpA==
|
integrity sha512-0t4HGgXb7WHYLBciZzN5s0Hzqan4Ue+p/3FdQdcaHAb7s5D9WZFGoSxEZHrR1TFVZlAPu1bejTKGeAzaaG3NCQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/plugin-syntax-jsx" "^7.2.0"
|
"@babel/plugin-syntax-jsx" "^7.2.0"
|
||||||
"@vue/babel-helper-vue-jsx-merge-props" "^1.2.1"
|
"@vue/babel-helper-vue-jsx-merge-props" "^1.4.0"
|
||||||
"@vue/babel-plugin-transform-vue-jsx" "^1.2.1"
|
"@vue/babel-plugin-transform-vue-jsx" "^1.4.0"
|
||||||
camelcase "^5.0.0"
|
camelcase "^5.0.0"
|
||||||
html-tags "^2.0.0"
|
html-tags "^2.0.0"
|
||||||
svg-tags "^1.0.0"
|
svg-tags "^1.0.0"
|
||||||
|
|
||||||
"@vue/babel-sugar-v-on@^1.3.0":
|
"@vue/babel-sugar-v-on@^1.4.0":
|
||||||
version "1.3.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.3.0.tgz#d35756f8720e527a3b1867e21c3c248cde47ca87"
|
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.4.0.tgz#43b7106a9672d8cbeefc0eb8afe1d376edc6166e"
|
||||||
integrity sha512-8VZgrS0G5bh7+Prj7oJkzg9GvhSPnuW5YT6MNaVAEy4uwxRLJ8GqHenaStfllChTao4XZ3EZkNtHB4Xbr/ePdA==
|
integrity sha512-m+zud4wKLzSKgQrWwhqRObWzmTuyzl6vOP7024lrpeJM4x2UhQtRDLgYjXAw9xBXjCwS0pP9kXjg91F9ZNo9JA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/plugin-syntax-jsx" "^7.2.0"
|
"@babel/plugin-syntax-jsx" "^7.2.0"
|
||||||
"@vue/babel-plugin-transform-vue-jsx" "^1.2.1"
|
"@vue/babel-plugin-transform-vue-jsx" "^1.4.0"
|
||||||
camelcase "^5.0.0"
|
camelcase "^5.0.0"
|
||||||
|
|
||||||
"@vue/cli-overlay@^5.0.8":
|
"@vue/cli-overlay@^5.0.8":
|
||||||
@ -1658,47 +1659,47 @@
|
|||||||
semver "^7.3.4"
|
semver "^7.3.4"
|
||||||
strip-ansi "^6.0.0"
|
strip-ansi "^6.0.0"
|
||||||
|
|
||||||
"@vue/compiler-core@3.2.37":
|
"@vue/compiler-core@3.2.38":
|
||||||
version "3.2.37"
|
version "3.2.38"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.37.tgz#b3c42e04c0e0f2c496ff1784e543fbefe91e215a"
|
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.38.tgz#0a2a7bffd2280ac19a96baf5301838a2cf1964d7"
|
||||||
integrity sha512-81KhEjo7YAOh0vQJoSmAD68wLfYqJvoiD4ulyedzF+OEk/bk6/hx3fTNVfuzugIIaTrOx4PGx6pAiBRe5e9Zmg==
|
integrity sha512-/FsvnSu7Z+lkd/8KXMa4yYNUiqQrI22135gfsQYVGuh5tqEgOB0XqrUdb/KnCLa5+TmQLPwvyUnKMyCpu+SX3Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/parser" "^7.16.4"
|
"@babel/parser" "^7.16.4"
|
||||||
"@vue/shared" "3.2.37"
|
"@vue/shared" "3.2.38"
|
||||||
estree-walker "^2.0.2"
|
estree-walker "^2.0.2"
|
||||||
source-map "^0.6.1"
|
source-map "^0.6.1"
|
||||||
|
|
||||||
"@vue/compiler-dom@3.2.37":
|
"@vue/compiler-dom@3.2.38":
|
||||||
version "3.2.37"
|
version "3.2.38"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.37.tgz#10d2427a789e7c707c872da9d678c82a0c6582b5"
|
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.38.tgz#53d04ed0c0c62d1ef259bf82f9b28100a880b6fd"
|
||||||
integrity sha512-yxJLH167fucHKxaqXpYk7x8z7mMEnXOw3G2q62FTkmsvNxu4FQSu5+3UMb+L7fjKa26DEzhrmCxAgFLLIzVfqQ==
|
integrity sha512-zqX4FgUbw56kzHlgYuEEJR8mefFiiyR3u96498+zWPsLeh1WKvgIReoNE+U7gG8bCUdvsrJ0JRmev0Ky6n2O0g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@vue/compiler-core" "3.2.37"
|
"@vue/compiler-core" "3.2.38"
|
||||||
"@vue/shared" "3.2.37"
|
"@vue/shared" "3.2.38"
|
||||||
|
|
||||||
"@vue/compiler-sfc@3.2.37":
|
"@vue/compiler-sfc@3.2.38":
|
||||||
version "3.2.37"
|
version "3.2.38"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.37.tgz#3103af3da2f40286edcd85ea495dcb35bc7f5ff4"
|
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.38.tgz#9e763019471a535eb1fceeaac9d4d18a83f0940f"
|
||||||
integrity sha512-+7i/2+9LYlpqDv+KTtWhOZH+pa8/HnX/905MdVmAcI/mPQOBwkHHIzrsEsucyOIZQYMkXUiTkmZq5am/NyXKkg==
|
integrity sha512-KZjrW32KloMYtTcHAFuw3CqsyWc5X6seb8KbkANSWt3Cz9p2qA8c1GJpSkksFP9ABb6an0FLCFl46ZFXx3kKpg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/parser" "^7.16.4"
|
"@babel/parser" "^7.16.4"
|
||||||
"@vue/compiler-core" "3.2.37"
|
"@vue/compiler-core" "3.2.38"
|
||||||
"@vue/compiler-dom" "3.2.37"
|
"@vue/compiler-dom" "3.2.38"
|
||||||
"@vue/compiler-ssr" "3.2.37"
|
"@vue/compiler-ssr" "3.2.38"
|
||||||
"@vue/reactivity-transform" "3.2.37"
|
"@vue/reactivity-transform" "3.2.38"
|
||||||
"@vue/shared" "3.2.37"
|
"@vue/shared" "3.2.38"
|
||||||
estree-walker "^2.0.2"
|
estree-walker "^2.0.2"
|
||||||
magic-string "^0.25.7"
|
magic-string "^0.25.7"
|
||||||
postcss "^8.1.10"
|
postcss "^8.1.10"
|
||||||
source-map "^0.6.1"
|
source-map "^0.6.1"
|
||||||
|
|
||||||
"@vue/compiler-ssr@3.2.37":
|
"@vue/compiler-ssr@3.2.38":
|
||||||
version "3.2.37"
|
version "3.2.38"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.37.tgz#4899d19f3a5fafd61524a9d1aee8eb0505313cff"
|
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.38.tgz#933b23bf99e667e5078eefc6ba94cb95fd765dfe"
|
||||||
integrity sha512-7mQJD7HdXxQjktmsWp/J67lThEIcxLemz1Vb5I6rYJHR5vI+lON3nPGOH3ubmbvYGt8xEUaAr1j7/tIFWiEOqw==
|
integrity sha512-bm9jOeyv1H3UskNm4S6IfueKjUNFmi2kRweFIGnqaGkkRePjwEcfCVqyS3roe7HvF4ugsEkhf4+kIvDhip6XzQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@vue/compiler-dom" "3.2.37"
|
"@vue/compiler-dom" "3.2.38"
|
||||||
"@vue/shared" "3.2.37"
|
"@vue/shared" "3.2.38"
|
||||||
|
|
||||||
"@vue/component-compiler-utils@^3.1.0", "@vue/component-compiler-utils@^3.3.0":
|
"@vue/component-compiler-utils@^3.1.0", "@vue/component-compiler-utils@^3.3.0":
|
||||||
version "3.3.0"
|
version "3.3.0"
|
||||||
@ -1728,53 +1729,53 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
vue-eslint-parser "^8.0.0"
|
vue-eslint-parser "^8.0.0"
|
||||||
|
|
||||||
"@vue/reactivity-transform@3.2.37":
|
"@vue/reactivity-transform@3.2.38":
|
||||||
version "3.2.37"
|
version "3.2.38"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.2.37.tgz#0caa47c4344df4ae59f5a05dde2a8758829f8eca"
|
resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.2.38.tgz#a856c217b2ead99eefb6fddb1d61119b2cb67984"
|
||||||
integrity sha512-IWopkKEb+8qpu/1eMKVeXrK0NLw9HicGviJzhJDEyfxTR9e1WtpnnbYkJWurX6WwoFP0sz10xQg8yL8lgskAZg==
|
integrity sha512-3SD3Jmi1yXrDwiNJqQ6fs1x61WsDLqVk4NyKVz78mkaIRh6d3IqtRnptgRfXn+Fzf+m6B1KxBYWq1APj6h4qeA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/parser" "^7.16.4"
|
"@babel/parser" "^7.16.4"
|
||||||
"@vue/compiler-core" "3.2.37"
|
"@vue/compiler-core" "3.2.38"
|
||||||
"@vue/shared" "3.2.37"
|
"@vue/shared" "3.2.38"
|
||||||
estree-walker "^2.0.2"
|
estree-walker "^2.0.2"
|
||||||
magic-string "^0.25.7"
|
magic-string "^0.25.7"
|
||||||
|
|
||||||
"@vue/reactivity@3.2.37":
|
"@vue/reactivity@3.2.38":
|
||||||
version "3.2.37"
|
version "3.2.38"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.2.37.tgz#5bc3847ac58828e2b78526e08219e0a1089f8848"
|
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.2.38.tgz#d576fdcea98eefb96a1f1ad456e289263e87292e"
|
||||||
integrity sha512-/7WRafBOshOc6m3F7plwzPeCu/RCVv9uMpOwa/5PiY1Zz+WLVRWiy0MYKwmg19KBdGtFWsmZ4cD+LOdVPcs52A==
|
integrity sha512-6L4myYcH9HG2M25co7/BSo0skKFHpAN8PhkNPM4xRVkyGl1K5M3Jx4rp5bsYhvYze2K4+l+pioN4e6ZwFLUVtw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@vue/shared" "3.2.37"
|
"@vue/shared" "3.2.38"
|
||||||
|
|
||||||
"@vue/runtime-core@3.2.37":
|
"@vue/runtime-core@3.2.38":
|
||||||
version "3.2.37"
|
version "3.2.38"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.2.37.tgz#7ba7c54bb56e5d70edfc2f05766e1ca8519966e3"
|
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.2.38.tgz#d19cf591c210713f80e6a94ffbfef307c27aea06"
|
||||||
integrity sha512-JPcd9kFyEdXLl/i0ClS7lwgcs0QpUAWj+SKX2ZC3ANKi1U4DOtiEr6cRqFXsPwY5u1L9fAjkinIdB8Rz3FoYNQ==
|
integrity sha512-kk0qiSiXUU/IKxZw31824rxmFzrLr3TL6ZcbrxWTKivadoKupdlzbQM4SlGo4MU6Zzrqv4fzyUasTU1jDoEnzg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@vue/reactivity" "3.2.37"
|
"@vue/reactivity" "3.2.38"
|
||||||
"@vue/shared" "3.2.37"
|
"@vue/shared" "3.2.38"
|
||||||
|
|
||||||
"@vue/runtime-dom@3.2.37":
|
"@vue/runtime-dom@3.2.38":
|
||||||
version "3.2.37"
|
version "3.2.38"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.2.37.tgz#002bdc8228fa63949317756fb1e92cdd3f9f4bbd"
|
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.2.38.tgz#fec711f65c2485991289fd4798780aa506469b48"
|
||||||
integrity sha512-HimKdh9BepShW6YozwRKAYjYQWg9mQn63RGEiSswMbW+ssIht1MILYlVGkAGGQbkhSh31PCdoUcfiu4apXJoPw==
|
integrity sha512-4PKAb/ck2TjxdMSzMsnHViOrrwpudk4/A56uZjhzvusoEU9xqa5dygksbzYepdZeB5NqtRw5fRhWIiQlRVK45A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@vue/runtime-core" "3.2.37"
|
"@vue/runtime-core" "3.2.38"
|
||||||
"@vue/shared" "3.2.37"
|
"@vue/shared" "3.2.38"
|
||||||
csstype "^2.6.8"
|
csstype "^2.6.8"
|
||||||
|
|
||||||
"@vue/server-renderer@3.2.37":
|
"@vue/server-renderer@3.2.38":
|
||||||
version "3.2.37"
|
version "3.2.38"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.2.37.tgz#840a29c8dcc29bddd9b5f5ffa22b95c0e72afdfc"
|
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.2.38.tgz#01a4c0f218e90b8ad1815074208a1974ded109aa"
|
||||||
integrity sha512-kLITEJvaYgZQ2h47hIzPh2K3jG8c1zCVbp/o/bzQOyvzaKiCquKS7AaioPI28GNxIsE/zSx+EwWYsNxDCX95MA==
|
integrity sha512-pg+JanpbOZ5kEfOZzO2bt02YHd+ELhYP8zPeLU1H0e7lg079NtuuSB8fjLdn58c4Ou8UQ6C1/P+528nXnLPAhA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@vue/compiler-ssr" "3.2.37"
|
"@vue/compiler-ssr" "3.2.38"
|
||||||
"@vue/shared" "3.2.37"
|
"@vue/shared" "3.2.38"
|
||||||
|
|
||||||
"@vue/shared@3.2.37":
|
"@vue/shared@3.2.38":
|
||||||
version "3.2.37"
|
version "3.2.38"
|
||||||
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.37.tgz#8e6adc3f2759af52f0e85863dfb0b711ecc5c702"
|
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.38.tgz#e823f0cb2e85b6bf43430c0d6811b1441c300f3c"
|
||||||
integrity sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw==
|
integrity sha512-dTyhTIRmGXBjxJE+skC8tTWCGLCVc4wQgRRLt8+O9p5ewBAjoBwtCAkLPrtToSr1xltoe3st21Pv953aOZ7alg==
|
||||||
|
|
||||||
"@vue/vue-loader-v15@npm:vue-loader@^15.9.7":
|
"@vue/vue-loader-v15@npm:vue-loader@^15.9.7":
|
||||||
version "15.10.0"
|
version "15.10.0"
|
||||||
@ -2334,9 +2335,9 @@ caniuse-api@^3.0.0:
|
|||||||
lodash.uniq "^4.5.0"
|
lodash.uniq "^4.5.0"
|
||||||
|
|
||||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001370, caniuse-lite@^1.0.30001373:
|
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001370, caniuse-lite@^1.0.30001373:
|
||||||
version "1.0.30001382"
|
version "1.0.30001385"
|
||||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001382.tgz#4d37f0d0b6fffb826c8e5e1c0f4bf8ce592db949"
|
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001385.tgz#51d5feeb60b831a5b4c7177f419732060418535c"
|
||||||
integrity sha512-2rtJwDmSZ716Pxm1wCtbPvHtbDWAreTPxXbkc5RkKglow3Ig/4GNGazDI9/BVnXbG/wnv6r3B5FEbkfg9OcTGg==
|
integrity sha512-MpiCqJGhBkHgpyimE9GWmZTnyHyEEM35u115bD3QBrXpjvL/JgcP8cUhKJshfmg4OtEHFenifcK5sZayEw5tvQ==
|
||||||
|
|
||||||
case-sensitive-paths-webpack-plugin@^2.3.0:
|
case-sensitive-paths-webpack-plugin@^2.3.0:
|
||||||
version "2.4.0"
|
version "2.4.0"
|
||||||
@ -2616,17 +2617,17 @@ copy-webpack-plugin@^9.0.1:
|
|||||||
serialize-javascript "^6.0.0"
|
serialize-javascript "^6.0.0"
|
||||||
|
|
||||||
core-js-compat@^3.21.0, core-js-compat@^3.22.1, core-js-compat@^3.8.3:
|
core-js-compat@^3.21.0, core-js-compat@^3.22.1, core-js-compat@^3.8.3:
|
||||||
version "3.24.1"
|
version "3.25.0"
|
||||||
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.24.1.tgz#d1af84a17e18dfdd401ee39da9996f9a7ba887de"
|
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.25.0.tgz#489affbfbf9cb3fa56192fe2dd9ebaee985a66c5"
|
||||||
integrity sha512-XhdNAGeRnTpp8xbD+sR/HFDK9CbeeeqXT6TuofXh3urqEevzkWmLRgrVoykodsw8okqo2pu1BOmuCKrHx63zdw==
|
integrity sha512-extKQM0g8/3GjFx9US12FAgx8KJawB7RCQ5y8ipYLbmfzEzmFRWdDjIlxDx82g7ygcNG85qMVUSRyABouELdow==
|
||||||
dependencies:
|
dependencies:
|
||||||
browserslist "^4.21.3"
|
browserslist "^4.21.3"
|
||||||
semver "7.0.0"
|
semver "7.0.0"
|
||||||
|
|
||||||
core-js@^3.8.3:
|
core-js@^3.8.3:
|
||||||
version "3.24.1"
|
version "3.25.0"
|
||||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.24.1.tgz#cf7724d41724154010a6576b7b57d94c5d66e64f"
|
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.25.0.tgz#be71d9e0dd648ffd70c44a7ec2319d039357eceb"
|
||||||
integrity sha512-0QTBSYSUZ6Gq21utGzkfITDylE8jWC9Ne1D2MrhvlsZBI1x39OdDIVbzSqtgMndIy6BlHxBXpMGqzZmnztg2rg==
|
integrity sha512-CVU1xvJEfJGhyCpBrzzzU1kjCfgsGUxhEvwUV2e/cOedYWHdmluamx+knDnmhqALddMG16fZvIqvs9aijsHHaA==
|
||||||
|
|
||||||
core-util-is@~1.0.0:
|
core-util-is@~1.0.0:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
@ -3014,9 +3015,9 @@ ee-first@1.1.1:
|
|||||||
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==
|
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==
|
||||||
|
|
||||||
electron-to-chromium@^1.4.202:
|
electron-to-chromium@^1.4.202:
|
||||||
version "1.4.226"
|
version "1.4.235"
|
||||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.226.tgz#837ea1d19b8305a913cd5f31d135681c4b6d63b1"
|
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.235.tgz#48ac33c4e869a1795013788099470061463d1890"
|
||||||
integrity sha512-CvevLaSiUp0u12K0e+QhMX1hn724nSUNO9ToBek+FMHk/5RofrQs5MChjrD0re0IwqxDFxFMSZD+uic05i2Z5w==
|
integrity sha512-eNU2SmVZYTzYVA5aAWmhAJbdVil5/8H5nMq6kGD0Yxd4k2uKIuT8YmS46I0QXY7iOoPPcb6jjem9/2xyuH5+XQ==
|
||||||
|
|
||||||
emoji-regex@^8.0.0:
|
emoji-regex@^8.0.0:
|
||||||
version "8.0.0"
|
version "8.0.0"
|
||||||
@ -3273,9 +3274,9 @@ espree@^7.3.0, espree@^7.3.1:
|
|||||||
eslint-visitor-keys "^1.3.0"
|
eslint-visitor-keys "^1.3.0"
|
||||||
|
|
||||||
espree@^9.0.0:
|
espree@^9.0.0:
|
||||||
version "9.3.3"
|
version "9.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.3.tgz#2dd37c4162bb05f433ad3c1a52ddf8a49dc08e9d"
|
resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.0.tgz#cd4bc3d6e9336c433265fc0aa016fc1aaf182f8a"
|
||||||
integrity sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==
|
integrity sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==
|
||||||
dependencies:
|
dependencies:
|
||||||
acorn "^8.8.0"
|
acorn "^8.8.0"
|
||||||
acorn-jsx "^5.3.2"
|
acorn-jsx "^5.3.2"
|
||||||
@ -4700,9 +4701,9 @@ mz@^2.4.0:
|
|||||||
thenify-all "^1.0.0"
|
thenify-all "^1.0.0"
|
||||||
|
|
||||||
naive-ui@^2.32.1:
|
naive-ui@^2.32.1:
|
||||||
version "2.32.2"
|
version "2.33.1"
|
||||||
resolved "https://registry.yarnpkg.com/naive-ui/-/naive-ui-2.32.2.tgz#40f593df0b86b36f6af5635d9299417d45d6d96a"
|
resolved "https://registry.yarnpkg.com/naive-ui/-/naive-ui-2.33.1.tgz#ef1046b727145e868c4be32686fd6073219f07ac"
|
||||||
integrity sha512-vTNuZ8LBlfo/cdiv4S8o6Cg5g7p9V9cR5rK+Fag2cplOnng5twTILD3sBaCqw3k/BV1331Xdk26ml8Me8QJ7iA==
|
integrity sha512-S8iS5TsnJ5PAbUCCC+IGjW7H6fYJF5s0HTzuUjqRLS8C1tFxmWhKkBZU1db/vg/4O5GKEyjaoq4ZSzRHOwRTcQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@css-render/plugin-bem" "^0.15.10"
|
"@css-render/plugin-bem" "^0.15.10"
|
||||||
"@css-render/vue3-ssr" "^0.15.10"
|
"@css-render/vue3-ssr" "^0.15.10"
|
||||||
@ -5667,9 +5668,9 @@ sass-loader@^12.0.0:
|
|||||||
neo-async "^2.6.2"
|
neo-async "^2.6.2"
|
||||||
|
|
||||||
sass@^1.32.7:
|
sass@^1.32.7:
|
||||||
version "1.54.5"
|
version "1.54.6"
|
||||||
resolved "https://registry.yarnpkg.com/sass/-/sass-1.54.5.tgz#93708f5560784f6ff2eab8542ade021a4a947b3a"
|
resolved "https://registry.yarnpkg.com/sass/-/sass-1.54.6.tgz#5a12c268db26555c335028e355d6b7b1a5b9b4c8"
|
||||||
integrity sha512-p7DTOzxkUPa/63FU0R3KApkRHwcVZYC0PLnLm5iyZACyp15qSi32x7zVUhRdABAATmkALqgGrjCJAcWvobmhHw==
|
integrity sha512-DUqJjR2WxXBcZjRSZX5gCVyU+9fuC2qDfFzoKX9rV4rCOcec5mPtEafTcfsyL3YJuLONjWylBne+uXVh5rrmFw==
|
||||||
dependencies:
|
dependencies:
|
||||||
chokidar ">=3.0.0 <4.0.0"
|
chokidar ">=3.0.0 <4.0.0"
|
||||||
immutable "^4.0.0"
|
immutable "^4.0.0"
|
||||||
@ -6161,9 +6162,9 @@ tapable@^2.0.0, tapable@^2.1.1, tapable@^2.2.0:
|
|||||||
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==
|
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==
|
||||||
|
|
||||||
terser-webpack-plugin@^5.1.1, terser-webpack-plugin@^5.1.3:
|
terser-webpack-plugin@^5.1.1, terser-webpack-plugin@^5.1.3:
|
||||||
version "5.3.5"
|
version "5.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.5.tgz#f7d82286031f915a4f8fb81af4bd35d2e3c011bc"
|
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz#5590aec31aa3c6f771ce1b1acca60639eab3195c"
|
||||||
integrity sha512-AOEDLDxD2zylUGf/wxHxklEkOe2/r+seuyOWujejFrIxHf11brA1/dWQNIgXa1c6/Wkxgu7zvv0JhOWfc2ELEA==
|
integrity sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@jridgewell/trace-mapping" "^0.3.14"
|
"@jridgewell/trace-mapping" "^0.3.14"
|
||||||
jest-worker "^27.4.5"
|
jest-worker "^27.4.5"
|
||||||
@ -6172,9 +6173,9 @@ terser-webpack-plugin@^5.1.1, terser-webpack-plugin@^5.1.3:
|
|||||||
terser "^5.14.1"
|
terser "^5.14.1"
|
||||||
|
|
||||||
terser@^5.10.0, terser@^5.14.1:
|
terser@^5.10.0, terser@^5.14.1:
|
||||||
version "5.14.2"
|
version "5.15.0"
|
||||||
resolved "https://registry.yarnpkg.com/terser/-/terser-5.14.2.tgz#9ac9f22b06994d736174f4091aa368db896f1c10"
|
resolved "https://registry.yarnpkg.com/terser/-/terser-5.15.0.tgz#e16967894eeba6e1091509ec83f0c60e179f2425"
|
||||||
integrity sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==
|
integrity sha512-L1BJiXVmheAQQy+as0oF3Pwtlo4s3Wi1X2zNZ2NxOB4wx9bdS9Vk67XQENLFdLYGCK/Z2di53mTj/hBafR+dTA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@jridgewell/source-map" "^0.3.2"
|
"@jridgewell/source-map" "^0.3.2"
|
||||||
acorn "^8.5.0"
|
acorn "^8.5.0"
|
||||||
@ -6470,9 +6471,9 @@ vue-loader@^17.0.0:
|
|||||||
loader-utils "^2.0.0"
|
loader-utils "^2.0.0"
|
||||||
|
|
||||||
vue-router@^4.0.3:
|
vue-router@^4.0.3:
|
||||||
version "4.1.4"
|
version "4.1.5"
|
||||||
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.1.4.tgz#290540caaf2c54e37a14dec047bd074002eca175"
|
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.1.5.tgz#256f597e3f5a281a23352a6193aa6e342c8d9f9a"
|
||||||
integrity sha512-UgYen33gOtwT3cOG1+yRen+Brk9py8CSlC9LEa3UjvKZ4EAoSo8NjZPDeDnmNerfazorHIJG1NC7qdi1SuQJnQ==
|
integrity sha512-IsvoF5D2GQ/EGTs/Th4NQms9gd2NSqV+yylxIyp/OYp8xOwxmU8Kj/74E9DTSYAyH5LX7idVUngN3JSj1X4xcQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@vue/devtools-api" "^6.1.4"
|
"@vue/devtools-api" "^6.1.4"
|
||||||
|
|
||||||
@ -6490,15 +6491,15 @@ vue-template-es2015-compiler@^1.9.0:
|
|||||||
integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==
|
integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==
|
||||||
|
|
||||||
vue@^3.2.13:
|
vue@^3.2.13:
|
||||||
version "3.2.37"
|
version "3.2.38"
|
||||||
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.37.tgz#da220ccb618d78579d25b06c7c21498ca4e5452e"
|
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.38.tgz#cda3a414631745b194971219318a792dbbccdec0"
|
||||||
integrity sha512-bOKEZxrm8Eh+fveCqS1/NkG/n6aMidsI6hahas7pa0w/l7jkbssJVsRhVDs07IdDq7h9KHswZOgItnwJAgtVtQ==
|
integrity sha512-hHrScEFSmDAWL0cwO4B6WO7D3sALZPbfuThDsGBebthrNlDxdJZpGR3WB87VbjpPh96mep1+KzukYEhpHDFa8Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@vue/compiler-dom" "3.2.37"
|
"@vue/compiler-dom" "3.2.38"
|
||||||
"@vue/compiler-sfc" "3.2.37"
|
"@vue/compiler-sfc" "3.2.38"
|
||||||
"@vue/runtime-dom" "3.2.37"
|
"@vue/runtime-dom" "3.2.38"
|
||||||
"@vue/server-renderer" "3.2.37"
|
"@vue/server-renderer" "3.2.38"
|
||||||
"@vue/shared" "3.2.37"
|
"@vue/shared" "3.2.38"
|
||||||
|
|
||||||
vueuc@^0.4.47:
|
vueuc@^0.4.47:
|
||||||
version "0.4.48"
|
version "0.4.48"
|
||||||
@ -6575,9 +6576,9 @@ webpack-dev-middleware@^5.3.1:
|
|||||||
schema-utils "^4.0.0"
|
schema-utils "^4.0.0"
|
||||||
|
|
||||||
webpack-dev-server@^4.7.3:
|
webpack-dev-server@^4.7.3:
|
||||||
version "4.10.0"
|
version "4.10.1"
|
||||||
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.10.0.tgz#de270d0009eba050546912be90116e7fd740a9ca"
|
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.10.1.tgz#124ac9ac261e75303d74d95ab6712b4aec3e12ed"
|
||||||
integrity sha512-7dezwAs+k6yXVFZ+MaL8VnE+APobiO3zvpp3rBHe/HmWQ+avwh0Q3d0xxacOiBybZZ3syTZw9HXzpa3YNbAZDQ==
|
integrity sha512-FIzMq3jbBarz3ld9l7rbM7m6Rj1lOsgq/DyLGMX/fPEB1UBUPtf5iL/4eNfhx8YYJTRlzfv107UfWSWcBK5Odw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/bonjour" "^3.5.9"
|
"@types/bonjour" "^3.5.9"
|
||||||
"@types/connect-history-api-fallback" "^1.3.5"
|
"@types/connect-history-api-fallback" "^1.3.5"
|
||||||
|
Loading…
Reference in New Issue
Block a user