-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
221 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import RecentProject from "@common/project/RecentProject"; | ||
|
||
export default interface RecentProjectManager { | ||
/** | ||
* @return A list of all projects that were recently opened by the user, sorted descending by date. An empty list | ||
* is returned if the recent projects file does not exist. | ||
*/ | ||
getRecentProjects(): Promise<RecentProject[]>; | ||
|
||
addRecentProject(projectPath: string): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<template> | ||
<div class="mx-12"> | ||
<h2>Recent projects</h2> | ||
|
||
<v-list lines="two"> | ||
<v-list-item | ||
v-for="recentProject of recentProjects" | ||
:key="recentProject.path" | ||
:title="recentProject.name" | ||
:subtitle="recentProject.path" | ||
> | ||
<template v-slot:prepend> | ||
<v-avatar> | ||
<v-icon>mdi-folder-outline</v-icon> | ||
</v-avatar> | ||
</template> | ||
|
||
<template v-slot:append> | ||
<v-tooltip :text="recentProject.lastOpened.toLocaleDateString()"> | ||
<template #activator="{ props }"> | ||
<v-btn | ||
icon="mdi-information-outline" | ||
variant="text" | ||
v-bind="props" | ||
/> | ||
</template> | ||
</v-tooltip> | ||
</template> | ||
|
||
</v-list-item> | ||
</v-list> | ||
|
||
<div | ||
class="open-project-button" | ||
> | ||
<v-tooltip | ||
activator="parent" | ||
> | ||
Select a previously created project to open. | ||
</v-tooltip> | ||
<v-icon class="mr-2"> | ||
mdi-folder-open-outline | ||
</v-icon> | ||
<a>Open a project that's not shown in this list...</a> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { Ref, ref } from "vue"; | ||
import RemoteRecentProjectManager from "@renderer/logic/project/RemoteRecentProjectManager"; | ||
import RecentProject from "@common/project/RecentProject"; | ||
const recentProjectManager = new RemoteRecentProjectManager(); | ||
const recentProjects: Ref<RecentProject[]> = ref([]); | ||
recentProjects.value = await recentProjectManager.getRecentProjects(); | ||
</script> | ||
|
||
<style scoped> | ||
.open-project-button { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
/// <reference types="vite/client" /> | ||
|
||
import { ExposedAPI } from "src/preload"; | ||
|
||
declare module '*.vue' { | ||
import type { DefineComponent } from 'vue'; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types | ||
const component: DefineComponent<{}, {}, any>; | ||
export default component; | ||
} | ||
|
||
declare global { | ||
interface Window { | ||
api: ExposedAPI; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import RecentProject from "@common/project/RecentProject"; | ||
import RecentProjectManager from "@common/project/RecentProjectManager"; | ||
|
||
export default class RemoteRecentProjectManager implements RecentProjectManager { | ||
constructor() {} | ||
|
||
getRecentProjects(): Promise<RecentProject[]> { | ||
return window.api.project.recentProjects.getRecentProjects(); | ||
} | ||
addRecentProject(projectPath: string): Promise<void> { | ||
return window.api.project.recentProjects.addRecentProject(projectPath); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.