-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
AceDataCloud
committed
Apr 28, 2024
1 parent
091fa4d
commit 2fe1cb4
Showing
110 changed files
with
5,767 additions
and
334 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@acedatacloud-hub-e93cd11c-fc01-46ab-9967-97faa64cfa40.json
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "major", | ||
"comment": "Add Qrart support", | ||
"packageName": "@acedatacloud/hub", | ||
"email": "cqc@cuiqingcai.com", | ||
"dependentChangeType": "patch" | ||
} |
Binary file not shown.
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
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<template> | ||
<div class="panel"> | ||
<div class="config"> | ||
<type-selector class="mb-4" /> | ||
<content-input class="mb-4" /> | ||
<prompt-input class="mb-4" /> | ||
<aspect-ratio-selector class="mb-4" /> | ||
<qrw-selector class="mb-4" /> | ||
<steps-selector class="mb-4" /> | ||
<preset-selector class="mb-4" /> | ||
</div> | ||
<div class="actions"> | ||
<el-button type="primary" class="btn" round @click="onGenerate"> | ||
<font-awesome-icon icon="fa-solid fa-magic" class="mr-2" /> | ||
{{ $t('qrart.button.generate') }} | ||
</el-button> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { defineComponent } from 'vue'; | ||
import TypeSelector from './config/TypeSelector.vue'; | ||
import ContentInput from './config/ContentInput.vue'; | ||
import PromptInput from './config/PromptInput.vue'; | ||
import AspectRatioSelector from './config/AspectRatioSelector.vue'; | ||
import QrwSelector from './config/QrwSelector.vue'; | ||
import StepsSelector from './config/StepsSelector.vue'; | ||
import PresetSelector from './config/PresetSelector.vue'; | ||
import { ElButton } from 'element-plus'; | ||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; | ||
export default defineComponent({ | ||
name: 'PresetPanel', | ||
components: { | ||
TypeSelector, | ||
FontAwesomeIcon, | ||
ContentInput, | ||
PromptInput, | ||
AspectRatioSelector, | ||
ElButton, | ||
QrwSelector, | ||
StepsSelector, | ||
PresetSelector | ||
}, | ||
emits: ['generate'], | ||
computed: { | ||
config() { | ||
return this.$store.state.qrart?.config; | ||
} | ||
}, | ||
methods: { | ||
onGenerate() { | ||
this.$emit('generate'); | ||
} | ||
} | ||
}); | ||
</script> | ||
<style lang="scss" scoped> | ||
.panel { | ||
height: 100%; | ||
padding: 15px; | ||
display: flex; | ||
flex-direction: column; | ||
.config { | ||
width: 100%; | ||
height: calc(100% - 50px); | ||
flex: 1; | ||
overflow-y: scroll; | ||
} | ||
.actions { | ||
height: 50px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
.btn { | ||
width: 100%; | ||
} | ||
} | ||
} | ||
</style> |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template> | ||
<div class="panel detail"> | ||
<task-detail /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
import TaskDetail from './task/Detail.vue'; | ||
export default defineComponent({ | ||
name: 'DetailPanel', | ||
components: { | ||
TaskDetail | ||
}, | ||
data() { | ||
return { | ||
job: 0 | ||
}; | ||
}, | ||
computed: {} | ||
}); | ||
</script> | ||
|
||
<style lang="scss" scoped></style> |
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<template> | ||
<div class="panel recent"> | ||
<task-preview | ||
v-for="(task, taskIndex) in tasks?.items" | ||
:key="taskIndex" | ||
:model-value="task" | ||
class="preview" | ||
@click="onSelectTask(task)" | ||
/> | ||
</div> | ||
</template> | ||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
import TaskPreview from './task/Preview.vue'; | ||
import { Status, IQrartTask } from '@/models'; | ||
export default defineComponent({ | ||
name: 'RecentPanel', | ||
components: { | ||
TaskPreview | ||
}, | ||
emits: ['select'], | ||
data() { | ||
return { | ||
job: 0 | ||
}; | ||
}, | ||
computed: { | ||
loading() { | ||
return this.$store.state.qrart.status.getApplication === Status.Request; | ||
}, | ||
tasks() { | ||
return this.$store.state.qrart.tasks; | ||
} | ||
}, | ||
async mounted() { | ||
await this.$store.dispatch('qrart/setTasks', undefined); | ||
this.getTasks(); | ||
// @ts-ignore | ||
this.job = setInterval(() => { | ||
this.getTasks(); | ||
}, 5000); | ||
}, | ||
methods: { | ||
async onLoadHistory() { | ||
// this.$router.push({ name: ROUTE_MIDJOURNEY_HISTORY }); | ||
}, | ||
async onSelectTask(task: IQrartTask) { | ||
this.$store.dispatch('qrart/setTasksActive', task); | ||
}, | ||
async getTasks() { | ||
// ensure that the previous request has been completed | ||
if (this.loading) { | ||
return; | ||
} | ||
await this.$store.dispatch('qrart/getTasks', { | ||
limit: 12, | ||
offset: 0 | ||
}); | ||
} | ||
} | ||
}); | ||
</script> | ||
<style lang="scss" scoped> | ||
.panel { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100%; | ||
&.recent { | ||
width: 100%; | ||
height: 300px; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
overflow-x: scroll; | ||
.preview { | ||
margin-right: 15px; | ||
} | ||
} | ||
} | ||
</style> |
Oops, something went wrong.