mirror of
				https://github.com/yangjian102621/geekai.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	chore: adjust page styles
This commit is contained in:
		@@ -95,7 +95,7 @@ func (s *Service) Run() {
 | 
			
		||||
			}
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		logger.Infof("Task Executed: %+v", task)
 | 
			
		||||
		// lock the task until the execute timeout
 | 
			
		||||
		s.taskStartTimes[int(task.Id)] = time.Now()
 | 
			
		||||
		atomic.AddInt32(&s.handledTaskNum, 1)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="page-knowledge" :style="{ height: winHeight + 'px' }">
 | 
			
		||||
  <div class="power-log" :style="{ height: winHeight + 'px' }">
 | 
			
		||||
    <div class="inner">
 | 
			
		||||
      <h1>会员知识库搜索</h1>
 | 
			
		||||
      <h2>页面正在紧锣密鼓开发中,敬请期待!</h2>
 | 
			
		||||
@@ -14,7 +14,7 @@ const winHeight = ref(window.innerHeight)
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="stylus" scoped>
 | 
			
		||||
.page-knowledge {
 | 
			
		||||
.power-log {
 | 
			
		||||
  display: flex;
 | 
			
		||||
  justify-content: center;
 | 
			
		||||
  align-items center
 | 
			
		||||
 
 | 
			
		||||
@@ -51,10 +51,10 @@ const routes = [
 | 
			
		||||
                component: () => import('@/views/Invitation.vue'),
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                name: 'knowledge',
 | 
			
		||||
                path: '/knowledge',
 | 
			
		||||
                meta: {title: '我的知识库'},
 | 
			
		||||
                component: () => import('@/views/Knowledge.vue'),
 | 
			
		||||
                name: 'powerLog',
 | 
			
		||||
                path: '/powerLog',
 | 
			
		||||
                meta: {title: '消费日志'},
 | 
			
		||||
                component: () => import('@/views/PowerLog.vue'),
 | 
			
		||||
            },
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -31,8 +31,6 @@
 | 
			
		||||
<script setup>
 | 
			
		||||
 | 
			
		||||
import {useRouter} from "vue-router";
 | 
			
		||||
import {checkSession} from "@/action/session";
 | 
			
		||||
import {isMobile} from "@/utils/libs";
 | 
			
		||||
import {ref} from "vue";
 | 
			
		||||
 | 
			
		||||
const router = useRouter();
 | 
			
		||||
@@ -43,7 +41,7 @@ const navs = ref([
 | 
			
		||||
  {path: "/sd", icon_path: "/images/sd.png", title: "SD 绘画"},
 | 
			
		||||
  {path: "/apps", icon: "menu", title: "应用中心"},
 | 
			
		||||
  {path: "/images-wall", icon: "image-list", title: "作品展示"},
 | 
			
		||||
  {path: "/knowledge", icon: "book", title: "知识库"},
 | 
			
		||||
  {path: "/powerLog", icon: "log", title: "消费日志"},
 | 
			
		||||
  {path: "/member", icon: "vip-user", title: "会员计划"},
 | 
			
		||||
  {path: "/invite", icon: "share", title: "推广计划"},
 | 
			
		||||
])
 | 
			
		||||
 
 | 
			
		||||
@@ -340,7 +340,7 @@
 | 
			
		||||
              <div class="submit-btn">
 | 
			
		||||
                <el-button color="#47fff1" :dark="false" @click="generate" round>立即生成</el-button>
 | 
			
		||||
                <div class="text-info">
 | 
			
		||||
                  <el-tag type="success">绘图可用额度:{{ imgCalls }}</el-tag>
 | 
			
		||||
                  <el-tag type="success">绘图可用额度:{{ power }}</el-tag>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </el-form>
 | 
			
		||||
@@ -580,7 +580,7 @@ const runningJobs = ref([])
 | 
			
		||||
const finishedJobs = ref([])
 | 
			
		||||
 | 
			
		||||
const socket = ref(null)
 | 
			
		||||
const imgCalls = ref(0)
 | 
			
		||||
const power = ref(0)
 | 
			
		||||
const translating = ref(false)
 | 
			
		||||
const userId = ref(0)
 | 
			
		||||
 | 
			
		||||
@@ -653,7 +653,9 @@ const connect = () => {
 | 
			
		||||
  _socket.addEventListener('message', event => {
 | 
			
		||||
    if (event.data instanceof Blob) {
 | 
			
		||||
      fetchRunningJobs()
 | 
			
		||||
      fetchFinishJobs(1)
 | 
			
		||||
      isOver.value = false
 | 
			
		||||
      page.value = 1
 | 
			
		||||
      fetchFinishJobs(page.value)
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -665,7 +667,7 @@ const connect = () => {
 | 
			
		||||
const clipboard = ref(null)
 | 
			
		||||
onMounted(() => {
 | 
			
		||||
  checkSession().then(user => {
 | 
			
		||||
    imgCalls.value = user['img_calls']
 | 
			
		||||
    power.value = user['power']
 | 
			
		||||
    userId.value = user.id
 | 
			
		||||
 | 
			
		||||
    fetchRunningJobs()
 | 
			
		||||
@@ -704,7 +706,7 @@ const fetchRunningJobs = () => {
 | 
			
		||||
          type: 'error',
 | 
			
		||||
          duration: 0,
 | 
			
		||||
        })
 | 
			
		||||
        imgCalls.value += 1
 | 
			
		||||
        power.value += 1
 | 
			
		||||
        continue
 | 
			
		||||
      }
 | 
			
		||||
      _jobs.push(jobs[i])
 | 
			
		||||
@@ -717,6 +719,9 @@ const fetchRunningJobs = () => {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const handleScrollEnd = () => {
 | 
			
		||||
  if (isOver.value === true) {
 | 
			
		||||
    return
 | 
			
		||||
  }
 | 
			
		||||
  page.value += 1
 | 
			
		||||
  fetchFinishJobs(page.value)
 | 
			
		||||
};
 | 
			
		||||
@@ -726,11 +731,6 @@ const pageSize = ref(15)
 | 
			
		||||
const isOver = ref(false)
 | 
			
		||||
const loading = ref(false)
 | 
			
		||||
const fetchFinishJobs = (page) => {
 | 
			
		||||
  if (isOver.value === true) {
 | 
			
		||||
    ElMessage.info("全部数据加载完毕!")
 | 
			
		||||
    return
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loading.value = true
 | 
			
		||||
  // 获取已完成的任务
 | 
			
		||||
  httpGet(`/api/mj/jobs?status=1&page=${page}&page_size=${pageSize.value}`).then(res => {
 | 
			
		||||
@@ -813,7 +813,7 @@ const generate = () => {
 | 
			
		||||
  params.value.img_arr = imgList.value
 | 
			
		||||
  httpPost("/api/mj/image", params.value).then(() => {
 | 
			
		||||
    ElMessage.success("绘画任务推送成功,请耐心等待任务执行...")
 | 
			
		||||
    imgCalls.value -= 1
 | 
			
		||||
    power.value -= 1
 | 
			
		||||
  }).catch(e => {
 | 
			
		||||
    ElMessage.error("任务推送失败:" + e.message)
 | 
			
		||||
  })
 | 
			
		||||
@@ -839,7 +839,7 @@ const send = (url, index, item) => {
 | 
			
		||||
    prompt: item.prompt,
 | 
			
		||||
  }).then(() => {
 | 
			
		||||
    ElMessage.success("任务推送成功,请耐心等待任务执行...")
 | 
			
		||||
    imgCalls.value -= 1
 | 
			
		||||
    power.value -= 1
 | 
			
		||||
  }).catch(e => {
 | 
			
		||||
    ElMessage.error("任务推送失败:" + e.message)
 | 
			
		||||
  })
 | 
			
		||||
 
 | 
			
		||||
@@ -620,7 +620,9 @@ const connect = () => {
 | 
			
		||||
  _socket.addEventListener('message', event => {
 | 
			
		||||
    if (event.data instanceof Blob) {
 | 
			
		||||
      fetchRunningJobs()
 | 
			
		||||
      fetchFinishJobs(1)
 | 
			
		||||
      isOver.value = false
 | 
			
		||||
      page.value = 1
 | 
			
		||||
      fetchFinishJobs(page.value)
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -679,6 +681,9 @@ const fetchRunningJobs = (userId) => {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const handleScrollEnd = () => {
 | 
			
		||||
  if (isOver.value === true) {
 | 
			
		||||
    return
 | 
			
		||||
  }
 | 
			
		||||
  page.value += 1
 | 
			
		||||
  fetchFinishJobs(page.value)
 | 
			
		||||
}
 | 
			
		||||
@@ -689,11 +694,6 @@ const isOver = ref(false)
 | 
			
		||||
const loading = ref(false)
 | 
			
		||||
// 获取已完成的任务
 | 
			
		||||
const fetchFinishJobs = (page) => {
 | 
			
		||||
  if (isOver.value === true) {
 | 
			
		||||
    ElMessage.info("全部数据加载完毕!")
 | 
			
		||||
    return
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loading.value = true
 | 
			
		||||
  httpGet(`/api/sd/jobs?status=1&page=${page}&page_size=${pageSize.value}`).then(res => {
 | 
			
		||||
    if (res.data.length < pageSize.value) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,41 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="page-knowledge" :style="{ height: winHeight + 'px' }">
 | 
			
		||||
    <div class="inner">
 | 
			
		||||
      <h1>会员知识库搜索</h1>
 | 
			
		||||
      <h2>页面正在紧锣密鼓开发中,敬请期待!</h2>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup>
 | 
			
		||||
import {ref} from "vue"
 | 
			
		||||
 | 
			
		||||
const winHeight = ref(window.innerHeight)
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="stylus" scoped>
 | 
			
		||||
.page-knowledge {
 | 
			
		||||
  display: flex;
 | 
			
		||||
  justify-content: center;
 | 
			
		||||
  align-items center
 | 
			
		||||
  background-color: #282c34;
 | 
			
		||||
 | 
			
		||||
  .inner {
 | 
			
		||||
    text-align center
 | 
			
		||||
 | 
			
		||||
    h1 {
 | 
			
		||||
      color: #202020;
 | 
			
		||||
      font-size: 80px;
 | 
			
		||||
      font-weight: bold;
 | 
			
		||||
      letter-spacing: 0.1em;
 | 
			
		||||
      text-shadow: -1px -1px 1px #111111, 2px 2px 1px #363636;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    h2 {
 | 
			
		||||
      color #ffffff;
 | 
			
		||||
      font-weight: bold;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -9,7 +9,7 @@
 | 
			
		||||
        <div class="header">{{ title }}</div>
 | 
			
		||||
        <div class="content">
 | 
			
		||||
          <div class="block">
 | 
			
		||||
            <el-input placeholder="手机号/邮箱地址" size="large" v-model="username" autocomplete="off" autofocus
 | 
			
		||||
            <el-input placeholder="账号" size="large" v-model="username" autocomplete="off" autofocus
 | 
			
		||||
                      @keyup="handleKeyup">
 | 
			
		||||
              <template #prefix>
 | 
			
		||||
                <el-icon>
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
          <div class="block">
 | 
			
		||||
            <el-input placeholder="请输入密码" size="large" v-model="password" show-password autocomplete="off"
 | 
			
		||||
            <el-input placeholder="密码" size="large" v-model="password" show-password autocomplete="off"
 | 
			
		||||
                      @keyup="handleKeyup">
 | 
			
		||||
              <template #prefix>
 | 
			
		||||
                <el-icon>
 | 
			
		||||
@@ -52,7 +52,7 @@
 | 
			
		||||
 | 
			
		||||
<script setup>
 | 
			
		||||
 | 
			
		||||
import {onMounted, onUnmounted, ref} from "vue";
 | 
			
		||||
import {ref} from "vue";
 | 
			
		||||
import {Lock, UserFilled} from "@element-plus/icons-vue";
 | 
			
		||||
import {httpPost} from "@/utils/http";
 | 
			
		||||
import {ElMessage} from "element-plus";
 | 
			
		||||
@@ -61,7 +61,6 @@ import FooterBar from "@/components/FooterBar.vue";
 | 
			
		||||
import {isMobile} from "@/utils/libs";
 | 
			
		||||
import {checkSession} from "@/action/session";
 | 
			
		||||
import {setUserToken} from "@/store/session";
 | 
			
		||||
import {validateEmail, validateMobile} from "@/utils/validate";
 | 
			
		||||
import {prevRoute} from "@/router";
 | 
			
		||||
import ResetPass from "@/components/ResetPass.vue";
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								web/src/views/PowerLog.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								web/src/views/PowerLog.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="power-log" :style="{ height: winHeight + 'px' }">
 | 
			
		||||
    <div class="inner">
 | 
			
		||||
      <h2>消费日志</h2>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup>
 | 
			
		||||
import {ref} from "vue"
 | 
			
		||||
 | 
			
		||||
const winHeight = ref(window.innerHeight)
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="stylus" scoped>
 | 
			
		||||
.power-log {
 | 
			
		||||
  display: flex;
 | 
			
		||||
  justify-content: center;
 | 
			
		||||
  background-color: #282c34;
 | 
			
		||||
  color #ffffff
 | 
			
		||||
 | 
			
		||||
  .inner {
 | 
			
		||||
    display flex
 | 
			
		||||
    justify-content left
 | 
			
		||||
    width 100%
 | 
			
		||||
    padding 0 20px 20px 20px
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -17,7 +17,7 @@
 | 
			
		||||
          end-placeholder="结束日期"
 | 
			
		||||
          format="YYYY-MM-DD"
 | 
			
		||||
          value-format="YYYY-MM-DD"
 | 
			
		||||
          style="margin-right: 10px;width: 200px; position: relative;top:3px;"
 | 
			
		||||
          style="margin: 0 10px;width: 200px; position: relative;top:3px;"
 | 
			
		||||
      />
 | 
			
		||||
      <el-button type="primary" :icon="Search" @click="fetchData">搜索</el-button>
 | 
			
		||||
    </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -268,8 +268,7 @@ const save = function (key) {
 | 
			
		||||
  if (key === 'system') {
 | 
			
		||||
    systemFormRef.value.validate((valid) => {
 | 
			
		||||
      if (valid) {
 | 
			
		||||
        system.value['img_call_price'] = parseFloat(system.value['img_call_price']) ?? 0
 | 
			
		||||
        system.value['chat_call_price'] = parseFloat(system.value['chat_call_price']) ?? 0
 | 
			
		||||
        system.value['power_price'] = parseFloat(system.value['power_price']) ?? 0
 | 
			
		||||
        httpPost('/api/admin/config/update', {key: key, config: system.value}).then(() => {
 | 
			
		||||
          ElMessage.success("操作成功!")
 | 
			
		||||
        }).catch(e => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user