Skip to content

Commit

Permalink
Added Petrel@1.0.8 and added codebox indicators
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianFun123 committed Mar 12, 2024
1 parent d1482f5 commit 96bd500
Show file tree
Hide file tree
Showing 10 changed files with 916 additions and 951 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine as frontend
FROM node:19-alpine as frontend

WORKDIR /
COPY frontend/package*.json ./app/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public List<FolderResponse> getFolderTree(boolean fetchChildren, boolean fetchSu
}

public List<FolderResponse> getFolderWithChildren() {
return Repo.get(Folder.class).where("userId", id).whereNotNull("parent").all().stream().map(folder -> new FolderResponse(folder, true, true, false, true)).collect(Collectors.toList());
return Repo.get(Folder.class).where("userId", id).whereNull("parent").all().stream().map(folder -> new FolderResponse(folder, true, true, false, true)).collect(Collectors.toList());
}

public void sendNotification(Notification notification) {
Expand Down
1,762 changes: 822 additions & 940 deletions frontend/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
"core-js": "^3.6.5",
"highlight.js": "^11.9.0",
"markdown-it": "^12.0.4",
"petrel": "^1.0.7",
"petrel": "^1.0.8",
"portal-vue": "^2.1.7",
"sass": "^1.43.4",
"v-animate-css": "0.0.5",
"vue": "^2.6.11",
"vue-router": "^3.5.1"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-service": "~5.0.8",
Expand All @@ -31,9 +33,7 @@
"sass-loader": "^7.3.1",
"scss-loader": "0.0.1",
"vue-template-compiler": "^2.6.11",
"vuex": "^3.5.1",
"@babel/eslint-parser": "^7.12.16",
"@babel/core": "^7.12.16"
"vuex": "^3.5.1"
},
"eslintConfig": {
"root": true,
Expand Down
25 changes: 25 additions & 0 deletions frontend/src/assets/img/codebox-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions frontend/src/components/CreatePaste.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</p>

<template v-if="currentPaste.visibility !== 'PUBLIC'">
<h5 class="label">Password</h5>
<h5 class="label">PASSWORD</h5>
<input autocomplete="new-password" v-model="currentPaste.password" class="input"
type="password" placeholder="Password (Optional)">
</template>
Expand All @@ -80,7 +80,7 @@
<span style="opacity: 0.5; color: var(--text-color)" v-if="clientEncrypted"><br>Client-Encryption deactivates the RAW function and some more. You can't open an encrypted paste without the password (If you set one) or the link.</span><br>
</template>

<label for="expiry">Paste Expires</label>
<label for="expiry">Paste expires</label>
<input type="checkbox" v-model="expiry" name="expiry">
<input v-if="expiry" :min="new Date().toTimeString()" v-model="currentPaste.expire_at" step="1" class="input" type="datetime-local">

Expand All @@ -94,7 +94,7 @@


<div v-if="$store.state.user.logged_in && $store.state.user.auth_type == 'interaapps'">
<h5 class="label">Share to friend</h5>
<h5 class="label">SHARE TO FRIEND</h5>
<input autocomplete="off" v-model="currentPaste.friends" class="input" type="text"
placeholder="Friends (By username, split with ,)">
<div id="friend-list" v-if="friendList.length > 0">
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/PasteCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
v-if="paste.type == 'MULTI_PASTE'"
style="right: 15px; top: 15px"
>
<img v-if="paste.tags?.includes('codebox')" src="@/assets/img/codebox-logo.svg" alt="">
{{
paste.tags.includes('codebox')
paste.tags?.includes('codebox')
? 'Codebox'
: multiPasteParts.length > 1
&& this.multiPasteParts[0].contents.split('\n').length >= 2
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/css/cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,13 @@
border-radius: 100px;
display: inline-block;
position: absolute;

img {
width: 16px;
height: 16px;
display: inline;
vertical-align: middle;
margin-bottom: 5px;
}
}
}
2 changes: 1 addition & 1 deletion frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Vue.mixin({
},
methods: {
isPublicPastefyServer() {
return window.location.host == 'pastefy.ga' || window.location.host.endsWith('.pastefy.ga')
return window.location.host == 'pastefy.app' || window.location.host.endsWith('.pastefy.app')
}
}
})
Expand Down
49 changes: 49 additions & 0 deletions frontend/src/views/Paste.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@

</div>

<a
:href="`https://box.pastefy.app/${paste.id}`"
target="_blank" v-animate-css="{classes: 'fadeIn', delay: 100}"
v-if="isPublicPastefyServer() && paste.tags?.includes('codebox')"
class="codebox-info"
>
<img src="@/assets/img/codebox-logo.svg" alt="">
<div>
<h2>This Paste seems to be a Codebox Project</h2>
<h3>Click to open in Pastefy Codebox</h3>
</div>
</a>

<div v-animate-css="{classes: 'fadeIn', delay: 100}" id="tabs" v-if="multiPastes != null && Object.keys(multiPastes).length > 1">
<a v-for="(tab,i) of multiPastes" :key="i" @click="changeTab(i)"
:class="{selected: multiPastesSelected==i}">
Expand Down Expand Up @@ -383,6 +396,42 @@ h1 {
min-height: 30px;
}
.codebox-info {
margin-bottom: 30px;
padding: 20px;
padding-right: 30px;
display: inline-block;
color: var(--text-color);
text-decoration: none;
background: var(--obj-background-color);
border: var(--obj-border-color) 2.5px solid;
border-radius: 10px;
transition: 0.3s;
img {
display: inline-block;
vertical-align: middle;
margin-right: 20px;
width: 40px;
height: 40px;
}
> div {
display: inline-block;
vertical-align: middle;
h2 {
font-size: 18px;
}
h3 {
font-size: 15px;
opacity: 0.4;
}
}
&:hover {
background: var(--obj-background-color-hover);
}
}
#paste-contents,
#preview {
display: block;
Expand Down

0 comments on commit 96bd500

Please sign in to comment.