Projects STRLCPY hiphp Commits 1069f006
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■
    hiphp-desktop/CHANGELOG
    1  -## 0.2.2 [18-11-2022][Last Version]
     1 +## 0.2.3 [06-03-2023][Last Version]
     2 + - fix run on docker and others.
     3 + - Bug fixes & performance improvements.
     4 +
     5 +## 0.2.2 [18-11-2022]
    2 6   - Bug fixes & performance improvements.
    3 7  
     8 + 
  • ■ ■ ■ ■
    hiphp-desktop/README.md
    skipped 12 lines
    13 13   
    14 14  # run with hiphp-desktop tool:
    15 15  ❯ cd hiphp-desktop
    16  -❯ python3 main.py
     16 +❯ python3 main.py local
    17 17   
    18 18  # Run with Makefile:
    19 19  ❯ make run arg="dst" url="<URL>" key="<KEY>"
    skipped 60 lines
  • ■ ■ ■ ■ ■ ■
    hiphp-desktop/main.py
    skipped 133 lines
    134 134   return how
    135 135   
    136 136  try:
    137  - if sys.argv[1]=="ipynb":
     137 + run_type=sys.argv[1]
     138 + if run_type=="ipynb":
    138 139   host_ip="127.0.0.1"
    139 140   host_port=1000
    140  - else:
     141 + elif run_type=="docker":
    141 142   host_ip="0.0.0.0"
    142 143   host_port=8080
     144 + elif run_type=="local":
     145 + host_ip="127.0.0.1"
     146 + host_port=8080
     147 + else:
     148 + exit()
    143 149  except:
    144  - host_ip="127.0.0.1"
    145  - host_port=8080
     150 + print(f"USAGE : python3 {sys.argv[0]} <ipynb/docker/local>")
    146 151   
    147 152  #iswork:
    148 153  @eel.expose
    149 154  def iswork():
    150 155   return "True"
    151 156   
    152  -print(f"hiphp-dst run on : {host_ip}:{host_port}")
     157 +print(f"hiphp-dst run on : {run_type}@{host_ip}:{host_port}")
     158 + 
     159 +if run_type=="docker":
     160 + import socket
     161 + ip_address = socket.gethostbyname(socket.gethostname())
     162 + print(f"Listening on {ip_address}:{host_port}")
    153 163   
    154 164  #eel.start("index.html",host=host_ip,port=host_port,size=(1050,500))
    155  -try:
    156  - if sys.argv[1]=="ipynb":
    157  - from pyngrok import ngrok
     165 +if run_type=="ipynb":
     166 + from pyngrok import ngrok
     167 + 
     168 + try:
     169 + auth_token=sys.argv[2]
     170 + except:
     171 + print(f"USAGE : python3 {sys.argv[0]} <ipynb> <auth_token>")
     172 + exit()
    158 173   
    159  - ngrok.set_auth_token(sys.argv[2])
    160  - public_url = ngrok.connect(host_port).public_url
    161  - print(f"Sharing app at {public_url}")
    162  - eel.start("index.html",host=host_ip,port=host_port)
    163  - with True:
    164  - pass
     174 + ngrok.set_auth_token(auth_token)
     175 + public_url = ngrok.connect(host_port).public_url
     176 + print(f"Sharing app at {public_url}")
     177 + eel.start("index.html",host=host_ip,port=host_port)
     178 + with True:
     179 + pass
    165 180   
    166  - print("Killing streamlit app")
    167  - print("Killing ngrok tunnel")
    168  - ngrok.kill()
    169  - raise
    170  -except:
     181 + print("Killing streamlit app")
     182 + print("Killing ngrok tunnel")
     183 + ngrok.kill()
     184 + raise
     185 +else:
    171 186   eel.start("index.html",host=host_ip,port=host_port,mode='default')
    172 187  #}END.
    173 188   
  • hiphp-desktop/src/font-awesome/fontawesome-webfont.svg
  • ■ ■ ■ ■ ■ ■
    hiphp-desktop/src/index.html
    skipped 23 lines
    24 24   <link rel="icon" href="./favicon.ico">
    25 25   <link rel="apple-touch-icon" href="./favicon.ico">
    26 26   <link rel="stylesheet" type="text/css" href="./font-awesome/font-awesome.min.css" />
    27  - <!--script src="./index.js" defer></script>
    28  - <link rel="manifest" href="./manifest.webmanifest"-->
     27 + <script src="./index.js" defer></script>
     28 + <link rel="manifest" href="./manifest.webmanifest">
    29 29   <meta name="theme-color" content="#474b85" />
    30 30   </head>
    31 31   <body onload="connect_with_cookie()">
    skipped 80 lines
  • ■ ■ ■ ■ ■ ■
    hiphp-desktop/src/index.js
    skipped 43 lines
    44 44  }
    45 45   
    46 46   
    47  - 
    48 47  var download_pwa = document.getElementsByClassName('download_pwa');
    49 48  if (download_pwa.length > 0){
    50 49   // Code to handle install prompt on desktop
    skipped 1 lines
    52 51   const addBtn = document.querySelector('.download_pwa');
    53 52   //addBtn.style.display = 'none';
    54 53   addBtn.checked=true;
     54 + 
     55 + 
     56 +
     57 + // Show uninstall button
     58 + /*if (window.matchMedia('(display-mode: standalone)').matches) {
     59 + download_pwa.style.display = 'block';
     60 + }*/
     61 + /*download_pwa.addEventListener('click', () => {
     62 + addBtn.checked=false;
     63 + // Clear the cache
     64 + caches.keys().then((cacheNames) => {
     65 + cacheNames.forEach((cacheName) => {
     66 + caches.delete(cacheName);
     67 + });
     68 + });
     69 + console.log('App Uninstalled');
     70 + });*/
     71 + 
     72 + 
     73 + 
    55 74   
    56 75   window.addEventListener('beforeinstallprompt',(e)=>{
    57 76   // Prevent Chrome 67 and earlier from automatically showing the prompt
    skipped 24 lines
    82 101  }
    83 102   
    84 103   
    85  -/*function pwa_uninstall(){
    86 104   
    87  - // given the above, is anything like the following possible?
    88  -window.addEventListener('appuninstalled', function(e) {
    89  - console.log('onappuninstalled', e)
    90  - localStorage.setItem('APP_INSTALLED', '0')
    91  -})
    92  - alert("hiii");
    93  -}*/
    94 105  //}END.
     106 + 
  • ■ ■ ■ ■
    hiphp-desktop/src/style.css
    skipped 405 lines
    406 406   margin-top: 41px;
    407 407   /*display:none;*/
    408 408   height: calc(100vh - 38px);
    409  - color: var(--c17);
     409 + /*color: var(--c17);*/
    410 410   background-color: var(--c18);
    411 411   background-color:var(--c19);
    412 412   border-color:var(--c16);
    skipped 103 lines
  • ■ ■ ■ ■
    hiphp-desktop/version.txt
    1  -0.2.2
     1 +0.2.3
Please wait...
Page is in error, reload to recover