generated from VLADIMIR/template_frontend
linters
This commit is contained in:
+37
-3
@@ -1,7 +1,9 @@
|
||||
import { globalIgnores } from 'eslint/config'
|
||||
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
|
||||
import pluginVue from 'eslint-plugin-vue'
|
||||
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
|
||||
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
|
||||
import { globalIgnores } from 'eslint/config'
|
||||
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
||||
import unusedImports from 'eslint-plugin-unused-imports';
|
||||
import pluginVue from 'eslint-plugin-vue'
|
||||
|
||||
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
|
||||
// import { configureVueProject } from '@vue/eslint-config-typescript'
|
||||
@@ -19,4 +21,36 @@ export default defineConfigWithVueTs(
|
||||
pluginVue.configs['flat/essential'],
|
||||
vueTsConfigs.recommended,
|
||||
skipFormatting,
|
||||
{
|
||||
plugins: {
|
||||
'simple-import-sort': simpleImportSort,
|
||||
},
|
||||
rules: {
|
||||
// Основные правила сортировки
|
||||
'simple-import-sort/imports': 'error',
|
||||
'simple-import-sort/exports': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
'unused-imports': unusedImports,
|
||||
},
|
||||
rules: {
|
||||
// Отключаем стандартное правило
|
||||
'no-unused-vars': 'off',
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
|
||||
// Включаем правила плагина
|
||||
'unused-imports/no-unused-imports': 'error', // 🔧 автофикс
|
||||
'unused-imports/no-unused-vars': [
|
||||
'warn',
|
||||
{
|
||||
vars: 'all',
|
||||
varsIgnorePattern: '^_',
|
||||
args: 'after-used',
|
||||
argsIgnorePattern: '^_',
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
Generated
+28
@@ -30,6 +30,8 @@
|
||||
"@vue/eslint-config-typescript": "^14.9.0",
|
||||
"@vue/tsconfig": "^0.9.1",
|
||||
"eslint": "^10.6.0",
|
||||
"eslint-plugin-simple-import-sort": "^14.0.0",
|
||||
"eslint-plugin-unused-imports": "^4.4.1",
|
||||
"eslint-plugin-vue": "~10.9.2",
|
||||
"jiti": "^2.7.0",
|
||||
"naive-ui": "^2.44.1",
|
||||
@@ -2679,6 +2681,32 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-simple-import-sort": {
|
||||
"version": "14.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-14.0.0.tgz",
|
||||
"integrity": "sha512-NUJO0+XFCkk+o5EsAJruTgnfMEpeWrPWeJS15UVF60GgXmqz1BJ9/3hzlvG7lkL8Bubzos5cCLptThbFfPnSMQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"eslint": ">=5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-unused-imports": {
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.4.1.tgz",
|
||||
"integrity": "sha512-oZGYUz1X3sRMGUB+0cZyK2VcvRX5lm/vB56PgNNcU+7ficUCKm66oZWKUubXWnOuPjQ8PvmXtCViXBMONPe7tQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0",
|
||||
"eslint": "^10.0.0 || ^9.0.0 || ^8.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@typescript-eslint/eslint-plugin": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-vue": {
|
||||
"version": "10.9.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-10.9.2.tgz",
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
"@vue/eslint-config-typescript": "^14.9.0",
|
||||
"@vue/tsconfig": "^0.9.1",
|
||||
"eslint": "^10.6.0",
|
||||
"eslint-plugin-simple-import-sort": "^14.0.0",
|
||||
"eslint-plugin-unused-imports": "^4.4.1",
|
||||
"eslint-plugin-vue": "~10.9.2",
|
||||
"jiti": "^2.7.0",
|
||||
"naive-ui": "^2.44.1",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { RouterView } from 'vue-router'
|
||||
import { NConfigProvider, NMessageProvider } from 'naive-ui'
|
||||
import { darkTheme } from 'naive-ui'
|
||||
import { RouterView } from 'vue-router'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useAuthStore } from "@/stores/auth";
|
||||
|
||||
import { createEveningDetectiveServerClient, type EveningDetectiveServer } from "./generated/crabs/evening_detective_server";
|
||||
import { createHttpHandler } from "./generated/crabs/evening_detective_server/client";
|
||||
|
||||
@@ -30,7 +31,7 @@ function createAuthHttpHandler(
|
||||
) => {
|
||||
try {
|
||||
return await handler(request)
|
||||
} catch (error) {
|
||||
} catch {
|
||||
await refreshTokens()
|
||||
return await handler(request)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-typescript-http. DO NOT EDIT.
|
||||
/* eslint-disable camelcase */
|
||||
|
||||
// @ts-nocheck
|
||||
|
||||
export type PingReq = {
|
||||
@@ -285,8 +285,8 @@ export function createEveningDetectiveServerClient(
|
||||
handler: RequestHandler
|
||||
): EveningDetectiveServer {
|
||||
return {
|
||||
Ping(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/test/ping`; // eslint-disable-line quotes
|
||||
Ping(request) {
|
||||
const path = `api/test/ping`;
|
||||
const body = null;
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -302,8 +302,8 @@ export function createEveningDetectiveServerClient(
|
||||
method: "Ping",
|
||||
}) as Promise<PingRsp>;
|
||||
},
|
||||
Echo(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/test/echo`; // eslint-disable-line quotes
|
||||
Echo(request) {
|
||||
const path = `api/test/echo`;
|
||||
const body = null;
|
||||
const queryParams: string[] = [];
|
||||
if (request.text) {
|
||||
@@ -322,8 +322,8 @@ export function createEveningDetectiveServerClient(
|
||||
method: "Echo",
|
||||
}) as Promise<EchoRsp>;
|
||||
},
|
||||
Signup(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/auth/signup`; // eslint-disable-line quotes
|
||||
Signup(request) {
|
||||
const path = `api/auth/signup`;
|
||||
const body = JSON.stringify(request);
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -339,8 +339,8 @@ export function createEveningDetectiveServerClient(
|
||||
method: "Signup",
|
||||
}) as Promise<SignupRsp>;
|
||||
},
|
||||
RefreshPassword(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/auth/refresh-password`; // eslint-disable-line quotes
|
||||
RefreshPassword(request) {
|
||||
const path = `api/auth/refresh-password`;
|
||||
const body = JSON.stringify(request);
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -356,8 +356,8 @@ export function createEveningDetectiveServerClient(
|
||||
method: "RefreshPassword",
|
||||
}) as Promise<RefreshPasswordRsp>;
|
||||
},
|
||||
Login(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/auth/login`; // eslint-disable-line quotes
|
||||
Login(request) {
|
||||
const path = `api/auth/login`;
|
||||
const body = JSON.stringify(request);
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -373,8 +373,8 @@ export function createEveningDetectiveServerClient(
|
||||
method: "Login",
|
||||
}) as Promise<LoginRsp>;
|
||||
},
|
||||
Refresh(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/auth/refresh`; // eslint-disable-line quotes
|
||||
Refresh(request) {
|
||||
const path = `api/auth/refresh`;
|
||||
const body = JSON.stringify(request);
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -390,8 +390,8 @@ export function createEveningDetectiveServerClient(
|
||||
method: "Refresh",
|
||||
}) as Promise<RefreshRsp>;
|
||||
},
|
||||
GetUsers(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/users`; // eslint-disable-line quotes
|
||||
GetUsers(request) {
|
||||
const path = `api/users`;
|
||||
const body = null;
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -407,11 +407,11 @@ export function createEveningDetectiveServerClient(
|
||||
method: "GetUsers",
|
||||
}) as Promise<GetUsersRsp>;
|
||||
},
|
||||
GetUserById(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
GetUserById(request) {
|
||||
if (!request.id) {
|
||||
throw new Error("missing required field request.id");
|
||||
}
|
||||
const path = `api/users/${request.id}`; // eslint-disable-line quotes
|
||||
const path = `api/users/${request.id}`;
|
||||
const body = null;
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -427,8 +427,8 @@ export function createEveningDetectiveServerClient(
|
||||
method: "GetUserById",
|
||||
}) as Promise<GetUserByIdRsp>;
|
||||
},
|
||||
GetMe(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/users/me`; // eslint-disable-line quotes
|
||||
GetMe(request) {
|
||||
const path = `api/users/me`;
|
||||
const body = null;
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -444,11 +444,11 @@ export function createEveningDetectiveServerClient(
|
||||
method: "GetMe",
|
||||
}) as Promise<GetMeRsp>;
|
||||
},
|
||||
AddUserRole(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
AddUserRole(request) {
|
||||
if (!request.id) {
|
||||
throw new Error("missing required field request.id");
|
||||
}
|
||||
const path = `api/users/${request.id}/role/add`; // eslint-disable-line quotes
|
||||
const path = `api/users/${request.id}/role/add`;
|
||||
const body = JSON.stringify(request);
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -464,11 +464,11 @@ export function createEveningDetectiveServerClient(
|
||||
method: "AddUserRole",
|
||||
}) as Promise<AddUserRoleRsp>;
|
||||
},
|
||||
DeleteUserRole(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
DeleteUserRole(request) {
|
||||
if (!request.id) {
|
||||
throw new Error("missing required field request.id");
|
||||
}
|
||||
const path = `api/users/${request.id}/role/delete`; // eslint-disable-line quotes
|
||||
const path = `api/users/${request.id}/role/delete`;
|
||||
const body = JSON.stringify(request);
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -484,8 +484,8 @@ export function createEveningDetectiveServerClient(
|
||||
method: "DeleteUserRole",
|
||||
}) as Promise<DeleteUserRoleRsp>;
|
||||
},
|
||||
GetPermissions(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/ui/permissions`; // eslint-disable-line quotes
|
||||
GetPermissions(request) {
|
||||
const path = `api/ui/permissions`;
|
||||
const body = null;
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -501,8 +501,8 @@ export function createEveningDetectiveServerClient(
|
||||
method: "GetPermissions",
|
||||
}) as Promise<GetPermissionsRsp>;
|
||||
},
|
||||
UploadFile(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/files/upload`; // eslint-disable-line quotes
|
||||
UploadFile(request) {
|
||||
const path = `api/files/upload`;
|
||||
const body = JSON.stringify(request);
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -518,11 +518,11 @@ export function createEveningDetectiveServerClient(
|
||||
method: "UploadFile",
|
||||
}) as Promise<UploadFileRsp>;
|
||||
},
|
||||
DownloadFile(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
DownloadFile(request) {
|
||||
if (!request.filename) {
|
||||
throw new Error("missing required field request.filename");
|
||||
}
|
||||
const path = `api/files/${request.filename}`; // eslint-disable-line quotes
|
||||
const path = `api/files/${request.filename}`;
|
||||
const body = null;
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -538,8 +538,8 @@ export function createEveningDetectiveServerClient(
|
||||
method: "DownloadFile",
|
||||
}) as Promise<googleapi_HttpBody>;
|
||||
},
|
||||
AddScenario(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/scenario`; // eslint-disable-line quotes
|
||||
AddScenario(request) {
|
||||
const path = `api/scenario`;
|
||||
const body = JSON.stringify(request);
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -555,8 +555,8 @@ export function createEveningDetectiveServerClient(
|
||||
method: "AddScenario",
|
||||
}) as Promise<AddScenarioRsp>;
|
||||
},
|
||||
GetMyScenarios(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
const path = `api/my-scenarios`; // eslint-disable-line quotes
|
||||
GetMyScenarios(request) {
|
||||
const path = `api/my-scenarios`;
|
||||
const body = null;
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -572,11 +572,11 @@ export function createEveningDetectiveServerClient(
|
||||
method: "GetMyScenarios",
|
||||
}) as Promise<GetMyScenariosRsp>;
|
||||
},
|
||||
GetScenario(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
GetScenario(request) {
|
||||
if (!request.id) {
|
||||
throw new Error("missing required field request.id");
|
||||
}
|
||||
const path = `api/scenarios/${request.id}`; // eslint-disable-line quotes
|
||||
const path = `api/scenarios/${request.id}`;
|
||||
const body = null;
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -592,11 +592,11 @@ export function createEveningDetectiveServerClient(
|
||||
method: "GetScenario",
|
||||
}) as Promise<GetScenarioRsp>;
|
||||
},
|
||||
UpdateScenario(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
UpdateScenario(request) {
|
||||
if (!request.id) {
|
||||
throw new Error("missing required field request.id");
|
||||
}
|
||||
const path = `api/scenarios/${request.id}`; // eslint-disable-line quotes
|
||||
const path = `api/scenarios/${request.id}`;
|
||||
const body = JSON.stringify(request);
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -612,11 +612,11 @@ export function createEveningDetectiveServerClient(
|
||||
method: "UpdateScenario",
|
||||
}) as Promise<UpdateScenarioRsp>;
|
||||
},
|
||||
DeleteScenario(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
DeleteScenario(request) {
|
||||
if (!request.id) {
|
||||
throw new Error("missing required field request.id");
|
||||
}
|
||||
const path = `api/scenarios/${request.id}`; // eslint-disable-line quotes
|
||||
const path = `api/scenarios/${request.id}`;
|
||||
const body = null;
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -632,11 +632,11 @@ export function createEveningDetectiveServerClient(
|
||||
method: "DeleteScenario",
|
||||
}) as Promise<DeleteScenarioRsp>;
|
||||
},
|
||||
AddScenarioPlace(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
AddScenarioPlace(request) {
|
||||
if (!request.id) {
|
||||
throw new Error("missing required field request.id");
|
||||
}
|
||||
const path = `api/scenarios/${request.id}/places`; // eslint-disable-line quotes
|
||||
const path = `api/scenarios/${request.id}/places`;
|
||||
const body = JSON.stringify(request);
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -652,14 +652,14 @@ export function createEveningDetectiveServerClient(
|
||||
method: "AddScenarioPlace",
|
||||
}) as Promise<AddScenarioPlaceRsp>;
|
||||
},
|
||||
UpdateScenarioPlace(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
UpdateScenarioPlace(request) {
|
||||
if (!request.id) {
|
||||
throw new Error("missing required field request.id");
|
||||
}
|
||||
if (!request.code) {
|
||||
throw new Error("missing required field request.code");
|
||||
}
|
||||
const path = `api/scenarios/${request.id}/places/${request.code}`; // eslint-disable-line quotes
|
||||
const path = `api/scenarios/${request.id}/places/${request.code}`;
|
||||
const body = JSON.stringify(request);
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
@@ -675,14 +675,14 @@ export function createEveningDetectiveServerClient(
|
||||
method: "UpdateScenarioPlace",
|
||||
}) as Promise<UpdateScenarioPlaceRsp>;
|
||||
},
|
||||
DeleteScenarioPlace(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
DeleteScenarioPlace(request) {
|
||||
if (!request.id) {
|
||||
throw new Error("missing required field request.id");
|
||||
}
|
||||
if (!request.code) {
|
||||
throw new Error("missing required field request.code");
|
||||
}
|
||||
const path = `api/scenarios/${request.id}/places/${request.code}`; // eslint-disable-line quotes
|
||||
const path = `api/scenarios/${request.id}/places/${request.code}`;
|
||||
const body = null;
|
||||
const queryParams: string[] = [];
|
||||
let uri = path;
|
||||
|
||||
@@ -18,17 +18,18 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
import { useMessage } from 'naive-ui';
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { NIcon } from 'naive-ui'
|
||||
import { Key24Regular } from '@vicons/fluent'
|
||||
import { DoorOpen } from '@vicons/fa'
|
||||
import { h } from 'vue'
|
||||
import { Key24Regular } from '@vicons/fluent'
|
||||
import { DoorFrontFilled } from '@vicons/material'
|
||||
import { Icon } from '@vicons/utils'
|
||||
import { useMessage } from 'naive-ui';
|
||||
import { NIcon } from 'naive-ui'
|
||||
import { ref } from 'vue';
|
||||
import { h } from 'vue'
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
|
||||
const authStore = useAuthStore();
|
||||
authStore.initFromStorage()
|
||||
@@ -73,16 +74,20 @@ const goToLogout = () => {
|
||||
<template>
|
||||
<div class="menu-block">
|
||||
<div class="left-group">
|
||||
<div class="menu-item-block" :class="{ active: props.active == 'office' }" v-if="authStore.hasRole('user')" @click="router.push('/office')">
|
||||
<div class="menu-item-block" :class="{ active: props.active == 'office' }" v-if="authStore.hasRole('user')"
|
||||
@click="router.push('/office')">
|
||||
Кабинет
|
||||
</div>
|
||||
<div class="menu-item-block" :class="{ active: props.active == 'games' }" v-if="hasPermission('games_page')" @click="router.push('/games')">
|
||||
<div class="menu-item-block" :class="{ active: props.active == 'games' }" v-if="hasPermission('games_page')"
|
||||
@click="router.push('/games')">
|
||||
Игры
|
||||
</div>
|
||||
<div class="menu-item-block" :class="{ active: props.active == 'scenarios' }" v-if="hasPermission('scenarios_page')" @click="router.push('/scenarios')">
|
||||
<div class="menu-item-block" :class="{ active: props.active == 'scenarios' }"
|
||||
v-if="hasPermission('scenarios_page')" @click="router.push('/scenarios')">
|
||||
Мои сценарии
|
||||
</div>
|
||||
<div class="menu-item-block" :class="{ active: props.active == 'users' }" v-if="hasPermission('users_page')" @click="router.push('/users')">
|
||||
<div class="menu-item-block" :class="{ active: props.active == 'users' }" v-if="hasPermission('users_page')"
|
||||
@click="router.push('/users')">
|
||||
Пользователи
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { NAutoComplete, NButton, NCard, NCheckbox, NInput, NSpace, NTabPane, NTabs, useMessage } from 'naive-ui'
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
import { NCard, NTabs, NTabPane, NCheckbox, NButton, NSpace, NInput, NAutoComplete, useMessage } from 'naive-ui'
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
|
||||
const authStore = useAuthStore();
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
|
||||
const authStore = useAuthStore();
|
||||
const client = getAuthClient();
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import type { Application, Door, Key, Place, Scenario } from '@/api/generated/crabs/evening_detective_server';
|
||||
import { NCard, NModal, NInput, NSpace, NText, NUpload, NUploadDragger, NSwitch, NDynamicInput, NInputGroup } from 'naive-ui'
|
||||
import { NDynamicInput, NInput, NInputGroup, NSpace, NSwitch } from 'naive-ui'
|
||||
import type { PropType } from 'vue';
|
||||
|
||||
import type { Application, Door, Key, Place } from '@/api/generated/crabs/evening_detective_server';
|
||||
|
||||
const props = defineProps({
|
||||
place: {
|
||||
type: Object as PropType<Place>,
|
||||
@@ -15,7 +16,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits<{ 'update:mode': [value: String] }>()
|
||||
const emit = defineEmits<{ 'update:mode': [value: string] }>()
|
||||
const updateMode = (mode: string) => {
|
||||
console.log(mode)
|
||||
emit('update:mode', mode)
|
||||
@@ -52,7 +53,7 @@ function onCreateKey(): Key {
|
||||
<div v-if="mode == 'show-editor'" class="place-block show-editor-block" @click="updateMode('edit')">
|
||||
<p>[{{ props.place.code }}] - {{ props.place.name }}</p>
|
||||
<div class="message-content">{{ props.place.text }}</div>
|
||||
<p v-for="application in props.place.applications">{{ application.name }}</p>
|
||||
<p v-for="application in props.place.applications" v-bind:key="application.name">{{ application.name }}</p>
|
||||
</div>
|
||||
|
||||
<div v-if="mode == 'edit'" class="place-block">
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import type { Application, Door, Key, Place, Scenario } from '@/api/generated/crabs/evening_detective_server';
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
import { NButton, useMessage, type UploadFileInfo } from 'naive-ui';
|
||||
import { Settings } from '@vicons/carbon'
|
||||
import { Icon } from '@vicons/utils'
|
||||
import { NButton, type UploadFileInfo,useMessage } from 'naive-ui';
|
||||
import { NCard,NFlex, NInput, NModal, NSpace, NText, NUpload, NUploadDragger } from 'naive-ui'
|
||||
import { ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { Icon } from '@vicons/utils'
|
||||
import { Settings } from '@vicons/carbon'
|
||||
import router from '@/router';
|
||||
import { NCard, NModal, NInput, NSpace, NText, NUpload, NUploadDragger, NFlex, NSwitch, NDynamicInput } from 'naive-ui'
|
||||
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import type { Place, Scenario } from '@/api/generated/crabs/evening_detective_server';
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
import PlaceBlock from '@/components/PlaceBlock.vue';
|
||||
import router from '@/router';
|
||||
|
||||
const client = getAuthClient();
|
||||
const route = useRoute()
|
||||
@@ -188,7 +189,7 @@ async function deletePlace(place: Place) {
|
||||
</n-flex>
|
||||
</PlaceBlock>
|
||||
|
||||
<PlaceBlock :place="place" v-model:mode="place.mode" v-for="place in scenario.story?.places">
|
||||
<PlaceBlock :place="place" v-model:mode="place.mode" v-for="place in scenario.story?.places" v-bind:key="place.code">
|
||||
<n-flex justify="end">
|
||||
<n-button @click="deletePlace(place)" type="error" ghost>Удалить</n-button>
|
||||
<n-button @click="cancelUpdatePlace(place)">Отмена</n-button>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { useMessage } from 'naive-ui';
|
||||
import { NButton, NCard, NInput,NModal } from 'naive-ui'
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import type { Scenario } from '@/api/generated/crabs/evening_detective_server';
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
import { useMessage } from 'naive-ui';
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { NCard, NModal, NButton, NInput } from 'naive-ui'
|
||||
|
||||
|
||||
const client = getAuthClient();
|
||||
@@ -53,7 +54,7 @@ getScenarios()
|
||||
<p class="scenario-title">Создать новый сценарий</p>
|
||||
</div>
|
||||
|
||||
<div class="scenario-block" v-for="scenario in scenarios" @click="toScenarioEditor(scenario.id!)">
|
||||
<div class="scenario-block" v-for="scenario in scenarios" @click="toScenarioEditor(scenario.id!)" v-bind:key="scenario.id">
|
||||
<div class="scenario-image-block scenario-image"
|
||||
:style="{ backgroundImage: `url(${scenario.image})` }"></div>
|
||||
<p class="scenario-title">{{ scenario.name }}</p>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import './assets/main.css'
|
||||
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import { createApp } from 'vue'
|
||||
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
|
||||
+5
-4
@@ -1,13 +1,14 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
|
||||
import GamesView from '../views/GamesView.vue'
|
||||
import HomeView from '../views/HomeView.vue'
|
||||
import LoginView from '../views/LoginView.vue'
|
||||
import OfficeView from '../views/OfficeView.vue'
|
||||
import UserAgreementView from '../views/UserAgreementView.vue'
|
||||
import PrivacyPolicyView from '../views/PrivacyPolicyView.vue'
|
||||
import GamesView from '../views/GamesView.vue'
|
||||
import ScenariosView from '../views/ScenariosView.vue'
|
||||
import UsersView from '../views/UsersView.vue'
|
||||
import ScenariosEditorView from '../views/ScenariosEditorView.vue'
|
||||
import ScenariosView from '../views/ScenariosView.vue'
|
||||
import UserAgreementView from '../views/UserAgreementView.vue'
|
||||
import UsersView from '../views/UsersView.vue'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
// stores/auth.ts
|
||||
import { type User } from '@/api/generated/crabs/evening_detective_server';
|
||||
import { buildClient, getURL } from '@/api/generated/crabs/evening_detective_server/client';
|
||||
import { defineStore } from 'pinia';
|
||||
import { ref, computed } from 'vue';
|
||||
import { computed,ref } from 'vue';
|
||||
|
||||
import { type User } from '@/api/generated/crabs/evening_detective_server';
|
||||
import { buildClient } from '@/api/generated/crabs/evening_detective_server/client';
|
||||
|
||||
export const useAuthStore = defineStore('auth', () => {
|
||||
// ===== STATE =====
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { Key24Regular } from '@vicons/fluent'
|
||||
import { Icon } from '@vicons/utils'
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
|
||||
const isFoundKey = ref(false)
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import { defineConfig } from 'vite'
|
||||
import vueDevTools from 'vite-plugin-vue-devtools'
|
||||
|
||||
// https://vite.dev/config/
|
||||
|
||||
Reference in New Issue
Block a user