-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjust breadcrumb and allow to traversal
- Loading branch information
Showing
6 changed files
with
209 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,40 @@ | ||
from django.http import HttpRequest, JsonResponse | ||
from django.urls import path | ||
|
||
from ...model import DockerSoftware | ||
from ...tira_model import model | ||
|
||
|
||
def public_submissions(request: HttpRequest) -> JsonResponse: | ||
ret = [ | ||
{"team": "team-1", "name": "foo1", "type": "Docker", "tasks": ["ir-benchmarks", "reneuir"]}, | ||
{"team": "team-1", "name": "foo2", "type": "Docker", "tasks": ["ir-benchmarks", "reneuir"]}, | ||
{"team": "team-1", "name": "foo3", "type": "Docker", "tasks": ["ir-benchmarks", "reneuir"]}, | ||
{"team": "team-2", "name": "foo2", "type": "Run", "tasks": ["ir-benchmarks", "reneuir"]}, | ||
{"team": "team-3", "name": "foo2", "type": "VM", "tasks": ["ir-benchmarks", "reneuir"]}, | ||
] | ||
all_runs = model.all_runs() | ||
ret = [] | ||
|
||
for vm in all_runs: | ||
for title in all_runs[vm]: | ||
blinded = True | ||
public = False | ||
run_type = [] | ||
tasks = set() | ||
for run in all_runs[vm][title].values(): | ||
run_type += [run["type"]] | ||
blinded = run["blinded"] and blinded | ||
public = run["published"] or public | ||
tasks.add(str(run["task"])) | ||
|
||
if public: | ||
ret += [{"team": vm, "name": title, "type": run_type[0], "tasks": sorted([i for i in tasks])}] | ||
|
||
return JsonResponse(ret, safe=False) | ||
|
||
|
||
endpoints = [path("", public_submissions)] | ||
def software_details(request: HttpRequest, user_id: str, software: str) -> JsonResponse: | ||
ret = [] | ||
for i in DockerSoftware.objects.filter(vm_id=user_id, display_name=software): | ||
if not i.public_image_name: | ||
continue | ||
ret += [{"PublicDockerImage": i.public_image_name, "Command": i.command}] | ||
|
||
return JsonResponse({"DockerImage": "dasda", "tbd": ret}, safe=False) | ||
|
||
|
||
endpoints = [path("", public_submissions), path("<str:user_id>/<str:software>", software_details)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<tira-breadcrumb /> | ||
<h3 class="text-h3 py-5">System Details</h3> | ||
{{ system_details }} | ||
<h3 class="text-h3 py-5">Public Submissions</h3> | ||
We only show submissions of {{ team }}/{{ system }} that have at least one positively validated and published submission for the software. | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { inject } from 'vue' | ||
import { get, reportError, fetchUserInfo, type UserInfo } from './utils'; | ||
import { Loading, TiraBreadcrumb } from './components' | ||
export default { | ||
name: "systems", | ||
components: { Loading, TiraBreadcrumb }, | ||
data() { | ||
return { | ||
userinfo: { role: 'guest', organizer_teams: [] } as UserInfo, | ||
system_details: undefined, | ||
team: undefined as undefined | string, | ||
system: undefined as undefined | string, | ||
} | ||
}, | ||
methods: { | ||
logData(toLog: any) { | ||
console.log(toLog) | ||
} | ||
}, | ||
beforeMount() { | ||
this.team = this.$route.params.team | ||
this.system = this.$route.params.system | ||
fetchUserInfo().then((result) => { this.$data.userinfo = result }) | ||
get(inject("REST base URL") + '/v1/systems/' + this.team + '/' + this.system).then((result) => { this.$data.system_details = result}) | ||
} | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters