Skip to content

Commit

Permalink
Merge pull request #19 from Saetch/18-add-webui
Browse files Browse the repository at this point in the history
18 add webui
  • Loading branch information
Saetch authored Jun 4, 2024
2 parents 700358e + be61028 commit 7b1af1c
Show file tree
Hide file tree
Showing 43 changed files with 5,055 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
docker push ghcr.io/saetch/deightma_nodecs:latest
- run: |
docker push ghcr.io/saetch/hasher_service:latest
- run: |
docker push ghcr.io/saetch/deightma_webui:latest
build-client:
runs-on: Ubuntu-latest
steps:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ Cluster/hasher_service/target
Cluster/hasher_service/.vs
Cluster/hasher_service/.vscode
Cluster/hasher_service/.launch
Cluster/web/target
Cluster/web/dist
token
39 changes: 39 additions & 0 deletions Cluster/Master/Helper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Master
{
public class Helper
{
public static int BinarySearch(List<NodeResponse> list, int hashVal){
int left = 0;
int right = list.Count - 1;
int ret = 0;
while(left <= right){
int mid = left + (right - left) / 2;
if(list[mid].hash == hashVal){
return mid;
}
if(mid != list.Count -1){
if(list[mid].hash < hashVal && list[mid + 1].hash > hashVal){
ret = mid +1 ;
break;
}
}
if(list[mid].hash < hashVal){
left = mid + 1;
}
else{
right = mid - 1;
}
}
if (ret == list.Count){
return 0;
}else {
return ret;
}
}
}
}
Loading

0 comments on commit 7b1af1c

Please sign in to comment.