diff --git a/app.py b/app.py index 7615ee6..19a5755 100644 --- a/app.py +++ b/app.py @@ -43,6 +43,15 @@ def get_tasks(): }) return jsonify(task_list) +@app.route('/remove_task', methods=['DELETE']) +def remove_task(): + data = request.json + task = Task.get(Task.name == data['name']) + if task.running: + stop_specific_task(task.name) + task.delete_instance() + return jsonify({'message': 'Task removed successfully'}) + @app.route('/stop_scheduler', methods=['GET']) def stop(): stop_scheduler() diff --git a/scheduler-frontend/.gitignore b/scheduler-frontend/.gitignore new file mode 100644 index 0000000..403adbc --- /dev/null +++ b/scheduler-frontend/.gitignore @@ -0,0 +1,23 @@ +.DS_Store +node_modules +/dist + + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/scheduler-frontend/README.md b/scheduler-frontend/README.md new file mode 100644 index 0000000..ffae5af --- /dev/null +++ b/scheduler-frontend/README.md @@ -0,0 +1,24 @@ +# scheduler-frontend + +## Project setup +``` +yarn install +``` + +### Compiles and hot-reloads for development +``` +yarn serve +``` + +### Compiles and minifies for production +``` +yarn build +``` + +### Lints and fixes files +``` +yarn lint +``` + +### Customize configuration +See [Configuration Reference](https://cli.vuejs.org/config/). diff --git a/scheduler-frontend/babel.config.js b/scheduler-frontend/babel.config.js new file mode 100644 index 0000000..e955840 --- /dev/null +++ b/scheduler-frontend/babel.config.js @@ -0,0 +1,5 @@ +module.exports = { + presets: [ + '@vue/cli-plugin-babel/preset' + ] +} diff --git a/scheduler-frontend/jsconfig.json b/scheduler-frontend/jsconfig.json new file mode 100644 index 0000000..4aafc5f --- /dev/null +++ b/scheduler-frontend/jsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "esnext", + "baseUrl": "./", + "moduleResolution": "node", + "paths": { + "@/*": [ + "src/*" + ] + }, + "lib": [ + "esnext", + "dom", + "dom.iterable", + "scripthost" + ] + } +} diff --git a/scheduler-frontend/package.json b/scheduler-frontend/package.json new file mode 100644 index 0000000..880b83e --- /dev/null +++ b/scheduler-frontend/package.json @@ -0,0 +1,45 @@ +{ + "name": "scheduler-frontend", + "version": "0.1.0", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint" + }, + "dependencies": { + "axios": "^1.7.2", + "core-js": "^3.8.3", + "vue": "^3.2.13", + "vue-axios": "^3.5.2" + }, + "devDependencies": { + "@babel/core": "^7.12.16", + "@babel/eslint-parser": "^7.12.16", + "@vue/cli-plugin-babel": "~5.0.0", + "@vue/cli-plugin-eslint": "~5.0.0", + "@vue/cli-service": "~5.0.0", + "eslint": "^7.32.0", + "eslint-plugin-vue": "^8.0.3" + }, + "eslintConfig": { + "root": true, + "env": { + "node": true + }, + "extends": [ + "plugin:vue/vue3-essential", + "eslint:recommended" + ], + "parserOptions": { + "parser": "@babel/eslint-parser" + }, + "rules": {} + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not dead", + "not ie 11" + ] +} diff --git a/scheduler-frontend/public/favicon.ico b/scheduler-frontend/public/favicon.ico new file mode 100644 index 0000000..df36fcf Binary files /dev/null and b/scheduler-frontend/public/favicon.ico differ diff --git a/scheduler-frontend/public/index.html b/scheduler-frontend/public/index.html new file mode 100644 index 0000000..3e5a139 --- /dev/null +++ b/scheduler-frontend/public/index.html @@ -0,0 +1,17 @@ + + + + + + + + <%= htmlWebpackPlugin.options.title %> + + + +
+ + + diff --git a/scheduler-frontend/src/App.vue b/scheduler-frontend/src/App.vue new file mode 100644 index 0000000..24ca5e0 --- /dev/null +++ b/scheduler-frontend/src/App.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/scheduler-frontend/src/assets/logo.png b/scheduler-frontend/src/assets/logo.png new file mode 100644 index 0000000..f3d2503 Binary files /dev/null and b/scheduler-frontend/src/assets/logo.png differ diff --git a/scheduler-frontend/src/components/HelloWorld.vue b/scheduler-frontend/src/components/HelloWorld.vue new file mode 100644 index 0000000..879051a --- /dev/null +++ b/scheduler-frontend/src/components/HelloWorld.vue @@ -0,0 +1,58 @@ + + + + + + diff --git a/scheduler-frontend/src/main.js b/scheduler-frontend/src/main.js new file mode 100644 index 0000000..095a080 --- /dev/null +++ b/scheduler-frontend/src/main.js @@ -0,0 +1,30 @@ +import { createApp } from 'vue' +import App from './App.vue' +import axios from 'axios' + +const app = createApp(App) + +app.config.globalProperties.$axios = axios + +app.mount('#app') + + + +// import {createSSRApp} from 'vue' +// import axios from 'axios' +// import VueAxios from 'vue-axios' + +// import App from './App.vue' + +// export function createApp() { +// const app = createSSRApp(App) + +// app.use(axios) +// app.use(VueAxios) +// app.config.globalProperties.$axios = axios + + +// return { +// app, +// } +// } \ No newline at end of file diff --git a/scheduler-frontend/vite.config.js b/scheduler-frontend/vite.config.js new file mode 100644 index 0000000..cdf66f5 --- /dev/null +++ b/scheduler-frontend/vite.config.js @@ -0,0 +1,6 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; + +export default defineConfig({ + plugins: [vue()] +}); \ No newline at end of file diff --git a/scheduler-frontend/vue.config.js b/scheduler-frontend/vue.config.js new file mode 100644 index 0000000..910e297 --- /dev/null +++ b/scheduler-frontend/vue.config.js @@ -0,0 +1,4 @@ +const { defineConfig } = require('@vue/cli-service') +module.exports = defineConfig({ + transpileDependencies: true +}) diff --git a/tasks.db b/tasks.db new file mode 100644 index 0000000..d3362d9 Binary files /dev/null and b/tasks.db differ