提交新任务
This commit is contained in:
		@@ -44,7 +44,7 @@ div(class="mt-[60px] grid grid-cols-1 lg:grid-cols-4 xl:grid-cols-5 text-white b
 | 
				
			|||||||
      p.font-bold Prompt
 | 
					      p.font-bold Prompt
 | 
				
			||||||
      p.text-gray-400 あなたのアイデアを素早く実現するためのフレームワークです。
 | 
					      p.text-gray-400 あなたのアイデアを素早く実現するためのフレームワークです。
 | 
				
			||||||
      textarea.mt-4.rounded-lg.h-32.w-full.px-4.py-2.bg-gray-500.bg-opacity-5.border.border-gray-500.border-opacity-20.text-gray-500(
 | 
					      textarea.mt-4.rounded-lg.h-32.w-full.px-4.py-2.bg-gray-500.bg-opacity-5.border.border-gray-500.border-opacity-20.text-gray-500(
 | 
				
			||||||
        v-model="imageCreate.prompt" type="text" class="focus:outline-none"
 | 
					        v-model="new_task.prompt" type="text" class="focus:outline-none"
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
    div
 | 
					    div
 | 
				
			||||||
      div.flex.items-center.justify-between
 | 
					      div.flex.items-center.justify-between
 | 
				
			||||||
@@ -54,7 +54,7 @@ div(class="mt-[60px] grid grid-cols-1 lg:grid-cols-4 xl:grid-cols-5 text-white b
 | 
				
			|||||||
          div.slider.round
 | 
					          div.slider.round
 | 
				
			||||||
      div(v-show="imageCreate.exclude_on")
 | 
					      div(v-show="imageCreate.exclude_on")
 | 
				
			||||||
        textarea.mt-4.rounded-lg.h-32.w-full.px-4.py-2.bg-gray-500.bg-opacity-5.border.border-gray-500.border-opacity-20.text-gray-400(
 | 
					        textarea.mt-4.rounded-lg.h-32.w-full.px-4.py-2.bg-gray-500.bg-opacity-5.border.border-gray-500.border-opacity-20.text-gray-400(
 | 
				
			||||||
          v-model="imageCreate.exclude" type="text" class="focus:outline-none"
 | 
					          v-model="new_task.exclude" type="text" class="focus:outline-none"
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
      p.pt-2.text-gray-400 描述您不希望出现在图像中的细节, 例如颜色, 物体或是风景
 | 
					      p.pt-2.text-gray-400 描述您不希望出现在图像中的细节, 例如颜色, 物体或是风景
 | 
				
			||||||
    div
 | 
					    div
 | 
				
			||||||
@@ -211,10 +211,8 @@ const views = ref({
 | 
				
			|||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const imageCreate = ref({
 | 
					const imageCreate = ref({
 | 
				
			||||||
  filter_ctive: 0,
 | 
					  filter_ctive: 0, // 被操作的模型位置
 | 
				
			||||||
  filter_list: [0, 1, 2, 3, 4, 5, 6],
 | 
					  filter_list: [0, 1, 2, 3, 4, 5, 6],
 | 
				
			||||||
  prompt: '渲染提示', // 渲染提示
 | 
					 | 
				
			||||||
  exclude: '排除',   // 排除词汇
 | 
					 | 
				
			||||||
  exclude_on: false, // 排除开关
 | 
					  exclude_on: false, // 排除开关
 | 
				
			||||||
  models_show: false, // 模型列表开关
 | 
					  models_show: false, // 模型列表开关
 | 
				
			||||||
  // 输入:
 | 
					  // 输入:
 | 
				
			||||||
@@ -237,7 +235,9 @@ const imageCreate = ref({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// 新任务表单
 | 
					// 新任务表单
 | 
				
			||||||
const new_task = ref({
 | 
					const new_task = ref({
 | 
				
			||||||
  model: 'None',
 | 
					  model: 'None',     // 选择的模型
 | 
				
			||||||
 | 
					  prompt: '渲染提示', // 渲染提示词
 | 
				
			||||||
 | 
					  exclude: '排除',   // 排除词汇
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -300,6 +300,26 @@ const ModelsSelect = (index, model) => {
 | 
				
			|||||||
  imageCreate.value.models_show = false
 | 
					  imageCreate.value.models_show = false
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 提交新任务
 | 
				
			||||||
 | 
					const TaskSubmit = () => {
 | 
				
			||||||
 | 
					  console.log(new_task.value)
 | 
				
			||||||
 | 
					  tasks.value.push(new_task.value)
 | 
				
			||||||
 | 
					  fetch('/api/task', {
 | 
				
			||||||
 | 
					    method: 'POST',
 | 
				
			||||||
 | 
					    headers: {'Content-Type': 'application/json'},
 | 
				
			||||||
 | 
					    body: JSON.stringify(new_task.value)
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 查询任务状态
 | 
				
			||||||
 | 
					const TaskQuery = (tid) => {
 | 
				
			||||||
 | 
					  console.log(tid)
 | 
				
			||||||
 | 
					  fetch('/api/task/'+tid, {
 | 
				
			||||||
 | 
					    method: 'GET',
 | 
				
			||||||
 | 
					    headers: {'Content-Type': 'application/json'},
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<style>
 | 
					<style>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user