-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from joon610/v1.0.0
V1.0.0
- Loading branch information
Showing
35 changed files
with
676 additions
and
96 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,24 +1,78 @@ | ||
<template lang="pug"> | ||
v-app(dark) | ||
v-app(dark style="-webkit-app-region: drag") | ||
v-app-bar(app) | ||
v-toolbar-title.headline.text-uppercase | ||
span Mockup Server | ||
v-toolbar-title.headline | ||
span Mockup-server | ||
| {{'v'+packageVersion}} | ||
v-spacer | ||
v-btn(text @click="openBrowser()") | ||
span.mr-2 Latest Release | ||
v-icon mdi-open-in-new | ||
v-btn(v-if="diffResult === true" color="deep-orange" @click="openBrowser()") | ||
span.mr-2 Release {{ newVersion }} | ||
v-icon fa-external-link-square-alt | ||
v-btn(v-else @click="openBugReport()") | ||
span.mr-2 Issues | ||
v-icon fa-external-link-square-alt | ||
v-content | ||
router-view | ||
</template> | ||
</template> | ||
|
||
<style scoped> | ||
.headline { | ||
margin-top: 20px | ||
} | ||
</style> | ||
|
||
<script lang="ts"> | ||
import { Component, Vue } from "vue-property-decorator"; | ||
const shell = require("electron").shell; | ||
import fs from 'fs'; | ||
import {Component, Vue} from 'vue-property-decorator'; | ||
const shell = require('electron').shell; | ||
import {VERSION} from '@/const/mockConst'; | ||
@Component | ||
export default class ComponentName extends Vue { | ||
private openBrowser(): void { | ||
shell.openExternalSync("https://github.com/joon610/mock-server/releases"); | ||
return; | ||
} | ||
export default class ComponentName extends Vue { | ||
private newVersion = ''; | ||
private packageVersion = VERSION; | ||
private openBrowser() { | ||
shell.openExternalSync( | ||
'https://github.com/joon610/mock-server/releases', | ||
); | ||
return; | ||
} | ||
private openBugReport() { | ||
shell.openExternalSync( | ||
'https://github.com/joon610/mockup-server/issues', | ||
); | ||
return; | ||
} | ||
private created() { | ||
this.getNewRelease(); | ||
// this.getCurrentVersion(); | ||
} | ||
private get diffResult() { | ||
if(this.newVersion === '') return false; | ||
if(this.packageVersion === '') return false; | ||
const githubVersionNum = Number(this.removeVersion(this.removePoint(this.newVersion))); | ||
const packageVersionNum = Number(this.removePoint(this.packageVersion)); | ||
return githubVersionNum > packageVersionNum ? true:false; | ||
} | ||
private async getNewRelease(){ | ||
const url = "https://api.github.com/repos/joon610/mockup-server/releases/latest"; | ||
const response = await this.axios.get(url); | ||
const data = response?.data?.name; | ||
this.newVersion = data; | ||
} | ||
private getCurrentVersion() { | ||
const json = JSON.parse(fs.readFileSync('package.json', 'utf8')); | ||
this.packageVersion = json.version; | ||
} | ||
private removePoint = (value:string):string => (value.replace(/\./g ,'')); | ||
private removeVersion = (value:string):string => (value.replace(/v/ ,'')); | ||
} | ||
</script> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
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
Oops, something went wrong.