add version fetching
This commit is contained in:
@@ -8,15 +8,9 @@
|
|||||||
<li>Janis Hutz (simplePCBuilding): Maintainer, CLI & GUI development, Packaging</li>
|
<li>Janis Hutz (simplePCBuilding): Maintainer, CLI & GUI development, Packaging</li>
|
||||||
<li>ThatPlasma: App name, Logo, testing, Windows installer</li>
|
<li>ThatPlasma: App name, Logo, testing, Windows installer</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<br><br>
|
||||||
<div class="version-info">
|
<div class="version-info">
|
||||||
<h3>You are currently running version 1.1.0</h3>
|
<h3>You are currently running version {{ appVersion }}. {{ versionNotice[ isUpToDate ] }}</h3>
|
||||||
<h3>Changelog</h3>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
Version 1.0
|
|
||||||
<ul></ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -25,14 +19,22 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
version: '',
|
versionNotice: { true: '==> up to date', false: '==> New version available' },
|
||||||
|
appVersion: 'V1.1.0',
|
||||||
|
latestVersion: '',
|
||||||
isUpToDate: true,
|
isUpToDate: true,
|
||||||
|
releaseInfos: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
fetch( 'https://github.com/simplePCBuilding/ImageVideoUpscaler/blob/master/package.json' ).then( res => {
|
fetch( 'https://api.github.com/repos/simplePCBuilding/ImageVideoUpscaler/releases/latest' ).then( res => {
|
||||||
console.log( res );
|
res.json().then( data => {
|
||||||
})
|
this.latestVersion = data.tag_name;
|
||||||
|
if ( data.tag_name != this.appVersion ) {
|
||||||
|
this.isUpToDate = false;
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user