Skip to content

Commit

Permalink
updates to port used, info and package updates
Browse files Browse the repository at this point in the history
  • Loading branch information
JustSch committed Oct 17, 2022
1 parent 37e5c91 commit f542fd9
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 39 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,16 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 'latest'
cache: "npm"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Run Build
run: npm ci && npm run make

- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function main() {
const express = require('express');
const http = require('http');
const app = express();
const port = process.env.PORT || 3000;
const port = process.env.PORT || 3001;
var lan = "lan";


Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function createWindow () {
}
})
mainWindow.setIcon(__dirname + '/public/images/favicon-96x96.png');
mainWindow.loadURL('http://localhost:3000/');
mainWindow.loadURL('http://localhost:3001/');
mainWindow.on('closed', function () {
mainWindow = null
})
Expand Down
63 changes: 33 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"license": "ISC",
"dependencies": {
"electron-squirrel-startup": "^1.0.0",
"express": "^4.17.1",
"express": "^4.18.2",
"express-rate-limit": "^6.6.0",
"ua-parser-js": "^1.0.2",
"unique-names-generator": "^4.3.0",
Expand Down Expand Up @@ -56,7 +56,11 @@
},
{
"name": "@electron-forge/maker-rpm",
"config": {}
"config": {
"options": {
"icon": "./public/images/android-chrome-512x512.png"
}
}
}
]
}
Expand Down
5 changes: 4 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ <h3>Message Received</h3>
<use xlink:href="#wifi-tethering" />
</svg>
<h1>Snapdrop</h1>
<div class="font-subheading">The easiest way to transfer files across devices<div style="font-size:10px;">Modified Electron version by <a href="https://github.com/JustSch" target="_blank">JustSch</a></div></div>
<div class="font-subheading">The easiest way to transfer files across devices
<div style="font-size:10px;">Modified Electron version by <a href="https://github.com/JustSch" target="_blank">JustSch</a></div>
<div style="font-size:10px;">of <a href="https://github.com/Bellisario/node-snapdrop" target="_blank">Bellisario's nodejs version</a></div>
</div>
<div class="row">
<a class="icon-button" target="_blank" href="https://github.com/RobinLinus/snapdrop" title="Snapdrop on Github" rel="noreferrer">
<svg class="icon">
Expand Down
5 changes: 2 additions & 3 deletions public/scripts/text.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
window.onload = () => {
if (isElectron) {
let text= document.getElementById("snap-text");
//So far is not accurate and attempts to get ip address on every run
let switchtext = document.getElementById("switch");

fetch('/ip').then((res) => {
return res.json();
}).then((data) => {
let ipaddr = Object.values(data).flat();
let x = 0;
text.innerHTML = `Connect to <div id=\"ip-text\">http://${ipaddr[0]}:3000</div> on your other devices`;
text.innerHTML = `Connect to <div id=\"ip-text\">http://${ipaddr[0]}:3001</div> on your other devices`;
switchtext.addEventListener("click",((e) => {
e.preventDefault();
if (x === ipaddr.length -1) x = 0;
else x+=1;
let iptext = document.getElementById("ip-text");
iptext.innerText = `http://${ipaddr[x]}:3000`;
iptext.innerText = `http://${ipaddr[x]}:3001`;
}));
});
}
Expand Down

0 comments on commit f542fd9

Please sign in to comment.