From 510f5d657aee5429730685ebcb5b059ffcbb9165 Mon Sep 17 00:00:00 2001
From: alex <alex@alexloehr.net>
Date: Tue, 03 Jun 2025 07:33:15 +0000
Subject: [PATCH] adding vue
---
lib/db.js | 1
app.js | 3
package-lock.json | 135 +++++++++++++++++++++++++++++++++
vue/src/App.vue | 43 +---------
package.json | 5 +
5 files changed, 150 insertions(+), 37 deletions(-)
diff --git a/app.js b/app.js
index 03ff46e..7507ec0 100644
--- a/app.js
+++ b/app.js
@@ -51,6 +51,9 @@
})
.get("/user/userid/:userid", async function (req, res) {
const {userid} = req.params
+ if(!userid || isNaN(Number(userid))) {
+ return res.code(500).send({status: "error", msg: "userid error"})
+ }
const user = await db.getUserByUserId(userid)
if (user) {
return res.send(user)
diff --git a/lib/db.js b/lib/db.js
index c8ee70e..aeb5b6b 100644
--- a/lib/db.js
+++ b/lib/db.js
@@ -155,6 +155,7 @@
}
async function joinUDF (user) {
+ if(!user) return user
const fields = await getUserDefinedField(user.usr_id)
for (const field of fields) {
user[field.field_name] = field.value
diff --git a/package-lock.json b/package-lock.json
index 1d7de9c..9c594d9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14,6 +14,7 @@
"mysql2": "^3.14.1",
"nconf": "^0.13.0",
"nodemon": "^3.1.10",
+ "stylus": "^0.64.0",
"vue": "^3.5.13",
"yargs": "^15.4.1"
},
@@ -22,6 +23,12 @@
"vite": "^6.2.4",
"vite-plugin-vue-devtools": "^7.7.2"
}
+ },
+ "node_modules/@adobe/css-tools": {
+ "version": "4.3.3",
+ "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.3.tgz",
+ "integrity": "sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==",
+ "license": "MIT"
},
"node_modules/@ampproject/remapping": {
"version": "2.3.0",
@@ -1266,6 +1273,16 @@
"license": "MIT",
"engines": {
"node": ">=8"
+ }
+ },
+ "node_modules/@pkgjs/parseargs": {
+ "version": "0.11.0",
+ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
+ "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=14"
}
},
"node_modules/@polka/url": {
@@ -3922,6 +3939,12 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"license": "MIT"
},
+ "node_modules/sax": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz",
+ "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==",
+ "license": "ISC"
+ },
"node_modules/secure-json-parse": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-4.0.0.tgz",
@@ -4048,6 +4071,15 @@
"atomic-sleep": "^1.0.0"
}
},
+ "node_modules/source-map": {
+ "version": "0.7.4",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz",
+ "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
"node_modules/source-map-js": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
@@ -4161,6 +4193,109 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/stylus": {
+ "version": "0.64.0",
+ "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.64.0.tgz",
+ "integrity": "sha512-ZIdT8eUv8tegmqy1tTIdJv9We2DumkNZFdCF5mz/Kpq3OcTaxSuCAYZge6HKK2CmNC02G1eJig2RV7XTw5hQrA==",
+ "license": "MIT",
+ "dependencies": {
+ "@adobe/css-tools": "~4.3.3",
+ "debug": "^4.3.2",
+ "glob": "^10.4.5",
+ "sax": "~1.4.1",
+ "source-map": "^0.7.3"
+ },
+ "bin": {
+ "stylus": "bin/stylus"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "funding": {
+ "url": "https://opencollective.com/stylus"
+ }
+ },
+ "node_modules/stylus/node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/stylus/node_modules/glob": {
+ "version": "10.4.5",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz",
+ "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==",
+ "license": "ISC",
+ "dependencies": {
+ "foreground-child": "^3.1.0",
+ "jackspeak": "^3.1.2",
+ "minimatch": "^9.0.4",
+ "minipass": "^7.1.2",
+ "package-json-from-dist": "^1.0.0",
+ "path-scurry": "^1.11.1"
+ },
+ "bin": {
+ "glob": "dist/esm/bin.mjs"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/stylus/node_modules/jackspeak": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",
+ "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "@isaacs/cliui": "^8.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ },
+ "optionalDependencies": {
+ "@pkgjs/parseargs": "^0.11.0"
+ }
+ },
+ "node_modules/stylus/node_modules/lru-cache": {
+ "version": "10.4.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
+ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
+ "license": "ISC"
+ },
+ "node_modules/stylus/node_modules/minimatch": {
+ "version": "9.0.5",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
+ "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
+ "license": "ISC",
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/stylus/node_modules/path-scurry": {
+ "version": "1.11.1",
+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
+ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "lru-cache": "^10.2.0",
+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
"node_modules/superjson": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/superjson/-/superjson-2.2.2.tgz",
diff --git a/package.json b/package.json
index 943836c..ac3f25e 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,9 @@
"main": "app.js",
"scripts": {
"start": "node app.js",
- "dev": "nodemon app.js"
+ "dev": "nodemon app.js",
+ "dev-ui": "vite",
+ "build": "vite build"
},
"dependencies": {
"@fastify/static": "^8.2.0",
@@ -16,6 +18,7 @@
"mysql2": "^3.14.1",
"nconf": "^0.13.0",
"nodemon": "^3.1.10",
+ "stylus": "^0.64.0",
"vue": "^3.5.13",
"yargs": "^15.4.1"
},
diff --git a/vue/src/App.vue b/vue/src/App.vue
index 633a5df..99b82c6 100644
--- a/vue/src/App.vue
+++ b/vue/src/App.vue
@@ -1,47 +1,18 @@
<script setup>
-import HelloWorld from './components/HelloWorld.vue'
-import TheWelcome from './components/TheWelcome.vue'
</script>
<template>
- <header>
- <img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" />
- <div class="wrapper">
- <HelloWorld msg="You did it!" />
- </div>
- </header>
+ <header>
+ <h1>globus-ilias-rest UI</h1>
+ </header>
- <main>
- <TheWelcome />
- </main>
+ <main>
+ </main>
+
</template>
-<style scoped>
-header {
- line-height: 1.5;
-}
+<style scoped lang="stylus">
-.logo {
- display: block;
- margin: 0 auto 2rem;
-}
-@media (min-width: 1024px) {
- header {
- display: flex;
- place-items: center;
- padding-right: calc(var(--section-gap) / 2);
- }
-
- .logo {
- margin: 0 2rem 0 0;
- }
-
- header .wrapper {
- display: flex;
- place-items: flex-start;
- flex-wrap: wrap;
- }
-}
</style>
--
Gitblit v1.8.0