-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch moves several components to their own component files instead of keeping everything in one huge JavaScript file.
- Loading branch information
Showing
8 changed files
with
231 additions
and
455 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<template> | ||
<tr> | ||
<td>{{ event.start }}</td> | ||
<td>{{ event.end }}</td> | ||
<td> | ||
<div class=event_status> | ||
{{ event.status }} | ||
<span class=warning v-if="is_error_state(event)"> | ||
<font-awesome-icon icon="exclamation-triangle" /> | ||
</span> | ||
<span class=action | ||
v-if="event.status == 'failed uploading'" | ||
v-on:click="retry_ingest(event)" | ||
title="Retry upload"> | ||
<font-awesome-icon icon="sync" v-bind:class="{ 'fa-spin': event.processing }" /> | ||
</span> | ||
</div> | ||
</td> | ||
</tr> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['event'], | ||
methods: { | ||
is_error_state: event => [ | ||
'partial recording', | ||
'failed recording' | ||
].indexOf(event.status) >= 0, | ||
retry_ingest: function(event) { | ||
if (!event.processing) { | ||
event.processing = true; | ||
processing_events.push(event.id); | ||
var requestOptions = { | ||
method: "PATCH", | ||
headers: { "Content-Type": "application/vnd.api+json" }, | ||
body: JSON.stringify( | ||
{"data": [{ | ||
"attributes": {"status": "finished recording"}, | ||
"id": event.id, | ||
"type": "event" | ||
}]}) | ||
}; | ||
fetch("/api/events/" + event.id, requestOptions) | ||
.then( function(response) { | ||
if (response.status != 200) {throw "Error: request failed - status "; } | ||
}) | ||
.catch(function(error) { console.log(error); }) | ||
.finally ( () => { | ||
processing_events.pop(event.id); | ||
update_data | ||
}) | ||
} | ||
} | ||
} | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
div.event_status { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
div.event_status span.warning { | ||
color: red; | ||
} | ||
div.event_status span.action { | ||
cursor: pointer; | ||
} | ||
</style> |
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,20 @@ | ||
<template> | ||
<tbody> | ||
<th colspan="2">{{ metric.header }}</th> | ||
<template v-for="item in metric.metrics"> | ||
<tr> | ||
<td>{{ item.name }}</td> | ||
<td>{{ item.value }}</td> | ||
</tr> | ||
</template> | ||
</tbody> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['metric'], | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
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,16 @@ | ||
<template> | ||
<img :src="image" /> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['image'], | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
img { | ||
max-width: 90%; | ||
max-height: 300px; | ||
} | ||
</style> |
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