Skip to content
Snippets Groups Projects
Commit 4f2e0942 authored by Zitnik, Anze's avatar Zitnik, Anze
Browse files

v0.1.6 - initial commit on public

parents
Branches
No related tags found
No related merge requests found
Pipeline #82162 canceled
VUE_APP_API="http://localhost:8080"
\ No newline at end of file
VUE_APP_API="<<CCE_API_URL>>"
.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?
image: nexus-registry.xlab.si:5001/docker:stable
variables:
REGISTRY: registry-gitlab.xlab.si
MEDINA_REGISTRY: optima-medina-docker-dev.artifact.tecnalia.com
MEDINA_REG_PATH: wp4/t41
stages:
- build
- push
- deploy
before_script:
- mkdir -p $HOME/.docker
- echo "$DOCKER_AUTH_CONFIG" > $HOME/.docker/config.json
- export SERVICE=cce-frontend
- export VERSION=$(grep -w "version" package.json | cut -d ':' -f 2 | cut -d ',' -f 1 | xargs echo)
build:
stage: build
script: docker build --no-cache -t $REGISTRY/medina/$SERVICE:$VERSION .
push:
stage: push
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $REGISTRY
- docker tag $REGISTRY/medina/$SERVICE:$VERSION $REGISTRY/medina/$SERVICE:latest
- docker push $REGISTRY/medina/$SERVICE:$VERSION
- docker push $REGISTRY/medina/$SERVICE:latest
- docker logout $REGISTRY
- docker login $MEDINA_REGISTRY -u medina.fordevelopers@gmail.com -p --password--
- docker tag $REGISTRY/medina/$SERVICE:$VERSION $MEDINA_REGISTRY/$MEDINA_REG_PATH/$SERVICE:$VERSION
- docker tag $REGISTRY/medina/$SERVICE:$VERSION $MEDINA_REGISTRY/$MEDINA_REG_PATH/$SERVICE:latest
- docker push $MEDINA_REGISTRY/$MEDINA_REG_PATH/$SERVICE:$VERSION
- docker push $MEDINA_REGISTRY/$MEDINA_REG_PATH/$SERVICE:latest
- docker logout $MEDINA_REGISTRY
only:
- master
deploy:
stage: deploy
script:
- docker run --rm curlimages/curl -I -X POST "https://xlab:--pasword--@cicd.medina.esilab.org/jenkins/job/medina/job/wp4/job/task_4.1/job/cce-deploy/buildWithParameters?PRJ_ENV=dev&PRJ_IMAGE_TAG=latest&YAMLS_OVERRIDE="
only:
- master
worker_processes 4;
events {
worker_connections 1024;
}
http {
server {
listen 80;
root /usr/share/nginx/html;
include /etc/nginx/mime.types;
add_header Access-Control-Allow-Origin *;
location / {
try_files $uri /index.html;
}
}
}
\ No newline at end of file
# build stage
FROM node:lts-alpine as build-stage
WORKDIR /app
# Copy the package.json and install dependencies
COPY package*.json ./
RUN npm install
# Copy rest of the files
COPY . .
# Build the project
RUN npm run build
# production stage
FROM nginx:stable-alpine as production-stage
COPY ./.nginx/nginx.conf /etc/nginx/nginx.conf
# Remove default nginx index page
RUN rm -rf /usr/share/nginx/html/*
# Copy from build stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY --from=build-stage /app/entrypoint.sh /root
RUN chmod u+x /root/entrypoint.sh
EXPOSE 80
CMD /root/entrypoint.sh
\ No newline at end of file
LICENSE 0 → 100644
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2021 MEDINA
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
# cce-frontend
## Project setup
### Install dependencies
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
## Docker
### Docker build
```
docker build -t registry-gitlab.xlab.si/medina/cce-frontend .
```
### Docker run
```
docker run -p 8081:80 registry-gitlab.xlab.si/medina/cce-frontend:latest
```
## Versioning
Before pushing to master check if version needs to be updated in [package.json](package.json#L3).
This version is also used for tagging docker image at CI.
## Setting API URL
You can set the API URL using the `CCE_API_URL` environment variable.
By default (if unset) the URL used is MEDINA k8s dev deploy: https://cce-api-dev.k8s.medina.esilab.org
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
};
URL="${CCE_API_URL:-https://cce-api-dev.k8s.medina.esilab.org}"
sed -i "s|<<CCE_API_URL>>|${CCE_API_URL}|" /usr/share/nginx/html/js/app.*.js
nginx -g 'daemon off;'
Source diff could not be displayed: it is too large. Options to address this: view the blob.
{
"name": "cce-frontend",
"version": "0.1.6",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"engines": {
"npm": ">= 8.11.0",
"node": ">= 16.15.1"
},
"overrides": {
"autoprefixer": "10.4.5"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^6.1.1",
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-brands-svg-icons": "^6.1.1",
"@fortawesome/free-regular-svg-icons": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@ssthouse/vue3-tree-chart": "^0.1.0",
"axios": "^0.27.2",
"bootstrap": "^5.1.3",
"bootstrap-vue-3": "^0.1.13",
"core-js": "^3.23.1",
"eslint-plugin-vue": "^9.1.1",
"jquery": "^3.6.0",
"moment": "^2.29.3",
"vue": "^3.2.37",
"vue-axios": "^3.4.1",
"vue-router": "^4.0.16",
"vuex": "^4.0.2"
},
"devDependencies": {
"@babel/eslint-parser": "^7.18.2",
"@vue/cli-plugin-babel": "~5.0.6",
"@vue/cli-plugin-eslint": "~5.0.6",
"@vue/cli-service": "~5.0.6",
"@vue/compiler-sfc": "^3.2.37",
"eslint": "^8.17.0",
"@vue/eslint-config-prettier": "^7.0.0",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.7.1",
"sass": "^1.52.3",
"sass-loader": "^13.0.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/prettier"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {
"vue/multi-word-component-names": 0
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
public/favicon.ico

4.19 KiB

<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<router-view></router-view>
</template>
<script>
export default {
name: "App",
components: {},
};
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
background: #f3f8fb;
padding: 60px;
height: 100vh;
}
</style>
import axios from "axios";
const client = axios.create({
baseURL: process.env.VUE_APP_API,
timeout: 8000,
headers: {
"Content-Type": "application/json",
},
});
export default client;
<template>
<div class="container">
<div class="box info-box" v-show="hoveredNode">
<div class="close-button">
<i @click="infoBoxClose" title="Close" class="fa fa-solid fa-xmark"></i>
</div>
<p v-if="hoveredNode?.name != null">
<b>Name:</b> {{ hoveredNode.name }}
</p>
<p v-if="hoveredNode?.state == 'UNSET'">
<b>State:</b> No evidence obtained
</p>
<p v-if="hoveredNode?.state == 'UNSELECTED'"><b>State:</b> Unselected</p>
<p v-if="hoveredNode?.state == 'SET' && hoveredNode?.conformant">
<b>State:</b> Compliant
</p>
<p v-if="hoveredNode?.state == 'SET' && !hoveredNode?.conformant">
<b>State:</b> Non compliant
</p>
<p
v-if="hoveredNode?.code != null && hoveredNode.code != hoveredNode.name"
>
<b>Code:</b> {{ hoveredNode.code }}
</p>
<p v-if="hoveredNode?.timestamp != null">
<b>Timestamp:</b> {{ formatDate(hoveredNode.timestamp) }}
</p>
<p v-if="hoveredNode?.id != null">
<b>Assesment result id:</b> {{ hoveredNode.id }}
</p>
<p v-if="hoveredNode?.metricId != null">
<b>Metric id:</b> {{ hoveredNode.metricId }}
</p>
<p v-if="hoveredNode?.assessmentResult != null">
<b>Assessment result:</b> {{ hoveredNode.assessmentResult }}
</p>
<p v-if="hoveredNode?.evidenceId != null">
<b>Evidence id:</b> {{ hoveredNode.evidenceId }}
</p>
<p v-if="hoveredNode?.targetValue != null">
<b>Target value:</b> {{ hoveredNode.targetValue }}
</p>
<p v-if="hoveredNode?.noncomplianceComments != null">
<b>Noncompliance comments:</b> {{ hoveredNode.noncomplianceComments }}
</p>
<p v-if="hoveredNode?.value != null">
<b>Value:</b> {{ hoveredNode.value }}
</p>
<p v-if="hoveredNode?.weight != null">
<b>Weight:</b> {{ hoveredNode.weight }}
</p>
<p v-if="hoveredNode?.threshold != null">
<b>Threshold:</b> {{ hoveredNode.threshold }}
</p>
<p v-if="hoveredNode?.resource?.id != null">
<b>Resource id:</b> {{ hoveredNode.resource.id }}
</p>
<p v-if="hoveredNode?.resource?.resourceType != null">
<b>Resource type:</b> {{ hoveredNode.resource.resourceType }}
</p>
<p v-if="hoveredNode?.resource?.weight != null">
<b>Resource weight:</b> {{ hoveredNode.resource.weight }}
</p>
<p v-if="hoveredNode?.description != null">
<b>Description:</b> {{ hoveredNode.description }}
</p>
</div>
<div>
<span class="btn-group">
<button class="btn btn-outline-primary" @click="controlScale('bigger')">
Zoom in
</button>
<button
class="btn btn-outline-primary"
@click="controlScale('smaller')"
>
Zoom out
</button>
<button
class="btn btn-outline-primary"
@click="controlScale('restore')"
>
Reset zoom
</button>
</span>
<span class="btn-group">
<button class="btn btn-outline-primary" @click="collapseAll">
Collapse all
</button>
<button class="btn btn-outline-primary" @click="expandAll">
Expand all
</button>
</span>
<span class="btn-group">
<button class="btn btn-outline-success" @click="toogleInstructions">
Instructions
</button>
</span>
</div>
<div class="box" id="instructions" v-show="showInstructions">
<div class="close-button">
<i
@click="toogleInstructions"
title="Close"
class="fa fa-solid fa-xmark"
></i>
</div>
<ul>
<li><b>left click:</b> hide/show node children</li>
<li><b>right click:</b> permanently open node details</li>
</ul>
</div>
<vue-tree
v-if="treeData"
ref="scaleTree"
style="width: 100%; height: 900px; border: 1px solid gray"
:dataset="treeData"
:config="treeConfig"
:collapse-enabled="true"
>
<template v-slot:node="{ node, collapsed }">
<div
class="rich-media-node"
:class="{
'node-unselected': node.state == 'UNSELECTED',
'node-unset': node.state == 'UNSET',
'node-set-conformant': node.state == 'SET' && node.conformant,
'node-set-unconformant': node.state == 'SET' && !node.conformant,
}"
:style="{ border: collapsed ? '3px solid black' : '' }"
@mouseover="infoBoxTemporarilyShow(node, $event.target)"
@mouseleave="infoBoxHide($event.target)"
@mousedown.right="infoBoxPermanentlyShowed(node, $event.target)"
@contextmenu.prevent
>
<span
style="
padding: 4px 0;
font-weight: bold;
word-break: break-word;
overflow-wrap: break-word;
"
>{{ node.name }}</span
>
</div>
</template>
</vue-tree>
</div>
</template>
<script>
import VueTree from "@ssthouse/vue3-tree-chart";
import "@ssthouse/vue3-tree-chart/dist/vue3-tree-chart.css";
import { formatDateHelper } from "@/helpers/dataFormat";
import $ from "jquery";
import { collapseExpandTree } from "@/mixins/collapseExpandTree";
export default {
name: "Tree",
components: {
"vue-tree": VueTree,
},
props: ["treeData"],
mixins: [collapseExpandTree],
data() {
return {
treeConfig: { nodeWidth: 230, nodeHeight: 80, levelHeight: 200 },
hoveredNode: null,
infoBoxPermanentlyShowedNodeElement: null,
showInstructions: false,
};
},
methods: {
controlScale(command) {
switch (command) {
case "bigger":
this.$refs.scaleTree.zoomIn();
break;
case "smaller":
this.$refs.scaleTree.zoomOut();
break;
case "restore":
this.$refs.scaleTree.restoreScale();
break;
}
},
infoBoxShow(node) {
this.hoveredNode = node;
},
infoBoxHide(el) {
if (!this.infoBoxPermanentlyShowedNodeElement) {
$(el).removeClass("selected");
this.hoveredNode = null;
}
},
infoBoxTemporarilyShow(node, el) {
if (!this.infoBoxPermanentlyShowedNodeElement) {
$(el).parent().addClass("selected");
this.infoBoxShow(node);
}
},
infoBoxPermanentlyShowed(node, el) {
if (this.infoBoxPermanentlyShowedNodeElement != null) {
this.infoBoxPermanentlyShowedNodeElement.removeClass("selected");
}
this.infoBoxPermanentlyShowedNodeElement = $(el).parent();
$(el).parent().addClass("selected");
this.infoBoxShow(node);
},
infoBoxClose() {
var el = this.infoBoxPermanentlyShowedNodeElement;
this.infoBoxPermanentlyShowedNodeElement = null;
this.infoBoxHide(el);
},
collapseAll() {
this.collapseRecursively(this.$refs.scaleTree.nodeDataList[0].data);
this.$refs.scaleTree.draw();
},
expandAll() {
this.expandRecursively(this.$refs.scaleTree.nodeDataList[0].data);
this.$refs.scaleTree.draw();
},
toogleInstructions() {
this.showInstructions = !this.showInstructions;
},
formatDate(date) {
return formatDateHelper(date);
},
},
};
</script>
<style scoped lang="scss">
@import "@/styles/_variables.scss";
.container {
display: flex;
flex-direction: column;
align-items: center;
max-width: 5000px;
}
.tree-container {
background: white;
margin-top: 20px;
}
.rich-media-node {
width: auto;
max-width: 200px;
margin: 8px;
padding: 8px;
display: flex;
flex-direction: column;
align-items: flex-start;
text-align: center;
justify-content: center;
color: black;
border-radius: 4px;
font-size: 14px;
}
.box {
p {
padding: 0px 10px;
}
padding-top: 10px;
position: fixed;
top: 134px;
min-width: 340px;
background-color: white;
border: 1px solid;
border-radius: 0;
font-size: 14px;
text-align: left;
max-width: 25%;
.close-button {
font-size: 20px;
text-align: right;
padding-right: 14px;
}
&.info-box {
border-color: $color-blue;
z-index: 10;
left: 72px;
}
&#instructions {
border-color: $color-green;
z-index: 11;
}
}
.btn-group {
margin: 3px 3px;
.btn {
margin: 5px 5px;
}
}
.node-unset {
background-color: $node-yellow-background;
&.selected {
background-color: $node-yellow-dark-background;
}
}
.node-set-conformant {
background-color: $node-green-background;
&.selected {
background-color: $node-green-dark-background;
}
}
.node-set-unconformant {
background-color: $node-red-background;
&.selected {
background-color: $node-red-dark-background;
}
}
.node-unselected {
background-color: $node-gray-background;
&.selected {
background-color: $node-gray-dark-background;
}
}
</style>
import moment from "moment";
export function formatDateHelper(value) {
if (value) {
return moment(String(value)).format("DD MMM YYYY HH:mm:ss");
}
}
import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "@/store";
import axios from "axios";
import VueAxios from "vue-axios";
import BootstrapVue3 from "bootstrap-vue-3";
import "bootstrap/dist/css/bootstrap.css";
import "bootstrap-vue-3/dist/bootstrap-vue-3.css";
import { dom } from "@fortawesome/fontawesome-svg-core";
dom.watch();
import "@fortawesome/fontawesome-free/css/all.css";
const app = createApp(App);
app.use(router);
app.use(store);
app.use(VueAxios, axios);
app.use(BootstrapVue3);
app.mount("#app");
export const collapseExpandTree = {
methods: {
collapseRecursively(node) {
if (!node.children) {
return;
}
node.children.forEach((i) => {
this.collapseRecursively(i);
});
node._children = node.children;
node.children = null;
node._collapsed = true;
},
collapseAllFromLevel(node, level) {
if (level <= 0) {
this.collapseRecursively(node);
} else {
node.children?.forEach((i) => {
this.collapseAllFromLevel(i, level - 1);
});
}
},
expandRecursively(node) {
if (node._children) {
node.children = node._children;
node._children = null;
node._collapsed = false;
}
node.children?.forEach((n) => {
this.expandRecursively(n);
});
},
},
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment