diff --git a/web/detector.py b/web/detector.py index 5fe78d1..3c5915d 100644 --- a/web/detector.py +++ b/web/detector.py @@ -1,22 +1,34 @@ import streamlit as st import subprocess import pandas as pd +import plotly.graph_objects as go +import dash +import dash_core_components as dcc +import dash_html_components as html +from dash import Input, Output + df=pd.read_csv("./dataset.csv") df.drop(df.columns[df.columns.str.contains('unnamed',case = False)],axis = 1, inplace = True) df2=df[['Address', 'Sent tnx','Received Tnx','Number of Created Contracts','total Ether sent','total ether received','total ether balance','FLAG']] -# Set the page title and favicon + st.set_page_config( page_title="DMD", page_icon=":bar_chart:", - layout="wide", + layout="wide" ) +app = dash.Dash(__name__) + + -# Create a container for the header with a black background header_container = st.container() header_container.markdown( """ """, @@ -55,12 +78,12 @@ ) -# Add the navigation links with white text to the right side + with header_container: -# Create a row + col1,col2,col3,col4=st.columns([1,1,1,1]) -# Add a button to the row + with col1: button1 = st.button("../") @@ -77,15 +100,26 @@ -# Input text box with custom style + wallet_address = st.text_input("Wallet Address", key="wallet_input", value="") +percentage = 95 # You can change this percentage value + +# Set the text color based on the percentage +if percentage > 65: + text_color = 'red' +else: + text_color = 'green' + if wallet_address: if wallet_address in df2['Address'].unique(): st.write(f"Entered Wallet Address: {wallet_address}") - + st.markdown('
Dirt Score
', unsafe_allow_html=True) + st.write(f"
{percentage}
", unsafe_allow_html=True) + + df3 = df2.loc[df2['Address'] == wallet_address] st.write(df3) else: - st.write(df2) \ No newline at end of file + st.write(df2)