Skip to content

Commit

Permalink
Mobile changes, API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
KeeJef committed Apr 26, 2022
1 parent cfd03f3 commit 735f7a3
Show file tree
Hide file tree
Showing 7 changed files with 1,236 additions and 1,490 deletions.
2,616 changes: 1,177 additions & 1,439 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3"
"eslint-plugin-vue": "^8.0.3",
"html-webpack-inline-source-plugin": "^1.0.0-beta.2",
"html-webpack-plugin": "^5.5.0"
},
"eslintConfig": {
"root": true,
Expand All @@ -35,7 +37,9 @@
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {"no-unused-vars": "off"}
"rules": {
"no-unused-vars": "off"
}
},
"browserslist": [
"> 1%",
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<title>Arr</title>
</head>
<body>
<noscript>
Expand Down
61 changes: 30 additions & 31 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
<template>
<!-- Make sure we provide an option for darkmode logo -->
<div class="connectHeader">
<button
@mouseover="hover = true"
@mouseleave="hover = false"
@mousedown="arconnect"
:class="{ active: hover }"
type="button"
class="arconnectButton"
>
Arconnect
<span v-if="!walletConnected">💵</span>
<span v-if="walletConnected">🟢</span>
</button>
</div>
<div class="titleImage">
<a href=""><img class="logoSize" src="./assets/nav-logo.png" /></a>
</div>
<div class="recentTorrents">
<strong>Search Torrents</strong> |
<a href="/search.php?q=top100:recent" title="Recent Torrents"
>Recent&nbsp;Torrents</a
>
</div>
<searchComp />
<uploadTorrentComp :walletConnected="walletConnected" />
<tableComp />
<div class="connectHeader">
<button
@mouseover="hover = true"
@mouseleave="hover = false"
@mousedown="arconnect"
:class="{ active: hover }"
type="button"
class="arconnectButton"
>
{{arconnectStatus}}
<span v-if="!walletConnected">💵</span>
<span v-if="walletConnected">🟢</span>
</button>
</div>
<div class="titleImage">
<a href="."><img class="logoSize" src="./assets/nav-logo.png" /></a>
</div>
<div class="recentTorrents">
<strong>Search Torrents</strong> |
<a href="." title="Recent Torrents"
>Recent&nbsp;Torrents</a
>
</div>
<searchComp />
<uploadTorrentComp :walletConnected="walletConnected" />
<tableComp />
</template>

<script>
Expand All @@ -44,7 +43,8 @@ export default {
return {
opened: false,
hover: false,
walletConnected: false,
walletConnected: null,
arconnectStatus: "Arconnect"
};
},
methods: {
Expand All @@ -59,6 +59,7 @@ export default {
this.walletConnected = true;
} catch (error) {
console.log(error);
this.arconnectStatus = "Arconnect extension not found"
this.walletConnected = false;
}
},
Expand All @@ -67,7 +68,6 @@ export default {
</script>

<style>
.titleImage {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
Expand Down Expand Up @@ -106,7 +106,7 @@ export default {
}
@media screen and (max-width: 700px) {
.logoSize{
.logoSize {
width: 50%;
min-width: 200px;
}
Expand All @@ -115,5 +115,4 @@ export default {
padding-bottom: 10px;
}
}
</style>
2 changes: 1 addition & 1 deletion src/components/tableComp.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div v-if="loading" class="loadingBar">Loading recent torrents</div>
<div v-if="loading" class="loadingBar">Loading 10 most recent torrents</div>
<div class="loadedTorrentBox">
<table id="torrentTable">
<tr>
Expand Down
32 changes: 18 additions & 14 deletions src/composables/arweaveFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import axios from "axios";
import Arweave from 'arweave';

const arweave = Arweave.init({
host: '188.166.200.45',
port: 1984,
protocol: 'http'
host: 'arweave.net',
port: 443,
protocol: 'https',
timeout: 20000
});

const endpoint = "https://arweave.net/graphql";
Expand All @@ -22,7 +23,7 @@ export async function getRecentTxIds() {

const graphqlQuery = {
query: `{
transactions(tags: [{ name: "Arr", values: "" }]) {
transactions(tags: [{ name: "Arrr", values: "" }]) {
edges {
node {
id
Expand Down Expand Up @@ -51,20 +52,23 @@ export async function getTxFromId(txid) {

try {
console.log("txid: " + txid)
var data = await arweave.transactions.getData(txid)
data = JSON.parse(atob(data))
var data = await arweave.api.get(txid)
} catch (error) {
console.log(error)
return
}

return data
return data.data
}

export async function getSeedersAndLeechers(magnetLink) {
console.log(magnetLink)
let response = await axios.get('https://cryptocommit.org/m/single?magnet=' + magnetLink);
console.log(await response)

let response = await axios({
url: "https://cryptocommit.org/m/single?magnet=" + magnetLink,
method: "GET",
headers: headers,
});

return response.data
}

Expand Down Expand Up @@ -103,7 +107,7 @@ export async function generateTx(magnetLink, contentTitle, contentType) {

} catch (error) {
console.log(error)
return "Failed to create TX"
return "Failed to create TX, please try again"
}

//remove numbers and special characters from the contentTitle replace periods with spaces, remove trailing and leading spaces
Expand All @@ -116,7 +120,7 @@ export async function generateTx(magnetLink, contentTitle, contentType) {
return stopWordArray.indexOf(val) == -1;
});

tx.addTag('Arr')
tx.addTag('Arrr')
tx.addTag('category', contentType)

for (let index = 0; index < contentTitleArray.length; index++) {
Expand All @@ -143,7 +147,7 @@ export async function generateTx(magnetLink, contentTitle, contentType) {
return "TX post failed ❌"
}

return "TX success ✅"
return "TX success, will display within 10 mins ✅"

}

Expand All @@ -157,7 +161,7 @@ export async function searchTx(searchPhrase) {
let query = `query {
transactions(first:20
tags: [
{ name: "Arr", values: [""] }
{ name: "Arrr", values: [""] }
{ name: "name", values: `+ namesArray + ` }
]
) {
Expand Down
3 changes: 2 additions & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true
transpileDependencies: true,
publicPath: '',
})

0 comments on commit 735f7a3

Please sign in to comment.