Доработка приложение, исправление ошибок
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Api</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app_api"></div>
|
||||
<script type="module" src="/src/api_window.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -13,25 +13,6 @@ use std::thread;
|
||||
#[path="config.rs"] mod config;
|
||||
#[path="enc_dec_file.rs"] mod enc_dec_file;
|
||||
|
||||
#[tauri::command]
|
||||
fn open_api_window(app_handle: tauri::AppHandle){
|
||||
thread::spawn(move || {
|
||||
match tauri::WindowBuilder::new(
|
||||
&app_handle,
|
||||
"api",
|
||||
tauri::WindowUrl::App("api.html".into())
|
||||
).title("Api")
|
||||
//.skip_taskbar(true)
|
||||
.decorations(false)
|
||||
.build() {
|
||||
Ok(_) => {}
|
||||
Err(_) => {
|
||||
//println!("{err}");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fn main() {
|
||||
std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
|
||||
tauri::Builder::default()
|
||||
@@ -53,7 +34,6 @@ fn main() {
|
||||
tasks::edit_task,
|
||||
tasks::delete_task,
|
||||
tasks::set_task_field,
|
||||
open_api_window,
|
||||
multi_tcp_listener::start_tcp_server,
|
||||
multi_tcp_listener::get_status,
|
||||
multi_tcp_listener::send_command_to_server,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "to-do-app",
|
||||
"version": "1.5.0"
|
||||
"version": "1.6.0"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
@@ -30,10 +30,10 @@
|
||||
},
|
||||
"windows": [
|
||||
{
|
||||
"title": "To Do List",
|
||||
"width": 800,
|
||||
"height": 600,
|
||||
"decorations": false
|
||||
"decorations": false,
|
||||
"title": "To Do List"
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
|
||||
+3
-4
@@ -110,10 +110,9 @@ function select_input(event){
|
||||
|
||||
<template>
|
||||
<div data-tauri-drag-region class="z-50 titlebar h-[30px] select-none fixed flex justify-end top-0 right-0 left-0 bg-gray-100 dark:bg-zinc-800">
|
||||
<p class="fixed left-2 top-0.5 text-lg dark:text-white">
|
||||
<span v-if="!wiki_open">API</span>
|
||||
<span v-else>API Wiki</span>
|
||||
</p>
|
||||
<div @click="$emit('close')" class="fixed left-0 top-0.5 text-lg dark:text-white cursor-pointer" title="Назад">
|
||||
<Icon icon="material-symbols:arrow-back" width="32" height="32"/>
|
||||
</div>
|
||||
<div @click="appWindow.minimize()" class="titlebar-button hover:bg-gray-200 dark:hover:bg-gray-700 justify-center inline-flex w-[30px] h-[30px] items-center dark:text-white" id="titlebar-minimize">
|
||||
<Icon class="" icon="mdi:window-minimize" width="20" height="20"/>
|
||||
</div>
|
||||
|
||||
+12
-4
@@ -10,10 +10,13 @@ import { appWindow } from '@tauri-apps/api/window';
|
||||
import {useDark, useToggle} from "@vueuse/core";
|
||||
import PriorityModal from "./components/modals/PriorityModal.vue";
|
||||
import {listen} from "@tauri-apps/api/event";
|
||||
import ApiApp from "./ApiApp.vue";
|
||||
|
||||
const isDark = useDark();
|
||||
const toggleDark = useToggle(isDark);
|
||||
|
||||
let api = ref(false);
|
||||
|
||||
let tasks = ref({});
|
||||
let pending = ref(true);
|
||||
let api_status = ref(false);
|
||||
@@ -140,15 +143,16 @@ function change_priority(id_task, name, priority){
|
||||
}
|
||||
|
||||
|
||||
async function open_api(){
|
||||
await invoke('open_api_window');
|
||||
function change_api(){
|
||||
api.value = !api.value;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div v-if="!api">
|
||||
<div data-tauri-drag-region class="z-50 titlebar h-[30px] select-none fixed flex justify-end top-0 right-0 left-0 bg-gray-100 dark:bg-zinc-800">
|
||||
<p class="fixed left-2 top-0.5 text-lg dark:text-white">To Do</p>
|
||||
<!-- <p class="fixed left-2 top-0.5 text-lg dark:text-white">To Do</p>-->
|
||||
<div @click="appWindow.minimize()" class="titlebar-button hover:bg-gray-200 dark:hover:bg-gray-700 justify-center inline-flex w-[30px] h-[30px] items-center dark:text-white" id="titlebar-minimize">
|
||||
<Icon class="" icon="mdi:window-minimize" width="20" height="20"/>
|
||||
</div>
|
||||
@@ -163,7 +167,7 @@ async function open_api(){
|
||||
<Icon icon="line-md:loading-twotone-loop" width="96" height="96" class="text-green-500 absolute top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%]"/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<button class="absolute bottom-2 left-2 opacity-50 hover:opacity-100" @click="open_api()">
|
||||
<button class="absolute bottom-2 left-2 opacity-50 hover:opacity-100" @click="change_api()">
|
||||
<Icon icon="icon-park-outline:earth" width="40" height="40" class="relative text-zinc-400 dark:text-zinc-300"/>
|
||||
<Icon v-if="api_status" class="absolute bottom-4 left-4 text-green-500" icon="oui:dot" width="36" height="36"/>
|
||||
<Icon v-else class="absolute bottom-4 left-4 text-red-500" icon="oui:dot" width="36" height="36"/>
|
||||
@@ -236,6 +240,10 @@ async function open_api(){
|
||||
<EditModal v-if="edit_modal" :task_id="to_edit_id" :task_name="to_edit_name" :task_description="to_edit_description" :task_priority="to_edit_priority" @close="edit_modal = !edit_modal"/>
|
||||
<PriorityModal v-if="priority_modal" :task_id="to_change_id" :task_name="to_change_name" :task_priority="to_change_priority" @close="priority_modal = !priority_modal"/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<ApiApp @close="change_api()"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
import { createApp } from "vue";
|
||||
import ApiApp from "./ApiApp.vue";
|
||||
|
||||
createApp(ApiApp).mount("#app_api");
|
||||
+2
-2
@@ -2,7 +2,7 @@ import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(async () => ({
|
||||
export default defineConfig(() => ({
|
||||
plugins: [vue()],
|
||||
|
||||
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
|
||||
@@ -17,5 +17,5 @@ export default defineConfig(async () => ({
|
||||
// 3. tell vite to ignore watching `src-tauri`
|
||||
ignored: ["**/src-tauri/**"],
|
||||
},
|
||||
},
|
||||
}
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user