diff --git a/tools/ReplayAnalysis/api/app.py b/tools/ReplayAnalysis/api/app.py index 989345ec3..7031d4f1c 100644 --- a/tools/ReplayAnalysis/api/app.py +++ b/tools/ReplayAnalysis/api/app.py @@ -171,15 +171,15 @@ def search_s3(): boto3_session = boto3.Session() if request.method == "GET": - bucket = request.args.get("uri") - bucket, data = list_replays(bucket, session=boto3_session) + uri = request.args.get("uri") + bucket, data = list_replays(uri, session=boto3_session) if bucket is None: if data is ClientError: return jsonify({"success": False, "message": data.__str__()}), 403 else: return jsonify({"success": False, "message": data.__str__()}), 404 - return jsonify({"success": True, "bucket": bucket, "replays": data}), 201 + return jsonify({"success": True, "uri": uri, "replays": data}), 201 @app.route("/submit_replays", methods=["GET", "POST"]) diff --git a/tools/ReplayAnalysis/gui/src/pages/home.js b/tools/ReplayAnalysis/gui/src/pages/home.js index 0e20cfbf4..670bfc351 100644 --- a/tools/ReplayAnalysis/gui/src/pages/home.js +++ b/tools/ReplayAnalysis/gui/src/pages/home.js @@ -10,8 +10,8 @@ export const HomePage = () => { const [resource, setResource] = useState(''); const [replays, setReplays] = useState([]) - const [buckets, setBuckets] = useState([]) - const [bucketLabels, setBucketLabels] = useState([]) + const [bucketUris, setBucketUris] = useState([]) + const [bucketUriLabels, setBucketUriLabels] = useState([]) const [searching, setSearching] = useState(false) const [profiles, setProfiles] = useState([]) const [valid, setValid] = useState(true) @@ -36,10 +36,10 @@ export const HomePage = () => { if (!response.success) { setValid(false) } else { - if (!buckets.includes(response.bucket)) { + if (!bucketUris.includes(response.uri)) { setReplays(replays => [...replays, ...response.replays]); - setBuckets(buckets => [...buckets, response.bucket]); - setBucketLabels(buckets => [...buckets, {label: response.bucket}]); + setBucketUris(uris => [...uris, response.uri]); + setBucketUriLabels(uris => [...uris, {label: response.uri}]); } } @@ -63,13 +63,13 @@ export const HomePage = () => { * @param {number} itemIndex Total data set of query frequency values. */ function removeBucket(itemIndex) { - let bucket = bucketLabels[itemIndex].label - setBucketLabels([...bucketLabels.slice(0, itemIndex), - ...bucketLabels.slice(itemIndex + 1)]); - setBuckets([...buckets.slice(0, itemIndex), - ...buckets.slice(itemIndex + 1)]); + let uri = bucketUriLabels[itemIndex].label + setBucketUriLabels([...bucketUriLabels.slice(0, itemIndex), + ...bucketUriLabels.slice(itemIndex + 1)]); + setBucketUris([...bucketUris.slice(0, itemIndex), + ...bucketUris.slice(itemIndex + 1)]); let result = replays.filter((data) => { - return data.bucket.search(bucket) === -1; + return data.workload !== uri; }); setReplays(result); } @@ -115,7 +115,7 @@ export const HomePage = () => { onDismiss={({detail: {itemIndex}}) => { removeBucket(itemIndex) }} - items={bucketLabels}> + items={bucketUriLabels}>