Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.1 #1

Merged
merged 67 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
e8c4d68
- chore: remove the useless
ChrisGray0626 May 14, 2024
6424d93
feat(components): new TitleBar, LeftBox, CenterBox.
martsimq May 15, 2024
553bcb5
- refactor(project): Add Element Plus
ChrisGray0626 May 16, 2024
fe9e91e
- chore(project): Add Element Plus
ChrisGray0626 May 16, 2024
068b352
- style
martsimq May 16, 2024
a7aaebe
- build: logicflow/core, logicflow/extentions
ChrisGray0626 May 20, 2024
644c61f
chore(pinia);
martsimq May 21, 2024
282d5d2
- feat(autoLayout)
ChrisGray0626 May 28, 2024
04f1614
- refactor(autoLayout)
ChrisGray0626 May 28, 2024
c6b9bd0
refactor: style refinement
martsimq Jun 3, 2024
4a2730d
- build: run.sh
ChrisGray0626 Jun 3, 2024
054fec5
refactor: update the overall project structure
martsimq Jun 5, 2024
e739ae9
fix(Workflow): fix the issue that canvas cannot be reused
martsimq Jun 5, 2024
54a9625
- refactor(Workflow): add graphData in props
ChrisGray0626 Jun 6, 2024
92b620a
- chore(BreakDownChart.vue)
ChrisGray0626 Jun 7, 2024
a7698c4
- feat(util): treeJson2Graph
ChrisGray0626 Jun 12, 2024
1ee2fdf
- feat(util): nodeStyle
ChrisGray0626 Jun 12, 2024
b318ce9
- feat(WorkflowChart)
ChrisGray0626 Jun 14, 2024
b22441b
feat(breakdownchart): update new tree graph style and decouple config…
martsimq Jun 15, 2024
b8e68a4
refactor(nodeConfig): update new configuration interface for node man…
martsimq Jun 17, 2024
5d25edd
- refactor(WorkflowChart): id
ChrisGray0626 Jun 17, 2024
97e4542
refactor(store/node.ts): all business-related data operation is extra…
martsimq Jun 17, 2024
aa59d25
refactor(G6)
martsimq Jun 18, 2024
f04ab60
feat(function:JobData2Tree)
martsimq Jun 18, 2024
3e327f4
refactor(dialogue.ts->session.ts)
martsimq Jun 19, 2024
4e17a60
feat(api/fetch.ts, store/data.ts): Abstract the data manipulation log…
martsimq Jun 19, 2024
6a63bb6
chore: new TODO
martsimq Jun 19, 2024
4658db6
- refactor(WorkflowChart): defaultNode
ChrisGray0626 Jun 21, 2024
8248f91
feat: register new Node and make text wrapped
martsimq Jun 26, 2024
7094590
feat: communicating with the back-end (fetch)
martsimq Jun 26, 2024
129e671
refactor(Session): new Session type supports only one single session
martsimq Jun 26, 2024
774d238
feat(workflowChart): add new node and edge style
martsimq Jun 26, 2024
66cb5c4
- build: add axios
ChrisGray0626 Jun 27, 2024
d777d8e
feat: display tools' args
martsimq Jun 27, 2024
6a98ad4
feat(nodeConfig): add submit button
martsimq Jun 27, 2024
f9b79d9
feat(nodeConfig): add save and cancel button
martsimq Jun 27, 2024
4cf81ba
- docs(README): 功能设计
ChrisGray0626 Jun 27, 2024
50d9973
- build(Nginx): default.conf
ChrisGray0626 Jun 28, 2024
9244cae
build(ci)
ChrisGray0626 Jun 28, 2024
0c4700c
feat(graphUtil): text wrapping
martsimq Jun 28, 2024
77466bf
chore: add type file
martsimq Jun 28, 2024
4174d2a
- refactor(job): from data
ChrisGray0626 Jun 28, 2024
f5e028b
- fix(job): _job
ChrisGray0626 Jun 28, 2024
4a09b55
- style(job)
ChrisGray0626 Jul 1, 2024
e58f8a2
- refactor(api): mock
ChrisGray0626 Jul 1, 2024
0a35235
- bug(behaviorConfig)
ChrisGray0626 Jul 1, 2024
8007c93
- bug(behaviorConfig)
ChrisGray0626 Jul 1, 2024
68cd3b3
bug(behaviorConfig)
martsimq Jul 1, 2024
c420825
- refactor(taskConfig)
ChrisGray0626 Jul 1, 2024
68f82d8
- feat(api/qgis): fetchDir
ChrisGray0626 Jul 2, 2024
8657071
chore: rename
martsimq Jul 2, 2024
610fc78
- fix(api/qgis)
ChrisGray0626 Jul 2, 2024
7f7e28b
- fix(api/qgis)
ChrisGray0626 Jul 2, 2024
4f5fb87
feat(taskConfig): access tool processing api
martsimq Jul 3, 2024
38df07a
feat(Case): new case button, transparent Question component
martsimq Jul 3, 2024
42cbac4
feat: skeleton, upload and download button
martsimq Jul 3, 2024
acd4e30
feat: skeleton, upload and download button
martsimq Jul 3, 2024
949948f
refactor: disable upload
martsimq Jul 3, 2024
40c1840
feat(taskConfig): download
martsimq Jul 5, 2024
976a8d5
bug: Response type correction
martsimq Jul 5, 2024
1a07c43
chore: type declaration
martsimq Jul 6, 2024
c37dd21
refactor: access to the updated tool API
martsimq Jul 6, 2024
0afa63b
refactor(TaskConfig)
martsimq Jul 7, 2024
c88d77c
refactor(TaskConfig, mock)
martsimq Jul 7, 2024
9532f57
feat: highlight node when hovering
martsimq Jul 10, 2024
80fd4e5
feat(router)
martsimq Jul 11, 2024
9e9f945
fix: path error
martsimq Jul 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Push Docker Image
on:
push:
branches:
- dev/*
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 18.x ]
image-name: [ chrisgray0626/gis-agent-frontend ]
image-tag: [ 0.1 ]

steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn install
- run: yarn build
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ matrix.image-name }}:latest, ${{ matrix.image-name }}:${{ matrix.image-tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Nginx
nginx/log
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginx:stable
# Copy the configuration of Nginx
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
# COPY the source code
COPY dist/ /usr/share/nginx/html/
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Vue 3 + TypeScript + Vite
# Agent-Web

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
## 功能设计

## Recommended Setup
https://dde.feishu.cn/wiki/TlxpwBmUIipdZ1kmfgjcEfK6nYB

- [VS Code](https://code.visualstudio.com/) + [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (previously Volar) and disable Vetur
## 接口文档

- Use [vue-tsc](https://github.com/vuejs/language-tools/tree/master/packages/tsc) for performing the same type checking from the command line, or for generating d.ts files for SFCs.
https://app.apifox.com/project/4714372
7 changes: 7 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
frontend:
image: chrisgray0626/gis-agent-frontend:latest
volumes:
- ./nginx/log:/var/log/nginx
ports:
- 8888:80
5 changes: 2 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
<title>Agent-Web</title>
</head>
<body>
<div id="app"></div>
Expand Down
15 changes: 15 additions & 0 deletions nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
server {
listen 80;
server_name localhost;
#charset koi8-r;
access_log /var/log/nginx/host.access.log main;
error_log /var/log/nginx/error.log error;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,19 @@
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.4.21"
"@antv/g6": "^4.8.24",
"@antv/layout": "^0.3.25",
"@element-plus/icons-vue": "^2.3.1",
"@logicflow/core": "^1.2.27",
"@logicflow/extension": "^1.2.27",
"axios": "^1.7.2",
"element-plus": "^2.7.3",
"pinia": "^2.1.7",
"vue": "^3.4.21",
"vue-router": "4"
},
"devDependencies": {
"@types/node": "^20.12.12",
"@vitejs/plugin-vue": "^5.0.4",
"less": "^4.2.0",
"typescript": "^5.2.2",
Expand Down
1 change: 0 additions & 1 deletion public/vite.svg

This file was deleted.

11 changes: 11 additions & 0 deletions script/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

REGISTRY_URL=chrisgray0626
IMAGE_NAME=gis-agent-frontend
IMAGE_TAG=0.1
# Change to the root directory
cd ..
# Build the image
docker build -t ${REGISTRY_URL}/${IMAGE_NAME}:latest .
# Tag the image
docker tag ${REGISTRY_URL}/${IMAGE_NAME}:latest ${REGISTRY_URL}/${IMAGE_NAME}:${IMAGE_TAG}
1 change: 1 addition & 0 deletions script/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run dev
7 changes: 2 additions & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<script lang="ts" setup>
import Index from '/src/views/index/index.vue'
</script>
<script lang="ts" setup></script>

<template>
<Index/>
<RouterView />
</template>

22 changes: 22 additions & 0 deletions src/G6/behaviorConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { IG6GraphEvent } from "@antv/g6-core/lib/types";
import { BehaviorOption } from "@antv/g6";
import { useTaskStore } from "@/store/task.ts";
import pinia from "@/store";
import { Task } from "@/type.ts";

export const activateNodeBehavior: BehaviorOption = {
getEvents() {
return {
"node:click": "onNodeClick",
};
},
async onNodeClick(evt: IG6GraphEvent) {
const node = evt.item!;
const task: Task = node.getModel().task as Task;
// Update the task config
const taskStore = useTaskStore(pinia);
await taskStore.updateData(task);
// Show the task config
taskStore.show();
},
};
48 changes: 48 additions & 0 deletions src/G6/edgeConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import G6, { ShapeOptions } from "@antv/g6";

export const indentedEdge: ShapeOptions = {
afterDraw(_cfg, group) {
const shape = group?.get("children")[0];
shape.attr("stroke", "#656565");
shape.attr("radius", "16");
shape.attr("lineWidth", "2");
},
getControlPoints: (cfg) => {
const startPoint = cfg.startPoint;
const endPoint = cfg.endPoint;
return [
startPoint!,
{
x: startPoint!.x,
y: endPoint!.y,
},
endPoint!,
];
},
};
export const workflowEdge: ShapeOptions = {
draw(cfg, group) {
const { startPoint, endPoint } = cfg;
const r = 3;
const lineWidth = 2;
const keyShape = group.addShape("path", {
attrs: {
path: [
["M", startPoint!.x, startPoint!.y + (r + lineWidth / 2)],
["L", endPoint!.x, endPoint!.y + (r + lineWidth / 2)],
],
// radius: 10,
stroke: "#5A77C1",
lineWidth,
endArrow: {
path: G6.Arrow.circle(r), // 使用内置箭头路径函数,参数为箭头的 宽度、长度、偏移量(默认为 0,与 d 对应)
// d: 25,
fill: "#5A77C1",
},
},
name: "workflow-edge-path-shape",
});
group.toFront();
return keyShape;
},
};
23 changes: 23 additions & 0 deletions src/G6/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import G6 from "@antv/g6";
import {
breakdownNode as breakdownNodeConfig,
workflowNode as workflowNodeConfig,
} from "@/G6/nodeConfig.ts";
import {
indentedEdge as indentedEdgeConfig,
workflowEdge as workflowEdgeConfig,
} from "@/G6/edgeConfig.ts";
import { activateNodeBehavior as activateNodeBehaviorConfig } from "@/G6/behaviorConfig.ts";

export function G6Register() {
// node registration
// G6.registerNode("rootNode", rootNodeConfig, "rect");
// G6.registerNode("treeNode", treeNodeConfig);
G6.registerNode("breakdownNode", breakdownNodeConfig);
G6.registerNode("workflowNode", workflowNodeConfig);
// edge registration
G6.registerEdge("indentedEdge", indentedEdgeConfig, "polyline");
G6.registerEdge("workflowEdge", workflowEdgeConfig);
// behavior registration
G6.registerBehavior("activate-node", activateNodeBehaviorConfig);
}
Loading