aboutsummaryrefslogtreecommitdiff
path: root/index.html
blob: 1e2ee3cf141f257e5d08f8d0f910f12c20aa644b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Bonsai - Network Latency Graph Generator</title>
    <link rel="icon" type="image/x-icon" href="favicon.ico">
    <link rel="stylesheet" href="https://unpkg.com/@picocss/[email protected]/css/pico.min.css">
    <style>
        .logo-container {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .logo {
            height: 60px;
            width: auto;
        }

        .logo-container h1 {
            margin: 0;
            line-height: 1;
        }

        .file-item {
            margin-bottom: 1rem;
            padding: 1rem;
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
        }

        .file-buttons {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }

        .file-content {
            margin-top: 1rem;
            padding: 1rem;
            background-color: var(--code-background-color);
            border-radius: var(--border-radius);
            white-space: pre;
            font-family: monospace;
            font-size: 0.9rem;
            max-height: 300px;
            overflow-y: auto;
            display: none;
        }

        .error {
            color: var(--color-red);
            background-color: var(--color-red-background);
            padding: 1rem;
            border-radius: var(--border-radius);
            margin-top: 1rem;
        }

        .loading {
            text-align: center;
            margin-top: 1rem;
        }
    </style>
</head>

<body>
    <main class="container">
        <header>
            <div class="logo-container">
                <img src="logo.png" alt="Bonsai Logo" class="logo">
                <h1>Bonsai</h1>
            </div>
        </header>

        <section>
            <p>
                Bonsai is a tool for generating network latency graphs.
                This web interface allows you to use the
                <a href="https://codelab.fct.unl.pt/di/computer-systems/bonsai" target="_blank">Bonsai project</a>
                without installing its dependencies locally.
                Provide your network configuration in YAML format below and click
                "Generate" to create your network topology files.
            </p>

            <p>
                The tool generates three files: <code>edges.csv</code> containing
                the network connections and latencies, <code>nodes.csv</code> containing
                the node information and positions, and <code>matrix.txt</code> containing
                a square adjacency matrix representation of the network.
            </p>
        </section>

        <section>
            <label for="config">Network Configuration (YAML):</label>
            <textarea id="config" name="config" rows="10">nodes: 15
continents:
    EU: 5
    AS: 5
countries:
    DE: 2
    FR: 2
    CN: 2
    JP: 2</textarea>

            <button id="generateBtn" onclick="generateFiles()">Generate Network Files</button>

            <div id="loading" class="loading" style="display: none;">
                <p aria-busy="true">Generating network files...</p>
            </div>

            <div id="error" class="error" style="display: none;"></div>

            <div id="results" style="margin-top: 2rem;"></div>
        </section>
    </main>

    <script src="script.js"></script>
</body>

</html>