mirror of
https://github.com/ohwgiles/laminar.git
synced 2024-10-27 20:34:20 +00:00
resolves #82: implement /latest endpoint
for run page on webui and archive (via symlink)
This commit is contained in:
parent
137f35bdd7
commit
b15166e83b
@ -865,6 +865,8 @@ void Laminar::runFinished(Run * r) {
|
||||
fsHome->remove(d);
|
||||
}
|
||||
|
||||
fsHome->symlink(kj::Path{"archive", r->name, "latest"}, std::to_string(r->build), kj::WriteMode::CREATE|kj::WriteMode::MODIFY);
|
||||
|
||||
// in case we freed up an executor, check the queue
|
||||
assignNewJobs();
|
||||
}
|
||||
|
@ -700,6 +700,14 @@ const Run = function() {
|
||||
},
|
||||
methods: {
|
||||
status: function(data) {
|
||||
// Check for the /latest endpoint. An intuitive check might be
|
||||
// if(this.$route.params.number == 'latest'), but unfortunately
|
||||
// after calling $router.replace, we re-enter status() before
|
||||
// $route.params is updated. Instead, assume that if there is
|
||||
// no 'started' field, we should redirect to the latest number
|
||||
if(!('started' in data) && 'latestNum' in data)
|
||||
return this.$router.replace('/jobs/' + this.$route.params.name + '/' + data.latestNum);
|
||||
|
||||
state.jobsRunning = [];
|
||||
state.job = data;
|
||||
state.latestNum = data.latestNum;
|
||||
|
Loading…
Reference in New Issue
Block a user