这是一个React项目,我正在尝试将XML转换为MxGraph。
PFB:-我有的代码
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import {
mxGraph,
mxRubberband,
mxKeyHandler,
mxClient,
mxUtils,
mxEvent
} from 'mxgraph-js'
// import axios from 'axios'
import parser from 'fast-xml-parser'
import '../../common.css'
import '../../mxgraph.css'
class mxGraphGridAreaEditor extends Component {
constructor (props) {
super(props)
this.state = {
graph: {},
layout: {},
json: '',
dragElt: null,
createVisile: false,
currentNode: null,
currentTask: ''
}
this.LoadGraph = this.LoadGraph.bind(this)
}
componentDidMount () {
const xml = `<mxGraphModel dx='2221' dy='774' grid='1' gridSize='10' guides='1' …Run Code Online (Sandbox Code Playgroud) 我正在创建我网站的 about 部分,并在一些文本之外放置了一个图像,现在当我缩小屏幕尺寸时,图像由于某种原因没有占据包含的整个高度<div>..请检查小提琴并帮助我理解这样做的原因。
边框会显示底部的间隙,我不想显示。
请注意,我也为项目连接了引导程序,但我没有在本节中使用它。
感谢大家的期待
我正在开发一个 NextJS 项目,我想使用 github webhook 来部署具有部署说明的脚本。
我在 github 中设置了一个推送 webhook
我尝试在 server.ts 文件中添加以下代码,现在使用 ngrok 进行测试
// testing
server.post("/webhooks/github", function(req, res) {
var sender = req.body.sender;
var branch = req.body.ref;
if (branch.indexOf("master") > -1 && sender.login === githubUsername) {
deploy(res);
}
});
function deploy(res: any) {
childProcess.exec("sh deploy.sh", function(err, stdout, stderr) {
if (err) {
console.error(err, stderr);
return res.send(500);
}
console.log(stdout);
res.send(200);
});
}
Run Code Online (Sandbox Code Playgroud)
这个文件是我的 nextJS 应用程序的节点文件
但是我的 ngrok 日志中收到 502
我想知道我应该将此 webhook 端点放在我的 NextJS 应用程序中的哪个位置才能使其正常工作
我正在尝试验证一个有电话号码的表格,我们希望它正好是10位数.但即使输入正确,它也会出错.我在控制器中使用以下代码,因此请告知需要更改的内容.
public function tytraining(Request $request)
{
$this->validate($request, [
'txt_name' => 'required',
'txt_email' => 'required|email',
'txt_phone' => 'required|numeric|between:9,11'
]);
$name = Input::get('txt_name');
$email = Input::get('txt_email');
$phone = Input::get('txt_phone');
$type = "bls-training";
$url = '?' . Input::get('url');
$medicalRequest = new ParseObject("MedicalRequest");
$medicalRequest->set("name", $name);
$medicalRequest->set("email", $email);
$medicalRequest->set("phone", $phone);
$medicalRequest->set("type", $type);
$medicalRequest->set("requestMessage", "training");
$medicalRequest->set("url", $url);
try {
$medicalRequest->save();
} catch (ParseException $ex) {
echo(' Some Error Occured');
}
}
Run Code Online (Sandbox Code Playgroud)
请告知我应该如何通过Laravel进行验证.
提前感谢大家花费宝贵的时间,关心并帮助我.
我想以编程方式从我的存储桶中删除文件,但它没有发生
我有下面的代码
$s3 = \Storage::disk('s3');
$existingImagePath = $studentPortfolios[$i]->portfolio_link; // this returns the path of the file stored in the db
$s3->delete($existingImagePath);
Run Code Online (Sandbox Code Playgroud)
但这并不是从存储桶中删除文件
当我从本地设置运行它时,我必须暂时为每个人向存储桶写入对象权限。
请注意:- 我可以上传文件,但删除不起作用
对此的任何建议都会非常有帮助。