-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
731 additions
and
620 deletions.
There are no files selected for viewing
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
22 changes: 7 additions & 15 deletions
22
src/Aiplugs.PoshApp/Views/Shared/Components/UpdateNotice.cshtml
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 |
---|---|---|
@@ -1,33 +1,25 @@ | ||
<template id="update-notice-component"> | ||
<v-dialog v-model="dialog" max-width="600"> | ||
<v-dialog :value="updateAvailable" max-width="600" persistent> | ||
<v-card> | ||
<v-card-title>New version is released!</v-card-title> | ||
<v-divider></v-divider> | ||
<v-card-actions> | ||
<v-spacer></v-spacer> | ||
<v-btn text v-on:click="dialog=false">At later</v-btn> | ||
<v-btn color="primary" v-on:click="install">Quit and Install now</v-btn> | ||
<v-btn text v-on:click="clearUpdateAvailable">At later</v-btn> | ||
<v-btn color="primary" v-on:click="quitAndInstall">Quit and Install now</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</v-dialog> | ||
</template> | ||
<script> | ||
Vue.component('updatenotice', { | ||
template: '#update-notice-component', | ||
data() { | ||
return { | ||
dialog: false | ||
} | ||
computed: { | ||
...Vuex.mapState('ipc', ['updateAvailable']) | ||
}, | ||
methods: { | ||
install() { | ||
ipcRenderer.send('quit-and-install'); | ||
} | ||
}, | ||
mounted() { | ||
ipcRenderer.on('update-available', (sender) => { | ||
this.dialog = true; | ||
}); | ||
...Vuex.mapMutations('ipc', ['clearUpdateAvailable']), | ||
...Vuex.mapActions('ipc', ['quitAndInstall']) | ||
} | ||
}) | ||
</script> |
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 |
---|---|---|
@@ -1,46 +1,33 @@ | ||
<template id="detail-page"> | ||
<section v-if="data" class="d-flex flex-column white" style="position: absolute; top:0; width:calc(100vw - 56px - 256px); height: calc(100vh - 24px); overflow:hidden;"> | ||
<section v-if="detailResult" class="d-flex flex-column white" style="position: absolute; top:0; width:calc(100vw - 56px - 256px); height: calc(100vh - 24px); overflow:hidden;"> | ||
<header> | ||
<v-btn text v-on:click="$emit('close')"> | ||
<v-icon>mdi-arrow-right</v-icon> | ||
</v-btn> | ||
<v-btn text v-for="action in actions" :key="action.id" v-on:click="invokeAction(action.id)">{{action.displayName || action.id}}</v-btn> | ||
<v-btn text v-for="action in actions" :key="action.id" v-on:click="invokeAction({scriptId:action.id, input:[input]})">{{action.displayName || action.id}}</v-btn> | ||
</header> | ||
<div class="flex scroll-content"> | ||
<data-viewer :data="data"></data-viewer> | ||
<data-viewer :data="detailResult"></data-viewer> | ||
</div> | ||
</section> | ||
</template> | ||
|
||
<script type="module"> | ||
import { parsePSDataCollection } from '/js/clixml.js' | ||
<script> | ||
Vue.component('detail-page', { | ||
template: '#detail-page', | ||
props: ['script', 'input'], | ||
data() { | ||
return { | ||
data: null | ||
} | ||
}, | ||
computed: { | ||
...Vuex.mapState('signalr', ['detailResult']), | ||
actions() { | ||
const [repo, id] = this.script.split(':'); | ||
return this.$store.getters['scripts/findActions'](repo, id); | ||
} | ||
}, | ||
methods:{ | ||
invokeAction(name) { | ||
this.$signalr.invoke('InvokeAction', name, null); | ||
} | ||
methods: { | ||
...Vuex.mapActions('signalr', ['invokeDetail', 'invokeAction']) | ||
}, | ||
mounted() { | ||
this.$signalr.on('DetailResult', json => { | ||
this.data = parsePSDataCollection(JSON.parse(json)); | ||
}) | ||
this.$signalr.invoke('InvokeDetail', this.script, this.input); | ||
}, | ||
beforeDestroy() { | ||
this.$signalr.off('DetailResult') | ||
this.invokeDetail({ scriptId: this.script, input: this.input }); | ||
} | ||
}) | ||
</script> |
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
Oops, something went wrong.