Skip to content

Commit 958fb37

Browse files
author
Sailesh Mukil
committed
Make dev_util/serve_dev.py work with the new selector protocol
- Also fixes the frontend/static/test
1 parent bf80325 commit 958fb37

2 files changed

Lines changed: 21 additions & 12 deletions

File tree

frontend/static/dev.html

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,11 +484,20 @@ <h2>Configure Visualization</h2>
484484
window.app.tearDown();
485485
}
486486

487+
let selector;
488+
if (mock) {
489+
selector = { env: 'SpannerEnv.MOCK' };
490+
} else {
491+
selector = {
492+
env: 'SpannerEnv.CLOUD',
493+
project: project,
494+
instance: instance,
495+
database: database
496+
};
497+
}
498+
487499
const params = {
488-
'project': project,
489-
'instance': instance,
490-
'database': database,
491-
'mock': mock,
500+
'selector': selector,
492501
'graph': graph
493502
};
494503

@@ -546,4 +555,4 @@ <h2>Configure Visualization</h2>
546555
toggleCommandPalette();
547556
</script>
548557
</body>
549-
</html>
558+
</html>

frontend/static/test.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@
6868
}
6969

7070
const mount = document.querySelector('.mount-spanner-test');
71-
params = {
72-
'project': 'project-foo',
73-
'instance': 'instance-foo',
74-
'database': 'database-foo',
75-
'mock': true
76-
}
71+
const params = {
72+
selector: {
73+
env: 'SpannerEnv.MOCK'
74+
},
75+
graph: ''
76+
};
7777
window.app = new SpannerApp({
7878
id: 'spanner-test', port:'', params:params, mount:mount, query: ''
7979
});
8080
});
8181
</script>
8282
</body>
83-
</html>
83+
</html>

0 commit comments

Comments
 (0)