Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: save duration #1

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions components/nav-bar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
@yes="copyDecrypted"
@no="visible = false"
/>
<yes-no
title="Save File"
message="How long should the file be stored?"
alt-yes="Save"
alt-no="Cancel"
@yes="copyDecrypted"
@no="visible = false"
>
<input type="range" min="0" max="30" step="1" />
</yes-no>
<img id="logo" src="/assets/img/icon.svg" class="h-5 w-5 border-white border" alt="!3" />
<h1 class="font-bold select-none transition-all duration-200 max-w-0 -mr-1 overflow-hidden whitespace-pre">
not-th.re
Expand Down Expand Up @@ -97,6 +107,7 @@ const entries = computed(() => ([
name: 'file',
entries: [
['save', 'Save for ' + Math.floor(props.defaultExpires / 1000 / 60 / 60 / 24) + ' days'],
['save-custom', 'Save for custom time'],
['duplicate', 'Duplicate'],
['new', 'New'],
] as [string, string][],
Expand Down
10 changes: 8 additions & 2 deletions components/yes-no.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@
@click="emits('no')"
class="yes-no-button"
>
<span class="font-bold underline">N</span>
<span>o</span>
<template v-if="props.altNo">
{{ props.altNo }}
</template>
<template v-else>
<span class="font-bold underline">N</span>
<span>o</span>
</template>
</button>
</div>
</div>
Expand All @@ -50,6 +55,7 @@ const props = defineProps<{
message: string;
disableNo?: boolean;
altYes?: string;
altNo?: string;
}>();
const emits = defineEmits(['yes', 'no'])
watch(() => props.visible, (value) => {
Expand Down
2 changes: 1 addition & 1 deletion server/api/status.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export default defineEventHandler(async (event) => {
}
return {
success: true,
count: Object.entries(count as any)[0][1] as number,
count: Number(Object.entries(count as any)[0][1]),
};
});
Loading