-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
1 parent
7ce701b
commit 25fd009
Showing
10 changed files
with
146 additions
and
8 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
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
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,69 @@ | ||
<script lang="ts"> | ||
import { getHistory } from '../../../bindings' | ||
import Link from '$lib/Link.svelte' | ||
import { shell } from '@tauri-apps/api' | ||
const history = getHistory() | ||
</script> | ||
|
||
<main> | ||
<h1>Basic-ass history page</h1> | ||
|
||
<p class="dark">The history is lost when you close the app</p> | ||
|
||
{#await history then history} | ||
{#if history.entries.length === 0} | ||
Empty! When you do things, it will show here. | ||
{/if} | ||
<table> | ||
{#each history.entries.reverse() as [timestamp, action]} | ||
<tr> | ||
<td class="timestamp dark"> | ||
{new Date(timestamp * 1000).toLocaleString()} | ||
</td> | ||
<td> | ||
{#if action === 'CheckNow'} | ||
Manually check for videos | ||
{:else if 'Archive' in action} | ||
{@const id = action.Archive} | ||
Archive video ID <Link | ||
on:click={() => shell.open(`https://www.youtube.com/watch?v=${id}`)} | ||
>{action.Archive}</Link | ||
> | ||
{:else if 'Unarchive' in action} | ||
{@const id = action.Unarchive} | ||
Unarchive video ID <Link | ||
on:click={() => shell.open(`https://www.youtube.com/watch?v=${id}`)} | ||
>{action.Unarchive}</Link | ||
> | ||
{:else if 'AddChannel' in action} | ||
{@const id = action.AddChannel} | ||
Added channel <Link | ||
on:click={() => shell.open(`https://www.youtube.com/channel/${id}`)} | ||
>{action.AddChannel}</Link | ||
> | ||
{:else if 'UpdateOrDeleteChannels' in action} | ||
Updated or deleted channel(s) | ||
{/if} | ||
</td> | ||
</tr> | ||
{/each} | ||
</table> | ||
{#if history.entries.length >= 100} | ||
<p>The end. Only 100 entries are shown.</p> | ||
{/if} | ||
{:catch error} | ||
Error {error} | ||
{/await} | ||
</main> | ||
|
||
<style lang="sass"> | ||
main | ||
padding: 20px | ||
padding-top: 0px | ||
overflow-y: auto | ||
.dark | ||
color: hsl(210, 8%, 80%) | ||
.timestamp | ||
padding-right: 10px | ||
</style> |