test floatingips reverse dns submission
@ -19,6 +19,7 @@ const webpack = require('webpack');
|
||||
const merge = require('webpack-merge');
|
||||
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
||||
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
|
||||
const Dotenv = require('dotenv-webpack'); // Import the plugin
|
||||
|
||||
const common = require('./webpack.common');
|
||||
|
||||
@ -177,6 +178,11 @@ module.exports = (env) => {
|
||||
// Inject environment variables for the project
|
||||
'process.env.API': JSON.stringify(API),
|
||||
}),
|
||||
new Dotenv({
|
||||
// Add this plugin
|
||||
path: root('.env'), // Path to your .env file
|
||||
safe: false, // Optional: Load .env.example for validation
|
||||
}),
|
||||
new HtmlWebPackPlugin({
|
||||
template: root('src/asset/template/index.html'),
|
||||
favicon: root('src/asset/image/favicon.ico'),
|
||||
|
@ -120,6 +120,7 @@
|
||||
"cypress": "6.8.0",
|
||||
"cypress-downloadfile": "^1.2.1",
|
||||
"cypress-file-upload": "^5.0.6",
|
||||
"dotenv-webpack": "^8.1.0",
|
||||
"enzyme": "^3.11.0",
|
||||
"enzyme-adapter-react-16": "^1.15.6",
|
||||
"eslint": "^7.2.0",
|
||||
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 224 KiB After Width: | Height: | Size: 224 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
BIN
skyline_console/static/auth.bundle.1741574895.js.gz
Normal file
1
skyline_console/static/basic.bundle.1741574895.js
Normal file
BIN
skyline_console/static/basic.bundle.1741574895.js.gz
Normal file
1
skyline_console/static/common.bundle.1741574895.js
Normal file
BIN
skyline_console/static/common.bundle.1741574895.js.gz
Normal file
@ -8,5 +8,5 @@
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="text/javascript" src="/runtime.1740491958.js"></script><script type="text/javascript" src="/main.bundle.1740491958.js"></script></body>
|
||||
<script type="text/javascript" src="/runtime.1741574895.js"></script><script type="text/javascript" src="/main.bundle.1741574895.js"></script></body>
|
||||
</html>
|
||||
|
BIN
skyline_console/static/main.bundle.1741574895.js.gz
Normal file
@ -1 +1 @@
|
||||
!function(e){function t(t){for(var n,u,i=t[0],c=t[1],l=t[2],p=0,s=[];p<i.length;p++)u=i[p],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&s.push(o[u][0]),o[u]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(t);s.length;)s.shift()();return a.push.apply(a,l||[]),r()}function r(){for(var e,t=0;t<a.length;t++){for(var r=a[t],n=!0,i=1;i<r.length;i++){var c=r[i];0!==o[c]&&(n=!1)}n&&(a.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={16:0},a=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var a,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+""+({0:"common",1:"vendor",2:"Container",3:"Inctance-HA",4:"auth",5:"base",6:"basic",7:"compute",8:"configuration",9:"container-infra",10:"heat",11:"identity",13:"management",14:"monitor-center",15:"network",17:"share",18:"storage",19:"user-center"}[e]||e)+".bundle.1740491958.js"}(e);var c=new Error;a=function(t){i.onerror=i.onload=null,clearTimeout(l);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+a+")",c.name="ChunkLoadError",c.type=n,c.request=a,r[1](c)}o[e]=void 0}};var l=setTimeout((function(){a({type:"timeout",target:i})}),12e4);i.onerror=i.onload=a,document.head.appendChild(i)}return Promise.all(t)},u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/",u.oe=function(e){throw e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var f=c;r()}([]);
|
||||
!function(e){function t(t){for(var n,u,i=t[0],c=t[1],l=t[2],p=0,s=[];p<i.length;p++)u=i[p],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&s.push(o[u][0]),o[u]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(t);s.length;)s.shift()();return a.push.apply(a,l||[]),r()}function r(){for(var e,t=0;t<a.length;t++){for(var r=a[t],n=!0,i=1;i<r.length;i++){var c=r[i];0!==o[c]&&(n=!1)}n&&(a.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={16:0},a=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var a,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+""+({0:"common",1:"vendor",2:"Container",3:"Inctance-HA",4:"auth",5:"base",6:"basic",7:"compute",8:"configuration",9:"container-infra",10:"heat",11:"identity",13:"management",14:"monitor-center",15:"network",17:"share",18:"storage",19:"user-center"}[e]||e)+".bundle.1741574895.js"}(e);var c=new Error;a=function(t){i.onerror=i.onload=null,clearTimeout(l);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+a+")",c.name="ChunkLoadError",c.type=n,c.request=a,r[1](c)}o[e]=void 0}};var l=setTimeout((function(){a({type:"timeout",target:i})}),12e4);i.onerror=i.onload=a,document.head.appendChild(i)}return Promise.all(t)},u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/",u.oe=function(e){throw e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var f=c;r()}([]);
|
BIN
skyline_console/static/vendor.bundle.1741574895.js.gz
Normal file
@ -265,8 +265,8 @@ export class BaseLayout extends Component {
|
||||
localStorage.getItem('keystone_token')
|
||||
).value;
|
||||
const allowedOrigins = [
|
||||
'https://baha-dev.felcloud.io',
|
||||
'https://demo.felcloud.io',
|
||||
process.env.REACT_APP_BAHA_CONSOLE,
|
||||
process.env.REACT_APP_DEMO_CONSOLE,
|
||||
];
|
||||
allowedOrigins.forEach((origin) => {
|
||||
const message = {
|
||||
|
@ -18,6 +18,7 @@ import globalFloatingIpsStore from 'stores/neutron/floatingIp';
|
||||
import { getQoSPolicyTabs } from 'resources/neutron/qos-policy';
|
||||
import { QoSPolicyStore } from 'stores/neutron/qos-policy';
|
||||
import { qosEndpoint } from 'client/client/constants';
|
||||
import React from 'react';
|
||||
|
||||
export class Edit extends ModalAction {
|
||||
static id = 'edit-floating-ip';
|
||||
@ -29,7 +30,7 @@ export class Edit extends ModalAction {
|
||||
}
|
||||
|
||||
getModalSize() {
|
||||
return qosEndpoint() ? 'large' : 'small';
|
||||
return qosEndpoint() ? 'large' : 'large';
|
||||
}
|
||||
|
||||
get qosEndpoint() {
|
||||
@ -41,9 +42,19 @@ export class Edit extends ModalAction {
|
||||
}
|
||||
|
||||
get defaultValue() {
|
||||
// you gonna get all the floatings Ips from the postmessage ,
|
||||
// filter these floating ips , to match the one , that the user clicked on
|
||||
// get its reverse dnd data , and get it's value
|
||||
const { item } = this.props;
|
||||
const floatingIpsFromMessage = window.floatingIps || [];
|
||||
const matchingIp = floatingIpsFromMessage.find(
|
||||
(ip) => ip.floating_ip_address === item.floating_ip_address
|
||||
);
|
||||
const ptrRecord = matchingIp ? matchingIp.ptr_record : '';
|
||||
return {
|
||||
description: this.item.description,
|
||||
reversedns: ptrRecord,
|
||||
dnsptr: this.item.dnsptr ? this.item.dnsptr : '',
|
||||
...(this.qosEndpoint
|
||||
? {
|
||||
qos_policy_id: {
|
||||
@ -69,10 +80,13 @@ export class Edit extends ModalAction {
|
||||
static allowed = () => Promise.resolve(true);
|
||||
|
||||
onSubmit = (values) => {
|
||||
const { description, qos_policy_id } = values;
|
||||
const { floating_ip_address } = this.item;
|
||||
const userEmail = window.user_email || '';
|
||||
const { description, qos_policy_id, reversedns } = values;
|
||||
const body = {
|
||||
description,
|
||||
};
|
||||
const path = process.env.REACT_APP_BAHA_CONSOLE;
|
||||
if (this.qosEndpoint) {
|
||||
body.qos_policy_id = qos_policy_id
|
||||
? qos_policy_id.selectedRowKeys.length
|
||||
@ -80,6 +94,27 @@ export class Edit extends ModalAction {
|
||||
: null
|
||||
: null;
|
||||
}
|
||||
// Send to Flask app with API key
|
||||
fetch(`${path}/api/reversedns`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-API-Key': `${process.env.REACT_APP_FELCLOUD_API_KEY}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
reversedns,
|
||||
floating_ip_address,
|
||||
user_email: userEmail,
|
||||
}),
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
console.log('Response from Flask:', data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error sending to Flask app:', error);
|
||||
});
|
||||
|
||||
return globalFloatingIpsStore.edit({ id: this.item.id }, body);
|
||||
};
|
||||
|
||||
@ -99,6 +134,18 @@ export class Edit extends ModalAction {
|
||||
tip: t('Choosing a QoS policy can limit bandwidth and DSCP'),
|
||||
display: !!this.qosEndpoint,
|
||||
},
|
||||
{
|
||||
name: 'reversedns',
|
||||
label: 'Reverse DNS',
|
||||
component: (
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Reverse DNS"
|
||||
name="reversedns"
|
||||
className="ant-input"
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,20 @@ export class FloatingIps extends Base {
|
||||
init() {
|
||||
this.store = new FloatingIpStore();
|
||||
this.downloadStore = new FloatingIpStore();
|
||||
|
||||
console.log('youpi');
|
||||
window.addEventListener('message', (event) => {
|
||||
if (
|
||||
(event.origin === process.env.REACT_APP_BAHA_CONSOLE ||
|
||||
event.origin === process.env.REACT_APP_DEMO_CONSOLE) &&
|
||||
event.data.type === 'SET_DATA'
|
||||
) {
|
||||
window.floatingIps = event.data.value.floatingIps;
|
||||
window.user_email = event.data.value.userEmail;
|
||||
console.log('Received floating IPs:', window.floatingIps);
|
||||
}
|
||||
});
|
||||
// we made it to puting the message intercepter in index.jsx
|
||||
}
|
||||
|
||||
get qosEndpoint() {
|
||||
|
@ -114,10 +114,11 @@ export class FlavorStore extends Base {
|
||||
await new Promise((resolve) => {
|
||||
const messageListener = (event) => {
|
||||
if (
|
||||
event.origin === 'https://baha-dev.felcloud.io' &&
|
||||
event.data.type === 'SET_CURRENCY'
|
||||
(event.origin === process.env.REACT_APP_BAHA_CONSOLE ||
|
||||
event.origin === process.env.REACT_APP_DEMO_CONSOLE) &&
|
||||
event.data.type === 'SET_DATA'
|
||||
) {
|
||||
profileCurrency = event.data.value || 'EUR';
|
||||
profileCurrency = event.data.value.currency || 'EUR';
|
||||
window.removeEventListener('message', messageListener);
|
||||
resolve();
|
||||
}
|
||||
@ -127,7 +128,7 @@ export class FlavorStore extends Base {
|
||||
setTimeout(resolve, 1000);
|
||||
});
|
||||
try {
|
||||
const response = await fetch('https://baha-dev.felcloud.io/all_flavors');
|
||||
const response = await fetch(process.env.REACT_APP_BAHA_CONSOLE);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! Status: ${response.status}`);
|
||||
}
|
||||
|
19
yarn.lock
@ -5669,6 +5669,25 @@ dot-prop@^5.2.0:
|
||||
dependencies:
|
||||
is-obj "^2.0.0"
|
||||
|
||||
dotenv-defaults@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/dotenv-defaults/-/dotenv-defaults-2.0.2.tgz#6b3ec2e4319aafb70940abda72d3856770ee77ac"
|
||||
integrity sha512-iOIzovWfsUHU91L5i8bJce3NYK5JXeAwH50Jh6+ARUdLiiGlYWfGw6UkzsYqaXZH/hjE/eCd/PlfM/qqyK0AMg==
|
||||
dependencies:
|
||||
dotenv "^8.2.0"
|
||||
|
||||
dotenv-webpack@^8.1.0:
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/dotenv-webpack/-/dotenv-webpack-8.1.0.tgz#4d66abc4a30395b46a030ebcd125320232b54873"
|
||||
integrity sha512-owK1JcsPkIobeqjVrk6h7jPED/W6ZpdFsMPR+5ursB7/SdgDyO+VzAU+szK8C8u3qUhtENyYnj8eyXMR5kkGag==
|
||||
dependencies:
|
||||
dotenv-defaults "^2.0.2"
|
||||
|
||||
dotenv@^8.2.0:
|
||||
version "8.6.0"
|
||||
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
|
||||
integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==
|
||||
|
||||
duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1"
|
||||
|