Minor formatting changes from prettier 2.0
This commit is contained in:
parent
ee3772f8c3
commit
69cdb76a60
10
src/App.vue
10
src/App.vue
@ -50,8 +50,8 @@ export default class App extends Vue {
|
|||||||
mode: 'cors',
|
mode: 'cors',
|
||||||
body: JSON.stringify(credentials),
|
body: JSON.stringify(credentials),
|
||||||
})
|
})
|
||||||
.then(r => r.json())
|
.then((r) => r.json())
|
||||||
.then(r => this.connectEventSource(r.return[0].token));
|
.then((r) => this.connectEventSource(r.return[0].token));
|
||||||
}
|
}
|
||||||
|
|
||||||
connectEventSource(token: string): void {
|
connectEventSource(token: string): void {
|
||||||
@ -62,12 +62,12 @@ export default class App extends Vue {
|
|||||||
console.info('Connecting to eventSource.');
|
console.info('Connecting to eventSource.');
|
||||||
this.evtSource = new EventSource(BASE_URL + 'events?token=' + token);
|
this.evtSource = new EventSource(BASE_URL + 'events?token=' + token);
|
||||||
|
|
||||||
this.evtSource.onopen = e => {
|
this.evtSource.onopen = (e) => {
|
||||||
console.info('Connected to eventSource.');
|
console.info('Connected to eventSource.');
|
||||||
this.$forceUpdate(); // evtSource.readyState won't be detected otherwise
|
this.$forceUpdate(); // evtSource.readyState won't be detected otherwise
|
||||||
};
|
};
|
||||||
|
|
||||||
this.evtSource.onmessage = e => {
|
this.evtSource.onmessage = (e) => {
|
||||||
const event = JSON.parse(e.data);
|
const event = JSON.parse(e.data);
|
||||||
event.splitTag = event.tag.split('/');
|
event.splitTag = event.tag.split('/');
|
||||||
this.events.push(event);
|
this.events.push(event);
|
||||||
@ -79,7 +79,7 @@ export default class App extends Vue {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.evtSource.onerror = e => {
|
this.evtSource.onerror = (e) => {
|
||||||
if (!this.evtSourceTimeout) {
|
if (!this.evtSourceTimeout) {
|
||||||
console.info('Lost eventSource, reconnecting');
|
console.info('Lost eventSource, reconnecting');
|
||||||
console.info(e);
|
console.info(e);
|
||||||
|
@ -69,7 +69,7 @@ export default class Job extends Vue {
|
|||||||
get minionEvents(): { [key: string]: MinionJobEvent[] } {
|
get minionEvents(): { [key: string]: MinionJobEvent[] } {
|
||||||
return this.events
|
return this.events
|
||||||
.filter(
|
.filter(
|
||||||
event =>
|
(event) =>
|
||||||
this.isJobEventType(event, 'prog') ||
|
this.isJobEventType(event, 'prog') ||
|
||||||
this.isJobEventType(event, 'ret')
|
this.isJobEventType(event, 'ret')
|
||||||
)
|
)
|
||||||
@ -84,7 +84,7 @@ export default class Job extends Vue {
|
|||||||
return (
|
return (
|
||||||
this.hideFindJob &&
|
this.hideFindJob &&
|
||||||
this.events.find(
|
this.events.find(
|
||||||
event =>
|
(event) =>
|
||||||
!this.isJobEventType(event, 'prog') &&
|
!this.isJobEventType(event, 'prog') &&
|
||||||
event.data.fun === 'saltutil.find_job'
|
event.data.fun === 'saltutil.find_job'
|
||||||
) !== undefined
|
) !== undefined
|
||||||
|
@ -3,5 +3,5 @@ import Vue from 'vue';
|
|||||||
import App from './App';
|
import App from './App';
|
||||||
|
|
||||||
let app = new Vue({
|
let app = new Vue({
|
||||||
render: h => h(App),
|
render: (h) => h(App),
|
||||||
}).$mount('#app');
|
}).$mount('#app');
|
||||||
|
Loading…
Reference in New Issue
Block a user