2024-01-12 07:10:11 +08:00
|
|
|
<template>
|
|
|
|
<div class="buttons">
|
|
|
|
<template v-if="isWindows">
|
2024-01-23 18:52:35 +08:00
|
|
|
<a :href="getWindowsHref"
|
2024-01-12 07:10:11 +08:00
|
|
|
class="btn btn-primary new-project-btn"
|
|
|
|
:title="i18n.t('users.settings.account.addons.desktop_app.windows_button')"
|
|
|
|
role="button"
|
|
|
|
target="_blank">
|
|
|
|
<span class="hidden-xs">{{ i18n.t('users.settings.account.addons.desktop_app.windows_button') }}</span>
|
|
|
|
</a>
|
2024-02-01 17:15:58 +08:00
|
|
|
<div v-if="showButtonLabel" class="text-xs pt-2 pb-6" style="color: var(--sn-sleepy-grey);">
|
2024-01-12 07:10:11 +08:00
|
|
|
{{ i18n.t('users.settings.account.addons.desktop_app.version', { version: this.responseData[0]['version']}) }}
|
2024-01-28 19:07:06 +08:00
|
|
|
</div>
|
2024-01-12 07:10:11 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<template v-else-if="isMac">
|
2024-01-23 18:52:35 +08:00
|
|
|
<a :href="getMacHref"
|
2024-01-12 07:10:11 +08:00
|
|
|
class="btn btn-primary new-project-btn"
|
|
|
|
:title="i18n.t('users.settings.account.addons.desktop_app.macos_button')"
|
|
|
|
role="button"
|
|
|
|
target="_blank">
|
|
|
|
<span class="hidden-xs">{{ i18n.t('users.settings.account.addons.desktop_app.macos_button') }}</span>
|
|
|
|
</a>
|
2024-02-01 17:15:58 +08:00
|
|
|
<div v-if="showButtonLabel" class="text-xs pt-2 pb-6" style="color: var(--sn-sleepy-grey);">
|
2024-01-12 07:10:11 +08:00
|
|
|
{{ i18n.t('users.settings.account.addons.desktop_app.version', { version: this.responseData[1]['version']}) }}
|
2024-01-28 19:07:06 +08:00
|
|
|
</div>
|
2024-01-12 07:10:11 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<template v-else>
|
|
|
|
<div class="flex">
|
|
|
|
<div>
|
2024-01-23 18:52:35 +08:00
|
|
|
<a :href="getWindowsHref"
|
2024-01-12 07:10:11 +08:00
|
|
|
class="btn btn-primary new-project-btn"
|
|
|
|
:title="i18n.t('users.settings.account.addons.desktop_app.windows_button')"
|
|
|
|
role="button"
|
|
|
|
target="_blank">
|
|
|
|
<span class="hidden-xs">{{ i18n.t('users.settings.account.addons.desktop_app.windows_button') }}</span>
|
|
|
|
</a>
|
2024-02-01 17:15:58 +08:00
|
|
|
<div v-if="showButtonLabel" class="text-xs pt-2 pb-6" style="color: var(--sn-sleepy-grey);">
|
2024-01-12 07:16:10 +08:00
|
|
|
{{ i18n.t('users.settings.account.addons.desktop_app.version',
|
|
|
|
{ version: this.responseData[0]['version']})
|
|
|
|
}}
|
2024-01-28 19:07:06 +08:00
|
|
|
</div>
|
2024-01-12 07:10:11 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="ml-2">
|
2024-01-23 18:52:35 +08:00
|
|
|
<a :href="getMacHref"
|
2024-01-12 07:10:11 +08:00
|
|
|
class="btn btn-primary new-project-btn"
|
|
|
|
:title="i18n.t('users.settings.account.addons.desktop_app.macos_button')"
|
|
|
|
role="button"
|
|
|
|
target="_blank">
|
|
|
|
<span class="hidden-xs">{{ i18n.t('users.settings.account.addons.desktop_app.macos_button') }}</span>
|
|
|
|
</a>
|
2024-02-01 17:15:58 +08:00
|
|
|
<p v-if="showButtonLabel" class="text-xs pt-2 pb-6" style="color: var(--sn-sleepy-grey);">
|
2024-01-12 07:16:10 +08:00
|
|
|
{{ i18n.t('users.settings.account.addons.desktop_app.version',
|
|
|
|
{ version: this.responseData[1]['version']})
|
|
|
|
}}
|
2024-01-12 07:10:11 +08:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
2024-01-18 08:12:08 +08:00
|
|
|
|
2024-02-12 18:25:34 +08:00
|
|
|
<a v-if="!isUpdateVersionModal" :href="'https://knowledgebase.scinote.net/en/knowledge/how-to-use-scinote-edit'"
|
2024-01-18 08:12:08 +08:00
|
|
|
:title="i18n.t('users.settings.account.addons.more_info')"
|
2024-01-28 19:07:06 +08:00
|
|
|
class="text-sn-blue"
|
2024-01-18 08:12:08 +08:00
|
|
|
target="_blank">
|
|
|
|
<span class="sn-icon sn-icon-open"></span>
|
|
|
|
{{ i18n.t('users.settings.account.addons.more_info') }}
|
|
|
|
</a>
|
2024-01-12 07:10:11 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'ScinoteEditDownload',
|
|
|
|
props: {
|
2024-01-23 18:52:35 +08:00
|
|
|
data: { type: String, required: true },
|
|
|
|
isUpdateVersionModal: { type: Boolean, required: false }
|
2024-01-12 07:10:11 +08:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
userAgent: this.data,
|
2024-01-23 18:52:35 +08:00
|
|
|
responseData: []
|
2024-01-12 07:10:11 +08:00
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
isWindows() {
|
|
|
|
return /Windows/.test(this.userAgent);
|
|
|
|
},
|
|
|
|
isMac() {
|
|
|
|
return /Mac OS/.test(this.userAgent);
|
2024-01-23 18:52:35 +08:00
|
|
|
},
|
|
|
|
showButtonLabel() {
|
|
|
|
return this.responseData && this.responseData.length > 0 && !this.isUpdateVersionModal;
|
|
|
|
},
|
|
|
|
getWindowsHref() {
|
2024-01-23 19:14:15 +08:00
|
|
|
return this.responseData && this.responseData.length > 0 ? this.responseData[0].url : '#';
|
2024-01-23 18:52:35 +08:00
|
|
|
},
|
|
|
|
getMacHref() {
|
2024-01-23 19:14:15 +08:00
|
|
|
return this.responseData && this.responseData.length > 0 ? this.responseData[1].url : '#';
|
2024-01-12 07:16:10 +08:00
|
|
|
}
|
2024-01-12 07:10:11 +08:00
|
|
|
},
|
|
|
|
created() {
|
|
|
|
window.scinoteEditDownload = this;
|
|
|
|
this.fetchData();
|
|
|
|
},
|
|
|
|
beforeUnmount() {
|
|
|
|
delete window.scinoteEditDownloadComponent;
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
fetchData() {
|
|
|
|
$.get('https://extras.scinote.net/scinote-edit/latest.json', (result) => {
|
|
|
|
this.responseData = result;
|
|
|
|
});
|
2024-01-12 07:16:10 +08:00
|
|
|
}
|
|
|
|
}
|
2024-01-12 07:10:11 +08:00
|
|
|
};
|
2024-01-12 07:16:10 +08:00
|
|
|
</script>
|