Skip to content

Commit 2483ef8

Browse files
committed
change rank url to just use underscore
1 parent 6ea5f41 commit 2483ef8

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

app/ui/src/components/buttons.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ export class BackButton extends Button {
7272
this.currentPath = window.location.pathname
7373
this.navigatePath = null
7474

75-
if (/\/run\/.+\/.+/.test(this.currentPath)) {
75+
if (/\/run\/.+_\d+/.test(this.currentPath)) {
76+
this.navigatePath = this.currentPath.replace(/(\/run\/.+?)_\d+/, '$1');
77+
this.text = "Run"
78+
} else if (/\/run\/.+\/metrics\/.+/.test(this.currentPath)) {
79+
this.text = 'Run'
80+
this.navigatePath = this.currentPath.replace(/\/run\/(.+)\/metrics\/.+/, '/run/$1');
81+
} else if (/\/run\/.+\/.+/.test(this.currentPath)) {
7682
this.text = 'Run'
7783
this.navigatePath = this.currentPath.replace(/\/run\/(.+)\/.+/, '/run/$1')
7884
} else if (/\/session\/.+\/.+/.test(this.currentPath)) {

app/ui/src/views/run_view.ts

+4-9
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ class RunView extends ScreenView {
4545
private processContainer: WeyaElement
4646
private customMetrics: CustomMetricList
4747

48-
constructor(uuid: string, rank?: string) {
48+
constructor(uuid: string) {
4949
super()
50-
this.uuid = uuid + (rank ? '_' + rank : '')
51-
this.rank = rank
50+
this.uuid = uuid
51+
this.rank = uuid.split('_')[1]
5252
this.runCache = CACHE.getRun(this.uuid)
5353
this.statusCache = CACHE.getRunStatus(this.uuid)
5454
this.userCache = CACHE.getUser()
@@ -325,7 +325,7 @@ class RunView extends ScreenView {
325325
this.rankElems = $('div', '.hidden.list.runs-list.list-group', $ => {
326326
for (const [rank, run_uuid] of Object.entries(this.run.other_rank_run_uuids)) {
327327
$('a', '.list-item.list-group-item.list-group-item-action',
328-
{href: `/run/${this.uuid}/${rank}`, target: "_blank"},
328+
{href: `/run/${this.uuid}_${rank}`, target: "_blank"},
329329
$ => {
330330
$('div', $ => {
331331
$('h6', `Rank ${+rank + 1}`)
@@ -340,11 +340,6 @@ class RunView extends ScreenView {
340340
export class RunHandler {
341341
constructor() {
342342
ROUTER.route('run/:uuid', [this.handleRun])
343-
ROUTER.route('run/:uuid/:rank', [this.handleDistributedRun])
344-
}
345-
346-
handleDistributedRun = (uuid: string, rank: string) => {
347-
SCREEN.setView(new RunView(uuid, rank))
348343
}
349344

350345
handleRun = (uuid: string) => {

0 commit comments

Comments
 (0)