"fix": "git add . && git commit -m \"fix: %npm_config_name%\" && git status && git tag"
npm run fix --name="text 123"
git init
git remote add <name> <url>
git pull <name>
git checkout <main branch name>
git checkout -b <some name>/git branch <some name>
git status
git add .
git push <remote name> +head
<template>
<div class="doughnut">
<canvas ref="chart"></canvas>
</div>
</template>
<script setup>
import {onMounted, ref} from "vue";
import {
Chart,
DoughnutController,
ArcElement,
} from 'https://cdn.skypack.dev/chart.js@4.2.1';
Chart.register(
DoughnutController,
ArcElement,
);
const chart = ref(null);
const data = {
datasets: [
{
data: [40, 22, 8, 30],
backgroundColor: [
"#F04B92",
"#54B2FD",
"#FFC24B",
"#49EBCE",
],
display: true,
offset: 2,
spacing: -30,
borderColor: "#fff",
borderWidth: 2,
borderRadius: [
{outerStart: 16, outerEnd: 2, innerStart: 16},
{outerStart: 16, outerEnd: 2, innerStart: 16},
{outerStart: 16, outerEnd: 2, innerStart: 16},
{outerStart: 16, outerEnd: 16, innerStart: 16, innerEnd: 16}
],
cutout: "58%",
}
],
labels: false
};
const config = {
type: 'doughnut',
data,
options: {
rotation: 270,
circumference: 180,
maintainAspectRatio: false,
responsive: true,
animation: {
animateRotate: true
}
},
}
onMounted(() => {
const myChart = new Chart(
chart.value,
config
);
const ctx = myChart.canvas.getContext("2d");
ctx.scale(0.8, 0.8);
});
</script>
http://127.0.0.1:40999/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/
.minikube dashboard --port 8888
.minikube dashboard --port 8888
адрес.location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
proxy_pass http://127.0.0.1:40999/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection 'upgrade';
# proxy_set_header Host $host;
# proxy_cache_bypass $http_upgrade;
}
try_files $uri $uri/ =404;
// Get form element
const form = document.querySelector('form');
// Implementation DRY principe, write repeated code into function
const httpRequest = (url, options) => fetch(url, options)
.then(response => response.json())
.then(console.log)
.catch(console.error);
// Create post request options
const postOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
}
};
// Create get request options
const getOptions = {
method: 'get',
headers: {
'Content-Type': 'application/json',
}
};
// Create post request function
const postRequest = data => httpRequest('http://:3000/info/', {
...postOptions,
body: JSON.stringify(data)
});
// Create get request function
const getRequest = _ => fetch('http://:3000/info/', getOptions)
.then(response => response.json())
.then(console.log)
.catch(console.error);
// Create form handler
const formHandler = (e) => {
// End handler after request
e.preventDefault();
// Get data from form
const data = Object.fromEntries(new FormData(e.target).entries());
// Send post request
postRequest(data);
// Send get request
getRequest();
form.classList.remove('open');
popup.classList.remove('popup_open');
}
// Set form handler
form.addEventListener('submit', formHandler);