Skip to content

Commit

Permalink
0.3.1
Browse files Browse the repository at this point in the history
 - Fix hiphp-desktop on docker and others.
 - Add new menu.
 - Bug fixes & performance improvements.

Signed-off-by: Boudjada Yasser <[email protected]>
  • Loading branch information
yasserbdj96 committed Mar 6, 2023
1 parent f19cf08 commit 1069f00
Show file tree
Hide file tree
Showing 8 changed files with 2,741 additions and 40 deletions.
9 changes: 7 additions & 2 deletions hiphp-desktop/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
## 0.2.2 [18-11-2022][Last Version]
- Bug fixes & performance improvements.
## 0.2.3 [06-03-2023][Last Version]
- fix run on docker and others.
- Bug fixes & performance improvements.

## 0.2.2 [18-11-2022]
- Bug fixes & performance improvements.

2 changes: 1 addition & 1 deletion hiphp-desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# run with hiphp-desktop tool:
cd hiphp-desktop
❯ python3 main.py
❯ python3 main.py local

# Run with Makefile:
❯ make run arg="dst" url="<URL>" key="<KEY>"
Expand Down
57 changes: 36 additions & 21 deletions hiphp-desktop/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,39 +134,54 @@ def darkmode():
return how

try:
if sys.argv[1]=="ipynb":
run_type=sys.argv[1]
if run_type=="ipynb":
host_ip="127.0.0.1"
host_port=1000
else:
elif run_type=="docker":
host_ip="0.0.0.0"
host_port=8080
elif run_type=="local":
host_ip="127.0.0.1"
host_port=8080
else:
exit()
except:
host_ip="127.0.0.1"
host_port=8080
print(f"USAGE : python3 {sys.argv[0]} <ipynb/docker/local>")

#iswork:
@eel.expose
def iswork():
return "True"

print(f"hiphp-dst run on : {host_ip}:{host_port}")
print(f"hiphp-dst run on : {run_type}@{host_ip}:{host_port}")

if run_type=="docker":
import socket
ip_address = socket.gethostbyname(socket.gethostname())
print(f"Listening on {ip_address}:{host_port}")

#eel.start("index.html",host=host_ip,port=host_port,size=(1050,500))
try:
if sys.argv[1]=="ipynb":
from pyngrok import ngrok

ngrok.set_auth_token(sys.argv[2])
public_url = ngrok.connect(host_port).public_url
print(f"Sharing app at {public_url}")
eel.start("index.html",host=host_ip,port=host_port)
with True:
pass

print("Killing streamlit app")
print("Killing ngrok tunnel")
ngrok.kill()
raise
except:
if run_type=="ipynb":
from pyngrok import ngrok

try:
auth_token=sys.argv[2]
except:
print(f"USAGE : python3 {sys.argv[0]} <ipynb> <auth_token>")
exit()

ngrok.set_auth_token(auth_token)
public_url = ngrok.connect(host_port).public_url
print(f"Sharing app at {public_url}")
eel.start("index.html",host=host_ip,port=host_port)
with True:
pass

print("Killing streamlit app")
print("Killing ngrok tunnel")
ngrok.kill()
raise
else:
eel.start("index.html",host=host_ip,port=host_port,mode='default')
#}END.
2,672 changes: 2,671 additions & 1 deletion hiphp-desktop/src/font-awesome/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions hiphp-desktop/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<link rel="icon" href="./favicon.ico">
<link rel="apple-touch-icon" href="./favicon.ico">
<link rel="stylesheet" type="text/css" href="./font-awesome/font-awesome.min.css" />
<!--script src="./index.js" defer></script>
<link rel="manifest" href="./manifest.webmanifest"-->
<script src="./index.js" defer></script>
<link rel="manifest" href="./manifest.webmanifest">
<meta name="theme-color" content="#474b85" />
</head>
<body onload="connect_with_cookie()">
Expand Down
33 changes: 22 additions & 11 deletions hiphp-desktop/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ if ('serviceWorker' in navigator){
}



var download_pwa = document.getElementsByClassName('download_pwa');
if (download_pwa.length > 0){
// Code to handle install prompt on desktop
Expand All @@ -53,6 +52,26 @@ if (download_pwa.length > 0){
//addBtn.style.display = 'none';
addBtn.checked=true;



// Show uninstall button
/*if (window.matchMedia('(display-mode: standalone)').matches) {
download_pwa.style.display = 'block';
}*/
/*download_pwa.addEventListener('click', () => {
addBtn.checked=false;
// Clear the cache
caches.keys().then((cacheNames) => {
cacheNames.forEach((cacheName) => {
caches.delete(cacheName);
});
});
console.log('App Uninstalled');
});*/




window.addEventListener('beforeinstallprompt',(e)=>{
// Prevent Chrome 67 and earlier from automatically showing the prompt
e.preventDefault();
Expand Down Expand Up @@ -82,13 +101,5 @@ if (download_pwa.length > 0){
}


/*function pwa_uninstall(){
// given the above, is anything like the following possible?
window.addEventListener('appuninstalled', function(e) {
console.log('onappuninstalled', e)
localStorage.setItem('APP_INSTALLED', '0')
})
alert("hiii");
}*/
//}END.

//}END.
2 changes: 1 addition & 1 deletion hiphp-desktop/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ input[type=submit] {
margin-top: 41px;
/*display:none;*/
height: calc(100vh - 38px);
color: var(--c17);
/*color: var(--c17);*/
background-color: var(--c18);
background-color:var(--c19);
border-color:var(--c16);
Expand Down
2 changes: 1 addition & 1 deletion hiphp-desktop/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.2
0.2.3

1 comment on commit 1069f00

@vercel
Copy link

@vercel vercel bot commented on 1069f00 Mar 6, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

hiphp – ./

hiphp-yasserbdj96.vercel.app
hiphp.vercel.app
hiphp-git-main-yasserbdj96.vercel.app

Please sign in to comment.