Skip to content

Commit

Permalink
Icon upload added back
Browse files Browse the repository at this point in the history
  • Loading branch information
elrumo committed Apr 6, 2021
1 parent 1e54fdb commit 5e5445a
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 53 deletions.
1 change: 1 addition & 0 deletions website/macos-big-sur-icons/src/api/icons copy.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion website/macos-big-sur-icons/src/api/icons.json

Large diffs are not rendered by default.

23 changes: 10 additions & 13 deletions website/macos-big-sur-icons/src/components/Dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@

<coral-dialog-content>

<div class="dialog-text">
On the night of the 2nd of April, the databse where all the icons are hosted was hacked and taken ransom.
<br>
<div class="dialog-text coral-Well m-b-25">
On the 2nd of April, the databse with all the icons was hacked and deleted. Everything has been secured and is now safe to upload icons. Some old icons might still be unavailabe while I work to get as many icons as I can back.
<br>
The hacker deleted all the submissions and is asking for 0.015btc (around $900) to get it back. I have a backup which I'm working on getting it online.
<br>
<br>
To read more about the incident, whcih unfortunately is not an April Fool's joke, read the blog post.
To read more about the incident, <router-link to="/blog/hacked"> read the blog post. </router-link>
</div>

<!-- <div class="dialog-text">
<div class="dialog-text">
<b> We'll let you know by email when the icon has been approved. </b>
<br>
<ul class="coral-List p-t-10 p-b-10">
Expand All @@ -27,15 +24,15 @@
</li>
<li class="coral-List-item"> <b> The file name must be the same as the name of the app. </b></li>
</ul>
</div> -->
</div>

<!-- <div v-if="isLoading" class="loading-overlay">
<div v-if="isLoading" class="loading-overlay">
<div class="loading-popup">
<coral-progress indeterminate>{{ uploadProgress }}/{{ totalNumFiles }} icons uploaded</coral-progress>
</div>
</div> -->
</div>

<!-- <div class="icon-upload-grid">
<div class="icon-upload-grid">

<div v-if="imageData" class="icons-preview-wrapper">

Expand Down Expand Up @@ -85,7 +82,7 @@
<input id="credit" is="coral-textfield" type="url" placeholder="MAKE SURE IT'S A FULL URL: GitHub, Twitter, portfolio site... " labelledby="email-label" class="coral-Form-field" @change="saveCredit">
</form>

</div> -->
</div>

</coral-dialog-content>

Expand Down Expand Up @@ -192,7 +189,7 @@ export default {
}
console.log(fileName, file.name);
const Icons = Parse.Object.extend("Icons");
const Icons = Parse.Object.extend("Icons2");
const icons = new Icons()
const parseFile = new Parse.File(fileName, file); // Set file to new Parse object
parseFile.save().then((uploaded) => {
Expand Down
10 changes: 6 additions & 4 deletions website/macos-big-sur-icons/src/components/Hero.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
Free app icons
</h1>

<p class="coral-Body--L w-100 body-text">
A hacker has deleted the database with all the icons. I'm working on restoring a backup.
<p class="coral-Body--L w-100 body-text coral-Well m-t-10">
Icon submissions back to normal, I'm working hard on getting as may icons as I can back. More info soon.
<br>
<br>
<router-link to="/blog/hacked">
<span class="underline">Read more on the blog. </span>
<span class="underline"> Read more about the hack. </span>
</router-link>
</p>
<!-- <p class="coral-Body--L w-100 body-text">
Expand All @@ -47,7 +49,7 @@
</p> -->


<div class="m-auto m-t-45">
<div class="m-auto m-t-35">

<!-- Desktop Buttons -->
<div class="d-inline-block mobile-hidden">
Expand Down
12 changes: 6 additions & 6 deletions website/macos-big-sur-icons/src/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,16 @@ const VUE_APP_PARSE_JAVASCRIPT_KEY = process.env.VUE_APP_PARSE_JAVASCRIPT_KEY
Parse.initialize(VUE_APP_PARSE_APP_ID, VUE_APP_PARSE_JAVASCRIPT_KEY)
Parse.serverURL = 'https://media.macosicons.com/parse'
var Icons = Parse.Object.extend("Icons");
var Icons = Parse.Object.extend("Icons2");
let algolia = {
appid: process.env.VUE_APP_ALGOLIA_APPID,
apikey: process.env.VUE_APP_ALGOLIA_KEY
}
// TODO: remove credentiaks
let parseUser = process.env.VUE_APP_PARSE_USER
let parsePass = process.env.VUE_APP_PARSE_PASS
let parseUser = process.env.VUE_APP_PARSE_USER_EMAIL
let parsePass = process.env.VUE_APP_PARSE_USER_PASS
const client = algoliasearch(algolia.appid, algolia.apikey);
Expand Down Expand Up @@ -630,7 +630,7 @@ export default {
const query = new Parse.Query(Icons);
query.equalTo("approved", true)
query.descending("createdAt");
query.descending("timeStamp");
query.skip(howManyRecords);
query.limit(docLimit);
const results = await query.find()
Expand Down Expand Up @@ -684,7 +684,7 @@ export default {
const query = new Parse.Query(Icons);
query.equalTo("approved", true)
query.descending("createdAt");
query.descending("timeStamp");
query.limit(docLimit);
parent.howManyRecords = docLimit
const results = await query.find()
Expand Down Expand Up @@ -735,7 +735,7 @@ export default {
console.log(icon);
console.log(newName);
const IconsBase = Parse.Object.extend("Icons");
const IconsBase = Parse.Object.extend("Icons2");
const query = new Parse.Query(IconsBase);
const docToEdit = await query.get(icon.objectID)
Expand Down
16 changes: 9 additions & 7 deletions website/macos-big-sur-icons/src/components/app.less
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,15 @@ main{
}


@media only screen and (max-width: 1350px){
.header-icon-wrapper{
position: relative;
left: 0;
transform: none;
padding-right: 10px;
}
}

@media only screen and (max-width: 1200px){
.icon-list-area{
grid-template-columns: 1fr 1fr 1fr 1fr;
Expand All @@ -1151,13 +1160,6 @@ main{
padding: 50px 20px 15px 20px;
}

.header-icon-wrapper{
position: relative;
left: 0;
transform: none;
padding-right: 10px;
}

}

@media only screen and (max-width: 1024px){
Expand Down
4 changes: 2 additions & 2 deletions website/macos-big-sur-icons/src/views/BlogHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
</router-link>
</div>

<div class="single-ad mobile-ad m-t-50 m-b-50">
<div class="single-ad p-b-20 p-t-30">
<script async="async" type="application/javascript" src="//cdn.carbonads.com/carbon.js?serve=CEBIK27J&amp;placement=macosiconscom" id="_carbonads_js"></script>
</div>

</div>

</div>
Expand Down
58 changes: 38 additions & 20 deletions website/macos-big-sur-icons/src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ import Parse from 'parse'
Parse.initialize("macOSicons");
Parse.serverURL = 'https://media.macosicons.com/parse'
const Icons = Parse.Object.extend("Icons");
const Icons = Parse.Object.extend("Icons2");
Parse.User.enableUnsafeCurrentUser() // Enable cache for user auth, to avoid having to always login
const currentUser = Parse.User.current(); // Check if user is currently logged in or not
Expand Down Expand Up @@ -283,7 +283,7 @@ export default {
for(let doc in icon.icons){
const IconsBase = Parse.Object.extend("Icons");
const IconsBase = Parse.Object.extend("Icons2");
const query = new Parse.Query(IconsBase);
const docToEdit = await query.get(icon.icons[doc].id)
Expand All @@ -297,7 +297,7 @@ export default {
}
} else if(!isMultipleIcons){
const IconsBase = Parse.Object.extend("Icons");
const IconsBase = Parse.Object.extend("Icons2");
const query = new Parse.Query(IconsBase);
const docToEdit = await query.get(icon.id)
Expand All @@ -324,24 +324,42 @@ export default {
await console.log(user);
try {
await user.signUp().then(()=>{
parent.isAuth = true;
});
console.log();
} catch (error) {
console.log(error.code);
if (error.code == 202) { // 202 error = email arleady exists, so attemptying to log them in instead.
Parse.User.logIn(email, password).then((user) => { // Logging in user
parent.isAuth = true;
console.log(user);
}).catch((error) =>{
console.log(error);
})
}
Parse.User.logIn(email, password).then((user) => { // Logging in user
parent.isAuth = true;
console.log(user);
}).catch((error) =>{
console.log(error);
})
// try {
// await user.signUp().then(()=>{
// parent.isAuth = true;
// });
// console.log();
// } catch (error) {
// console.log(error.code);
// Parse.User.logIn(email, password).then((user) => { // Logging in user
// parent.isAuth = true;
// console.log(user);
// }).catch((error) =>{
// console.log(error);
// })
// if (error.code == 202) { // 202 error = email arleady exists, so attemptying to log them in instead.
// Parse.User.logIn(email, password).then((user) => { // Logging in user
// parent.isAuth = true;
// console.log(user);
// }).catch((error) =>{
// console.log(error);
// })
// }
// if (error.code == 119) { // 202 error = Does not have persmission to sign up.
// console.log(error);
// }
}
// }
},
isObjEmpty(obj){
Expand Down

1 comment on commit 5e5445a

@vercel
Copy link

@vercel vercel bot commented on 5e5445a Apr 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.