我在ubuntu服务器上设置了Gitlab,它运行正常.我通过url http://123.456.789.100和Gitlab登录详细信息访问Gitlab
username:admin@local.host
password:123456
Run Code Online (Sandbox Code Playgroud)
然后我想设置Gitlab CI以在合并之前测试代码.我已经完成了使用链接设置Gitlab CI.我已经完成了除跑步者以外的所有事情.ssh git@<your gitlab url>在Runner中设置时我遇到错误
ssh git@123.456.789.100
it prompts me for password
Run Code Online (Sandbox Code Playgroud)
git@123.456.789.100的密码:我输入了gitlab的密码(123456),我曾经进入gitlab服务器,然后我有这个错误
Permission denied please try again
Run Code Online (Sandbox Code Playgroud)
但我得到了Gitlab CI网页界面http://123.456.789.100:8081(我确实设置了Gitlab-ci来监听8081端口).然后我输入Gitlab服务器的用户名和密码为admin@local.host和123456,我获得了无效的凭据.
我犯了什么错?
我正在获取文本的宽度和getBBox()高度SVG。我的应用程序中有两个按钮,当我单击它时,button1它将显示button2并调用textfuntion(),该函数将显示文本的宽度和高度。当我button2再次单击时textfuntion(),将调用相同的内容并显示文本宽度和高度。在这里,当我单击时,button1我看到getBBox().widthandgetBBox().width是 0。如果我单击button2,我看到getBBox().widthandgetBBox().width是 23 和 40 取决于文本。
即使两个按钮调用相同的函数,我也只能通过而button2不是通过button1什么来获取值?
更新:我已经检查了元素的ClientWidth和,这些值也是 0 直到我单击。单击 时,和都为 0 。ClientHeighttextbutton2button1ClientWidthClientHeight
我想if在javascript中动态创建语句的条件,
检查我的代码
var t = ['b','a']
if(t[0] !== 'a' && t[1] !== 'a'){console.log('remaining element')}
Run Code Online (Sandbox Code Playgroud)
在这里t可能会随时变化t = ['b','a','c']然后我需要写这样的条件
if(t[0] !== 'a' && t[1] !== 'a' && t[2] !== 'a'){console.log('remaining element')}
Run Code Online (Sandbox Code Playgroud)
我怎样才能有效地重写这段代码?
当用户将鼠标悬停在折线图上时,我希望在折线图上有工具提示和小圆圈.这是我的折线图代码.
<!DOCTYPE html>
<style>
body {
font: 10px sans-serif;
}
.axis path,
.axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
div.circle{
border-radius: 50%;
width: 30px;
height: 30px;
}
</style>
<html>
<head>
<script type="text/javascript" src="d3.v3.min.js"></script>
</head>
<body>
<script type="text/javascript">
data = [
{date: 1,temp:10},{date: 2,temp:40},{date: 3,temp:90},
{date: 4,temp:30},{date: 5,temp:20},{date: 6,temp:10}
];
var margin = {top: 20,left: 30, bottom: 30,right: 40},
height = 500 - margin.top - margin.bottom,
width = 900 - margin.left - margin.right;
var x = d3.time.scale()
.range([0,width]); …Run Code Online (Sandbox Code Playgroud)