-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
191 lines (178 loc) · 6.96 KB
/
index.html
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html>
<html>
<head>
<title>ParallelAverage - Explorer</title>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<!-- <link href="packages/bootstrap.min.css" rel="stylesheet"> -->
<link href="packages/vue2-timeago.css" rel="stylesheet">
<script src="packages/vue.min.js"></script>
<script src="packages/vue2-timeago.js"></script>
<link href="index.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script type="text/x-template" id="job-item-template" class="card">
<div class="card-body">
<div class="job-item-title-area">
<h6 class="card-title cursor-pointer" @click="$emit('select_function', job.function_name)">
{{ job.job_name }}
<i class="fa fa-check" style="font-size:0.75rem; color:grey'" v-if="has_completed" title="job has been completed"></i>
</h6>
<span class="badge badge-light" title="number of runs">{{ job.N_runs }}</span>
</div>
<div class="card-text">
<div v-if="job.args.length">
<ul class="list-inline">
<li
v-for="(arg, i) in job.args"
@click="$emit('toggle_arg', i, job.args)"
:class="
'list-inline-item badge cursor-pointer ' +
(args_filter.length > i && objects_equal(args_filter[i], arg) ? 'badge-warning' : 'badge-dark')
"
>
{{ JSON.stringify(arg) }}
</li>
</ul>
<hr v-if="job.args.length && job.kwargs" />
</div>
<div v-if="job.kwargs">
<ul class="list-inline">
<li
v-for="(value_str, name) in job.kwargs_str"
@click="$emit('toggle_kwarg', name, value_str)"
:class="
'list-inline-item badge cursor-pointer ' +
(kwargs_filter_str.hasOwnProperty(name) && kwargs_filter_str[name] == value_str ? 'badge-warning' : (kwarg_is_unique(name) ? 'badge-secondary' : 'badge-dark'))
"
>
{{ name }} = {{ value_str }}
</li>
</ul>
</div>
</div>
<footer>
<div class="job-item-footer-area">
<div>
<span v-if="has_warnings">
<i class="fa fa-exclamation-triangle" style="font-size:1rem;color:grey;"></i>
{{ warning_message }}
</span>
</div>
<time-ago :datetime="job.datetime" id="job-item-datetime" long tooltip="top"></time-ago>
</div>
</footer>
</div>
</script>
</head>
<body>
<div id="app" class="container">
<h2 id="title">ParallelAverage - Explorer</h2>
<div v-if="within_iframe" class="alert alert-warning" role="alert">
Warning: Fetching of remote databases might not work properly, because this webpage seems to be embedded in another one.
<br>
In case you are connected to a jupyter-notebook server, please replace <span style="font-family: monospace;">/view/</span> by <span style="font-family: monospace;">/files/</span> in the adress bar of your browser and reload this page.
</div>
<div class="row justify-content-start mb-3">
<div class="col-sm input-group" >
<input
type="url"
class="form-control"
placeholder="URL to your database folder"
v-model="url"
@keyup.enter="load_url"
@focus="if(!url) {url = trim_url(location.origin) + '/';}"
/>
<div class="input-group-append">
<button class="btn btn-primary" type="submit" @click="load_url">
<i :class="'fa ' + (url_loaded ? 'fa-refresh' : 'fa-share')"></i>
</button>
</div>
</div>
<span class="col-sm text-muted text-center" style="align-self: center; flex-grow: unset;">or</span>
<div class="col-sm">
<input id="file-input" type="file" accept=".json" style="display: none;" />
<button type="button" @click="load_database" class="btn btn-primary">
local file <i class="fa fa-upload"></i>
</button>
</div>
</div>
<p v-if="url_error_message" class="text-danger">{{ url_error_message }}</p>
<div class="row filter-container" v-if="database">
<div class="col-sm-4">
<label for="functions" class="font-weight-bold">Functions</label>
<ul class="list-group" id="functions">
<li v-for="function_name in function_names"
@click="select_function(function_name)"
:class="'list-group-item list-group-item-action function-name-item ' + ((function_name === selected_function) ? 'active' : '')"
>
<span class="function-name-string">{{ function_name }}</span>
<span class="function-name-count">
{{ function_names_count[function_name] ? function_names_count[function_name] : "" }}
</span>
</li>
</ul>
</div>
<div class="col-sm-5">
<form>
<div class="form-group">
<label for="args" class="font-weight-bold">Arguments</label>
<input
type="text"
id="args"
v-model="args_filter"
:class="'form-control ' + (args_filter ? (cleaned_args_filter.length ? 'is-valid' : 'is-invalid') : '')"
placeholder="[1, *, true]"
></input>
</div>
<div class="form-group">
<label for="kwargs" class="font-weight-bold">Keyword-Arguments</label>
<input
type="text"
id="kwargs"
v-model="kwargs_filter"
:class="'form-control ' + (kwargs_filter ? (kwargs_filter_is_valid ? 'is-valid' : 'is-invalid') : '')"
placeholder='{"N": 10, "strength": 1.5}'
></input>
</div>
</form>
<div v-for="(values, name) in all_kwargs_value_counts">
<ul class="list-inline">
<li v-for="(count, value_str) in values"
@click="toggle_kwarg(name, value_str)"
class="list-inline-item"
>
<div
:class="
'badge cursor-pointer ' +
(kwargs_filter_str.hasOwnProperty(name) && kwargs_filter_str[name] == value_str ? 'badge-warning' : 'badge-dark')
"
>
{{ name }} = {{ value_str }}
</div>
<br>
<div class="item_count_badge">
{{ count }}
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="row">
<job-item
v-if="database"
v-for="job in visible_jobs"
:job="job"
:args_filter="cleaned_args_filter"
:kwargs_filter_str="kwargs_filter_str"
:unique_values_of_all_visible_kwargs="unique_values_of_all_visible_kwargs"
:key="job.job_name"
@select_function="select_function"
@toggle_arg="toggle_arg"
@toggle_kwarg="toggle_kwarg"
></job-item>
</div>
</div>
<script src="index.js"></script>
</body>
</html>