73 行
1.9 KiB
Vue
73 行
1.9 KiB
Vue
<template>
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<!--@lang('entry.changelog', ['version' => '2.0'])-->
|
|
Changes in {{ version }}
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
{{ changelog }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
// https://adamwathan.me/2016/01/04/composing-reusable-modal-dialogs-with-vuejs/
|
|
export default {
|
|
name: 'entry-changelog',
|
|
props: [
|
|
'fid',
|
|
'show'
|
|
],
|
|
data: function () {
|
|
return {
|
|
id: this.fid,
|
|
title: '',
|
|
version: '',
|
|
notice: '',
|
|
files: []
|
|
}
|
|
},
|
|
created: function () {
|
|
axios.get('/api/rpc/file/getfile/' + this.id).then(res => {
|
|
this.title = res.data[0].title;
|
|
this.version = res.data[0].version;
|
|
if (res.data[0].warningnote !== '') this.notice = res.data[0].warningnote;
|
|
});
|
|
this.files.push(
|
|
{
|
|
'filename': 'test1.carc',
|
|
'filesize': '1000 TiB'
|
|
},
|
|
{
|
|
'filename': 'test2.carc',
|
|
'filesize': '20 GiB'
|
|
}
|
|
);
|
|
},
|
|
methods: {
|
|
close: function () {
|
|
this.$emit('close');
|
|
}
|
|
},
|
|
mounted: function () {
|
|
document.addEventListener("keydown", e => {
|
|
if (this.show && e.keyCode == 27) { // TODO: keyCode is deprecated; use alternative!
|
|
this.close();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.col {
|
|
text-align: center;
|
|
}
|
|
</style> |