Skip to content

Commit

Permalink
Add suno download (#90)
Browse files Browse the repository at this point in the history
Co-authored-by: Germey <[email protected]>
  • Loading branch information
Germey and Germey authored Jul 31, 2024
1 parent fcf49d8 commit 5bd5337
Show file tree
Hide file tree
Showing 75 changed files with 3,262 additions and 3,041 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "update translate",
"packageName": "@acedatacloud/nexior",
"email": "[email protected]",
"dependentChangeType": "patch"
}
4 changes: 4 additions & 0 deletions src/components/midjourney/preset/VersionSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export default defineComponent({
data() {
return {
options: [
{
value: '6.1',
label: '6.1'
},
{
value: '6.0',
label: '6.0'
Expand Down
49 changes: 48 additions & 1 deletion src/components/suno/task/Preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,24 @@
<h2 class="title">{{ audio?.title }}</h2>
<p class="style">{{ audio?.style }}</p>
</div>
<div class="right">
<el-tooltip effect="dark" :content="$t('suno.button.download')" placement="top">
<font-awesome-icon
v-if="audio?.audio_url"
icon="fa-solid fa-download"
class="icon icon-download"
@click="onDownload($event, audio?.audio_url)"
/>
</el-tooltip>
<el-tooltip effect="dark" :content="$t('suno.button.video')" placement="top">
<font-awesome-icon
v-if="audio?.video_url"
icon="fa-solid fa-clapperboard"
class="icon icon-preview"
@click="onPreview($event, audio?.video_url)"
/>
</el-tooltip>
</div>
</div>
</div>
</template>
Expand All @@ -41,14 +59,17 @@
import { defineComponent } from 'vue';
import { useFormatDuring } from '@/utils/number';
import { ISunoAudio, ISunoTask } from '@/models';
import { ElImage, ElIcon } from 'element-plus';
import { ElImage, ElIcon, ElTooltip } from 'element-plus';
import { VideoPlay, VideoPause } from '@element-plus/icons-vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
export default defineComponent({
name: 'TaskPreview',
components: {
ElImage,
ElIcon,
ElTooltip,
FontAwesomeIcon,
VideoPlay,
VideoPause
},
Expand Down Expand Up @@ -108,6 +129,18 @@ export default defineComponent({
progress: 0
});
}
},
onDownload(event: MouseEvent, audioUrl: string) {
event.stopPropagation();
console.log('on download');
// download url here
window.open(audioUrl, '_blank');
},
onPreview(event: MouseEvent, videoUrl: string) {
event.stopPropagation();
console.log('on preview');
// preview url here
window.open(videoUrl, '_blank');
}
}
});
Expand All @@ -120,6 +153,7 @@ export default defineComponent({
.audio {
display: flex;
margin-bottom: 10px;
border-radius: 10px;
&:hover {
background-color: var(--el-bg-color-page);
Expand Down Expand Up @@ -184,9 +218,22 @@ export default defineComponent({
}
.style {
font-size: 12px;
margin-bottom: 0;
color: var(--el-text-color-secondary);
}
}
.right {
width: 60px;
display: flex;
align-items: center;
justify-content: center;
.icon {
display: block;
z-index: 100;
cursor: pointer;
margin-right: 15px;
}
}
}
}
</style>
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading

0 comments on commit 5bd5337

Please sign in to comment.