资讯专栏INFORMATION COLUMN

Linux shell图形界面dialog

Jingbin_ / 3190人阅读

摘要:下的是一个可以创建对话框的工具,每个对话框提供的输出有两种形式将所有输出到,不显示到屏幕使用退出状态码,为,为,为。设置在输入框菜单和复选框中不显示项。在带有滚动条的文本框中显示文件的内容文本框。

Liunx下的dialog是一个可以创建对话框的工具,每个对话框提供的输出有两种形式:1、将所有输出到stderr,不显示到屏幕;2、使用退出状态码,OK为0,NO为1,ESC为255。

通用选项(common options

这个选项用来设置dialog box的背景、颜色和标题等。

--title </b>:指定将在对话框的上方显示的标题字符串。<br><b>--colors</b>:解读嵌入式<b> Z</b>的对话框中的特殊文本序列,序列由下面的字符<b>0-7</b>, <b>b</b>,<b>B</b>, <b>u</b>, <b>U</b>等组成,恢复正常的设置使用<b>n</b>。<br><b>--no-shadow</b>:禁止阴影出现在每个对话框的底部。<br><b>--shadow</b>:出现阴影效果。<br><b>--insecure</b>:输入部件的密码时,使用星号来代表每个字符。<br><b>--no-cancel</b>:设置在输入框、菜单和复选框中不显示<b>cancel</b>项。<br><b>--clear</b>:完成清屏操作,在框体显示结束后,清除框体,这个参数只能多带带使用,不能和别的参数联合使用。<br><b>--ok-label <str></b>:覆盖使用<b>OK</b>按钮标签,换做其它字符。<br><b>--cancel-label <str></b>:功能同上。<br><b>--backtitle <backtitle></b>:指定的<b>backtitle</b>字符串显示在背景顶端。<br><b>--begin <y> <x></b>:指定对话框左上角在屏幕上的坐标。<br><b>--timeout <secs></b>:超时(返回的错误代码),如果用户在指定的时间内没有给出相应动作,就按超时处理。<br><b>--defaultno</b>:使的是默认值<b>yes/no</b>,使用<b>no</b>。<br><b>--sleep <secs></b><br><b>--stderr</b>:以标准错误方式输出。<br><b>--stdout</b>:以标准方式输出。<br><b>--default-item <str></b>:设置在一份清单、表格或菜单中的默认项目,通常在框中的第一项是默认的。</p> <b>窗体类型:</b> <p>常见的对话框控件选项如下所示:</p> <p><b>--calendar</b>:提供了一个日历,让你可以选择日期。<br><b>--checklist</b>:允许你显示一个选项列表,每个选项都可以被多带带的选择(复选框)。<br><b>--from</b>:允许建立一个带标签的文本字段,并要求填写。<br><b>--fselect</b>:提供一个路径,让你选择浏览的文件。<br><b>--gauge</b>:显示一个表,呈现出完成的百分比,就是显示出进度。<br><b>--infobox</b>:显示消息后,(没有等待响应)对话框立刻返回,但不清除屏幕(信息框)。<br><b>--inputbox</b>:让用户输入文本(输入框)。<br><b>--inputmenu</b>:提供一个可供用户编辑的菜单(可编辑的菜单框)。<br><b>--menu</b>:显示一个列表供用户选择(菜单框)。<br><b>--msgbox</b>:显示一条消息,并要求用户选择一个确定按钮(消息框)。<br><b>--pause</b>:显示一个表格用来显示一个指定的暂停期的状态。<br><b>--passwordbox</b>:显示一个输入框,它隐藏文本。<br><b>--passwordfrom</b>:显示一个来源于标签并且隐藏的文本字段。<br><b>--radiolist</b>:提供一个菜单项目组,只有一个项目,可以选择(单选框)。<br><b>--tailbox</b>:在一个滚动窗口文件中使用<b>tail</b>命令来显示文本。<br><b>--tailboxbg</b>:跟<b>tailbox</b>类似,但是在<b>background</b>模式下操作。<br><b>--textbox</b>:在带有滚动条的文本框中显示文件的内容(文本框)。<br><b>--timebox</b>:提供一个窗口,选择小时、分钟、秒。<br><b>--yesno</b>:提供一个带有<b>yes</b>和<b>no</b>按钮的简单信息框(是/否框)。</p> <b>命令示例</b> <b>消息框</b> <p>格式:</p> <pre>dialog --msgbox text height width </pre> <p>例子:</p> <pre>$ dialog --title TESTING --msgbox "this is a test" 10 20 </pre> <b>yesno框</b> <p>格式:</p> <pre>dialog --yesno text height width </pre> <p>例子:</p> <pre>$ dialog --title "yes/no" --no-shadow --yesno "Delete the file /tmp/canjian.txt?" 10 30 </pre> <b>输入框</b> <p>格式:</p> <pre>dialog --inputbox text height width </pre> <p>例子:</p> <pre>$ dialog --title "Input your name" --inputbox "Please input your name:" 10 30 2> /tmp/name.txt </pre> <p>这里的<b>2></b>是将错误信息输出重定向到<b>/tmp/name.txt</b>文件中。</p> <b>密码框</b> <p>格式:</p> <pre>dialog --passwordbox text height width [init] </pre> <p>例子:</p> <pre>$ dialog --title "Password" --passwordbox "Please give a password for the new user:" 10 35 </pre> <p>密码暴露出来不安全,所以通常我们会加上一个安全选项<b>--insecure</b>,将每个字符用<b>*</b>来显示。</p> <pre>$ dialog --title "Password" --insecure --passwordbox "Please give a password for the new user:" 10 30 </pre> <b>文本框</b> <p>格式:</p> <pre>dialog --textbox file height width </pre> <p>例子:</p> <pre>$ dialog --title "The fstab" --textbox /etc/fstab 17 40 </pre> <b>菜单框</b> <p>格式:</p> <pre>dialog --menu text height width menu-height tag1 item1 tag2 item2 … </pre> <p>例子:</p> <pre>$ dialog --title "Pick a choice" --menu "Choose one" 12 35 5 1 "say hello to everyone" 2 "thanks for your support" 3 "exit" </pre> <b>Fselect框(文件选框)</b> <p>格式:</p> <pre>dialog --fselect filepath height width </pre> <p>例子:</p> <pre>$ dialog --title "Pick one file" --fselect /root/ 7 40 </pre> <b>复选框</b> <p>格式:</p> <pre>dialog --checklist "Test" height width menu-height tag1 item1 tag2 item2 … </pre> <p>例子:</p> <pre>$ dialog --backtitle "Checklist" --checklist "Test" 20 50 10 Memory Memory_Size 1 Dsik Disk_Size 2 </pre> <b>显示日历</b> <p>格式:</p> <pre>dialog --calendar "Date" height width day month year </pre> <p>例子:</p> <p>显示当前日期</p> <pre>$ dialog --title "Calendar" --calendar "Date" 5 50 </pre> <p>显示指定日期</p> <pre>$ dialog --title "Calendar" --calendar "Date" 5 50 1 2 2013 </pre> <b>进度框架</b> <p>格式:</p> <pre>dialog --gauge text height width [<percent>] </pre> <p>例子:</p> <p>固定进度显示</p> <pre>$ dialog --title "installation pro" --gauge "installation" 10 30 10 </pre> <p>实时动度进度</p> <pre>$ for i in {1..100} ;do echo $i;done | dialog --title "installation pro" --gauge "installation" 10 30 </pre> <p>编辑一个gauge.sh的脚本,内容如下:</p> <pre>#!/bin/bash declare -i PERCENT=0 ( for I in /etc/*; do if [ $PERCENT -le 100 ];then cp -r $I /tmp/test 2> /dev/null echo "XXX" echo "Copy the file $I ..." echo "XXX" echo $PERCENT fi let PERCENT+=1 sleep 0.1 done ) | dialog --title "coping" --gauge "starting to copy files..." 6 50 0 </pre> <b>from框架(表单)</b> <p>格式:</p> <pre>dialog --form text height width formheight [ label y x item y x flen ilen ] ... </pre> <p>其中:<b>flen</b>表示<b>field length</b>,定义了选定字段中显示的长度;<b>ilen</b>表示<b>input-length</b>, 定义了在外地输入的数据允许的长度。使用<b>up/down</b>(或<b>ctrl/ N</b>,<b>ctrl/ P</b>)在使用领域之间移动,使用<b>tab</b>键在窗口之间切换。</p> <p>例子:</p> <pre>$ dialog --title "Add a user" --form "Please input the infomation of new user:" 12 40 4 "Username:" 1 1 "" 1 15 15 0 "Full name:" 2 1 "" 2 15 15 0 "Home Dir:" 3 1 "" 3 15 15 0 "Shell:" 4 1 "" 4 15 15 0 </pre> <b>综合应用示例</b> <pre>#! /bin/bash yesno() { dialog --title "First screen" --backtitle "Test Program" --clear --yesno "Start this test program or not ? This decesion have to make by you." 16 51 # yes is 0, no is 1 , esc is 255 result=$? if [ $result -eq 1 ] ; then exit 1; elif [ $result -eq 255 ]; then exit 255; fi username; } username() { cat /dev/null >/tmp/test.username dialog --title "Second screen" --backtitle "Test Program" --clear --inputbox "Please input your username (default: hello) " 16 51 "hello" 2>/tmp/test.username result=$? if [ $result -eq 1 ] ; then yesno; elif [ $result -eq 255 ]; then exit 255; fi password; } password() { cat /dev/null >/tmp/test.password dialog --insecure --title "Third screen" --backtitle "Test Program" --clear --passwordbox "Please input your password (default: 123456) " 16 51 "123456" 2>/tmp/test.password result=$? if [ $result -eq 1 ] ; then username; elif [ $result -eq 255 ]; then exit 255; fi occupation; } occupation() { cat /dev/null >/tmp/test.occupation dialog --title "Forth screen" --backtitle "Test Program" --clear --menu "Please choose your occupation: (default: IT)" 16 51 3 IT "The worst occupation" CEO "The best occupation" Teacher "Not the best or worst" 2>/tmp/test.occupation result=$? if [ $result -eq 1 ] ; then password; elif [ $result -eq 255 ]; then exit 255; fi finish; } finish() { dialog --title "Fifth screen" --backtitle "Test Program" --clear --msgbox "Congratulations! The test program has finished! Username: $(cat /tmp/test.username) Password: $(cat /tmp/test.password) Occupation: $(cat /tmp/test.occupation)" 16 51 result=$? if [ $result -eq 1 ] ; then occupation elif [ $result -eq 255 ]; then exit 255; fi } yesno; </pre> <p><br><br>Linux下的dialog工具使用方法</p> </div> <div class="mt-64 tags-seach" > <div class="tags-info"> <a style="width:120px;" title="服务器托管" href="https://www.ucloud.cn/site/product/uhybrid.html">服务器托管</a> <a style="width:120px;" title="私有云" href="https://www.ucloud.cn/site/product/ucloudstack.html">私有云</a> <a style="width:120px;" title="linux安装图形界面" href="https://www.ucloud.cn/yun/tag/linuxanzhuangtuxingjiemian/">linux安装图形界面</a> <a style="width:120px;" title="linux图形界面切换" href="https://www.ucloud.cn/yun/tag/linuxtuxingjiemianqiehuan/">linux图形界面切换</a> <a style="width:120px;" title="linux无图形界面" href="https://www.ucloud.cn/yun/tag/linuxwutuxingjiemian/">linux无图形界面</a> <a style="width:120px;" title="linux转图形界面" href="https://www.ucloud.cn/yun/tag/linuxzhuantuxingjiemian/">linux转图形界面</a> </div> </div> <div class="entry-copyright mb-30"> <p class="mb-15"> 文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。</p> <p>转载请注明本文地址:https://www.ucloud.cn/yun/9049.html</p> </div> <ul class="pre-next-page"> <li class="ellipsis"><a class="hpf" href="https://www.ucloud.cn/yun/9048.html">上一篇:java导致linux负载过高的定位方法</a></li> <li class="ellipsis"><a class="hpf" href="https://www.ucloud.cn/yun/9050.html">下一篇:曾相遇:2015.6</a></li> </ul> </div> <div class="about_topicone-mid"> <h3 class="top-com-title mb-0"><span data-id="0">相关文章</span></h3> <ul class="com_white-left-mid atricle-list-box"> <li> <div class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/15142.html"><b><em>Linux</em> <em>shell</em><em>图形</em><em>界面</em><em>dialog</em></b></a></h2> <p class="ellipsis2 good">摘要:下的是一个可以创建对话框的工具,每个对话框提供的输出有两种形式将所有输出到,不显示到屏幕使用退出状态码,为,为,为。设置在输入框菜单和复选框中不显示项。在带有滚动条的文本框中显示文件的内容文本框。 Liunx下的dialog是一个可以创建对话框的工具,每个对话框提供的输出有两种形式:1、将所有输出到stderr,不显示到屏幕;2、使用退出状态码,OK为0,NO为1,ESC为255。 ...</p> <div class="com_white-left-info"> <div class="com_white-left-infol"> <a href="https://www.ucloud.cn/yun/u-1610.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/16/small_000001610.jpg" alt=""><span class="layui-hide64">Me_Kun</span></a> <time datetime="">2019-06-25 13:23</time> <span><i class="fa fa-commenting"></i>评论0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/33349.html"><b><em>Linux</em>_《<em>Linux</em>命令行与<em>shell</em>脚本编程大全》第十八章学习总结</b></a></h2> <p class="ellipsis2 good">摘要:命令行与脚本编程大全第三版第十八章学习总结第十八章图形化桌面环境中的脚本编程本章内容创建文本菜单创建文本窗口部件添加图形创建文本菜单创建交互式脚本最常用的方法是使用菜单,脚本菜单的核心是命令,命令会根据用户在菜单上的选择来执行特定命令。 时间:2017年12月04日星期一说明:本文部分内容均摘取自书籍《Linux命令行与shell脚本编程大全》,版权归原作者所有。《Linux命令行与s...</p> <div class="com_white-left-info"> <div class="com_white-left-infol"> <a href="https://www.ucloud.cn/yun/u-637.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/06/small_000000637.jpg" alt=""><span class="layui-hide64">liaoyg8023</span></a> <time datetime="">2019-07-01 18:08</time> <span><i class="fa fa-commenting"></i>评论0</span> <span><i class="fa fa-star"></i>收藏1</span> </div> </div> </div> </li> <li> <div class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/37952.html"><b>图解——PyQt4从入门到运用</b></a></h2> <p class="ellipsis2 good">摘要:将程序包装在界面里,可以将输入通过多种途径如文本框弹出路径选择等输入到程序里。将输出通过文本框显示出来将执行信息如如报错信息运行进度通过文本框或进度条显示出来文章安排先介绍安装和配合的使用。 作为一个程序的开发者,我们仅仅需要在相应路径通过命令行就可执行那个程序。但是,不懂行的人不理解这个黑框框的东西,陌生领域任何人都没有安全感,所以他们是拒绝接受一个项目仅仅只是通过一个黑框框来执行的...</p> <div class="com_white-left-info"> <div class="com_white-left-infol"> <a href="https://www.ucloud.cn/yun/u-63.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/00/small_000000063.jpg" alt=""><span class="layui-hide64">史占广</span></a> <time datetime="">2019-07-25 10:25</time> <span><i class="fa fa-commenting"></i>评论0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/33580.html"><b>命令行<em>界面</em> (CLI)、终端 (Terminal)、<em>Shell</em>、TTY,傻傻分不清楚?</b></a></h2> <p class="ellipsis2 good">摘要:终端窗口与虚拟控制台大部分终端模拟器都是在图形用户界面中运行的,但是也有例外。不过不要被它们唬着了,虽然它们并不运行在图形界面中,但其实它们也是终端模拟器的一种。 原文发表在我的 博客 上,欢迎订阅。;) 为什么突然想写这样一篇文章呢?其实是因为在最近计划发布的一篇关于 WSL (Windows Subsystem for Linux) 的博文中,我打算对终端模拟器、Shell 的选择...</p> <div class="com_white-left-info"> <div class="com_white-left-infol"> <a href="https://www.ucloud.cn/yun/u-311.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/03/small_000000311.jpg" alt=""><span class="layui-hide64">woshicixide</span></a> <time datetime="">2019-07-01 18:43</time> <span><i class="fa fa-commenting"></i>评论0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="https://www.ucloud.cn/yun/9888.html"><b><em>Linux</em>_《<em>Linux</em>命令行与<em>shell</em>脚本编程大全》第二章学习总结</b></a></h2> <p class="ellipsis2 good">摘要:控制台终端进入的一种方式是让系统退出图形化桌面模式,进入文本模式。它们分别是和,通常都会默认安装在发行版中。命令行参数的命令行参数非常多。小结为了着手学习命令行,得先能访问命令行。 时间:2017年04月05日 说明:本文部分内容均摘取自书籍《Linux命令行与shell脚本编程大全》,版权归原作者所有。《Linux命令行与shell脚本编程大全》(第三版)第二章学习总结 第二章:走进...</p> <div class="com_white-left-info"> <div class="com_white-left-infol"> <a href="https://www.ucloud.cn/yun/u-1222.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/12/small_000001222.jpg" alt=""><span class="layui-hide64">tuniutech</span></a> <time datetime="">2019-05-29 19:27</time> <span><i class="fa fa-commenting"></i>评论0</span> <span><i class="fa fa-star"></i>收藏1</span> </div> </div> </div> </li> </ul> </div> <div class="topicone-box-wangeditor"> <h3 class="top-com-title mb-64"><span>发表评论</span></h3> <div class="xcp-publish-main flex_box_zd"> <div class="unlogin-pinglun-box"> <a href="javascript:login()" class="grad">登陆后可评论</a> </div> </div> </div> <div class="site-box-content"> <div class="site-content-title"> <h3 class="top-com-title mb-64"><span>0条评论</span></h3> </div> <div class="pages"></ul></div> </div> </div> <div class="layui-col-md4 layui-col-lg3 com_white-right site-wrap-right"> <div class=""> <div class="com_layuiright-box user-msgbox"> <a href="https://www.ucloud.cn/yun/u-1626.html"><img src="https://www.ucloud.cn/yun/data/avatar/000/00/16/small_000001626.jpg" alt=""></a> <h3><a href="https://www.ucloud.cn/yun/u-1626.html" rel="nofollow">Jingbin_</a></h3> <h6>男<span>|</span>高级讲师</h6> <div class="flex_box_zd user-msgbox-atten"> <a href="javascript:attentto_user(1626)" id="attenttouser_1626" class="grad follow-btn notfollow attention">我要关注</a> <a href="javascript:login()" title="发私信" >我要私信</a> </div> <div class="user-msgbox-list flex_box_zd"> <h3 class="hpf">TA的文章</h3> <a href="https://www.ucloud.cn/yun/ut-1626.html" class="box_hxjz">阅读更多</a> </div> <ul class="user-msgbox-ul"> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/123143.html">这5款Python Web APP开发工具,最中意哪一款?</a></h3> <p>阅读 2113<span>·</span>2021-11-12 10:34</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/113631.html">H5多列布局</a></h3> <p>阅读 1350<span>·</span>2019-08-29 16:15</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/113215.html">前端面试中经常问到的问题:如何提高网站性能 总结</a></h3> <p>阅读 2571<span>·</span>2019-08-29 15:17</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/103880.html">Chrome 小恐龙游戏源码探究六 -- 记录游戏分数</a></h3> <p>阅读 1108<span>·</span>2019-08-23 17:09</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/97225.html">请求数据</a></h3> <p>阅读 255<span>·</span>2019-08-23 11:37</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/96565.html">Javascript 运行机制详解,Event Loop</a></h3> <p>阅读 2327<span>·</span>2019-08-23 10:39</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/94596.html">JavaScript工作原理(一):引擎,运行时,调用堆栈</a></h3> <p>阅读 348<span>·</span>2019-08-22 16:43</p></li> <li><h3 class="ellipsis"><a href="https://www.ucloud.cn/yun/92959.html">es String 内部实现逻辑标准</a></h3> <p>阅读 3002<span>·</span>2019-08-22 14:53</p></li> </ul> </div> <!-- 云社区相关服务 --> <div class="com_layuiright-box"> <h3 class="top-com-title"><span>云社区相关服务</span></h3> <div class="community-box flex_box flex_wrap community-box1"> <a href="https://www.ucloud.cn/yun/question/add.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/static/theme/ukd/images/topicone-icon1.png" alt="提问"> <span>提问</span> </a> <a href="https://www.ucloud.cn/yun/article" rel="nofollow"> <img src="https://www.ucloud.cn/yun/static/theme/ukd/images/topicone-icon2.png" alt="学习"> <span>学习</span> </a> <a href="https://www.ucloud.cn/yun/user/vertify.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/static/theme/ukd/images/topicone-icon4.png" alt="认证"> <span>认证</span> </a> <a href="https://www.ucloud.cn/site/product/uhost.html?ytag=seo" rel="nofollow"> <img src="https://www.ucloud.cn/yun/static/theme/ukd/images/topicone-icon5.png" alt="产品"> <span>产品</span> </a> <a href="https://spt.ucloud.cn/30001?ytag=seo" rel="nofollow"> <img src="https://www.ucloud.cn/yun/static/theme/ukd/images/topicone-icon6.png" alt="技术服务"> <span>技术服务</span> </a> <a href="https://spt.ucloud.cn/30001?ytag=seo" rel="nofollow"> <img src="https://www.ucloud.cn/yun/static/theme/ukd/images/topicone-icon3.png" alt="售前咨询"> <span>售前咨询</span> </a> </div> </div> <!-- 文章详情右侧广告--> <div class="com_layuiright-box"> <h6 class="top-com-title"><span>最新活动</span></h6> <div class="com_adbox"> <div class="layui-carousel" id="right-item"> <div carousel-item> <div> <a href="https://www.ucloud.cn/site/product/uhost.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/220620/Z7TLrpAi.png" alt="云服务器"> </a> </div> <div> <a href="https://www.ucloud.cn/site/product/uhybrid.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/220620/MWraMsBh.png" alt="混合云"> </a> </div> <div> <a href="https://www.ucloud.cn/site/product/ucloudstack.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/220620/ifzOxvjW.png" alt="私有云"> </a> </div> <div> <a href="https://www.ucloud.cn/site/product/utrion.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/220620/VDqwC1iN.png" alt="超融合服务器"> </a> </div> <div> <a href="https://www.ucloud.cn/site/product/uhybrid.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/220630/pJwnviKN.png" alt="服务器托管"> </a> </div> <div> <a href="https://www.ucloud.cn/site/product/uxzone.html" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/220630/CDb5uXxp.jpeg" alt="idc机房托管"> </a> </div> <div> <a href="https://www.ucloud.cn/site/active/network.html?ytag=seo" rel="nofollow"> <img src="https://www.ucloud.cn/yun/data/attach/230227/XWsSXmvm.png" alt="专线服务"> </a> </div> </div> </div> </div> <!-- banner结束 --> <div class="adhtml"> </div> <script> $(function(){ $.ajax({ type: "GET", url:"https://www.ucloud.cn/yun/ad/getad/1.html", cache: false, success: function(text){ $(".adhtml").html(text); } }); }) </script> </div> </div> </div> </div> </div> </section> <!-- wap拉出按钮 --> <div class="site-tree-mobile layui-hide"> <i class="layui-icon layui-icon-spread-left"></i> </div> <!-- wap遮罩层 --> <div class="site-mobile-shade"></div> <!--付费阅读 --> <div id="payread"> <div class="layui-form-item">阅读需要支付1元查看</div> <div class="layui-form-item"><button class="btn-right">支付并查看</button></div> </div> <script> var prei=0; $(".site-seo-depict pre").each(function(){ var html=$(this).html().replace("<code>","").replace("</code>","").replace('<code class="javascript hljs" codemark="1">',''); $(this).attr('data-clipboard-text',html).attr("id","pre"+prei); $(this).html("").append("<code>"+html+"</code>"); prei++; }) $(".site-seo-depict img").each(function(){ if($(this).attr("src").indexOf('data:image/svg+xml')!= -1){ $(this).remove(); } }) $("LINK[href*='style-49037e4d27.css']").remove(); $("LINK[href*='markdown_views-d7a94ec6ab.css']").remove(); layui.use(['jquery', 'layer','code'], function(){ $("pre").attr("class","layui-code"); $("pre").attr("lay-title",""); $("pre").attr("lay-skin",""); layui.code(); $(".layui-code-h3 a").attr("class","copycode").html("复制代码 ").attr("onclick","copycode(this)"); }); function copycode(target){ var id=$(target).parent().parent().attr("id"); var clipboard = new ClipboardJS("#"+id); clipboard.on('success', function(e) { e.clearSelection(); alert("复制成功") }); clipboard.on('error', function(e) { alert("复制失败") }); } //$(".site-seo-depict").html($(".site-seo-depict").html().slice(0, -5)); </script> <link rel="stylesheet" type="text/css" href="https://www.ucloud.cn/yun/static/js/neweditor/code/styles/tomorrow-night-eighties.css"> <script src="https://www.ucloud.cn/yun/static/js/neweditor/code/highlight.pack.js" type="text/javascript"></script> <script src="https://www.ucloud.cn/yun/static/js/clipboard.js"></script> <script>hljs.initHighlightingOnLoad();</script> <script> function setcode(){ var _html=''; document.querySelectorAll('pre code').forEach((block) => { var _tmptext=$.trim($(block).text()); if(_tmptext!=''){ _html=_html+_tmptext; console.log(_html); } }); } </script> <script> function payread(){ layer.open({ type: 1, title:"付费阅读", shadeClose: true, content: $('#payread') }); } // 举报 function jupao_tip(){ layer.open({ type: 1, title:false, shadeClose: true, content: $('#jubao') }); } $(".getcommentlist").click(function(){ var _id=$(this).attr("dataid"); var _tid=$(this).attr("datatid"); $("#articlecommentlist"+_id).toggleClass("hide"); var flag=$("#articlecommentlist"+_id).attr("dataflag"); if(flag==1){ flag=0; }else{ flag=1; //加载评论 loadarticlecommentlist(_id,_tid); } $("#articlecommentlist"+_id).attr("dataflag",flag); }) $(".add-comment-btn").click(function(){ var _id=$(this).attr("dataid"); $(".formcomment"+_id).toggleClass("hide"); }) $(".btn-sendartcomment").click(function(){ var _aid=$(this).attr("dataid"); var _tid=$(this).attr("datatid"); var _content=$.trim($(".commenttext"+_aid).val()); if(_content==''){ alert("评论内容不能为空"); return false; } var touid=$("#btnsendcomment"+_aid).attr("touid"); if(touid==null){ touid=0; } addarticlecomment(_tid,_aid,_content,touid); }) $(".button_agree").click(function(){ var supportobj = $(this); var tid = $(this).attr("id"); $.ajax({ type: "GET", url:"https://www.ucloud.cn/yun/index.php?topic/ajaxhassupport/" + tid, cache: false, success: function(hassupport){ if (hassupport != '1'){ $.ajax({ type: "GET", cache:false, url: "https://www.ucloud.cn/yun/index.php?topic/ajaxaddsupport/" + tid, success: function(comments) { supportobj.find("span").html(comments+"人赞"); } }); }else{ alert("您已经赞过"); } } }); }); function attenquestion(_tid,_rs){ $.ajax({ //提交数据的类型 POST GET type:"POST", //提交的网址 url:"https://www.ucloud.cn/yun/favorite/topicadd.html", //提交的数据 data:{tid:_tid,rs:_rs}, //返回数据的格式 datatype: "json",//"xml", "html", "script", "json", "jsonp", "text". //在请求之前调用的函数 beforeSend:function(){}, //成功返回之后调用的函数 success:function(data){ var data=eval("("+data+")"); console.log(data) if(data.code==2000){ layer.msg(data.msg,function(){ if(data.rs==1){ //取消收藏 $(".layui-layer-tips").attr("data-tips","收藏文章"); $(".layui-layer-tips").html('<i class="fa fa-heart-o"></i>'); } if(data.rs==0){ //收藏成功 $(".layui-layer-tips").attr("data-tips","已收藏文章"); $(".layui-layer-tips").html('<i class="fa fa-heart"></i>') } }) }else{ layer.msg(data.msg) } } , //调用执行后调用的函数 complete: function(XMLHttpRequest, textStatus){ postadopt=true; }, //调用出错执行的函数 error: function(){ //请求出错处理 postadopt=false; } }); } </script> <footer> <div class="layui-container"> <div class="flex_box_zd"> <div class="left-footer"> <h6><a href="https://www.ucloud.cn/"><img src="https://www.ucloud.cn/yun/static/theme/ukd//images/logo.png" alt="UCloud (优刻得科技股份有限公司)"></a></h6> <p>UCloud (优刻得科技股份有限公司)是中立、安全的云计算服务平台,坚持中立,不涉足客户业务领域。公司自主研发IaaS、PaaS、大数据流通平台、AI服务平台等一系列云计算产品,并深入了解互联网、传统企业在不同场景下的业务需求,提供公有云、混合云、私有云、专有云在内的综合性行业解决方案。</p> </div> <div class="right-footer layui-hidemd"> <ul class="flex_box_zd"> <li> <h6>UCloud与云服务</h6> <p><a href="https://www.ucloud.cn/site/about/intro/">公司介绍</a></p> <p><a href="https://zhaopin.ucloud.cn/" >加入我们</a></p> <p><a href="https://www.ucloud.cn/site/ucan/onlineclass/">UCan线上公开课</a></p> <p><a href="https://www.ucloud.cn/site/solutions.html" >行业解决方案</a></p> <p><a href="https://www.ucloud.cn/site/pro-notice/">产品动态</a></p> </li> <li> <h6>友情链接</h6> <p><a href="https://www.surfercloud.com/">SurferCloud</a></p> <p><a href="https://ucloudstack.com/" >私有云</a></p><p><a href="https://pinex.it" >pinex</a></p> <p><a href="https://www.renyucloud.com/" ></a></p> <p><a href="https://www.picpik.ai" >AI Art Generator</a></p> <p><a href="https://www.uwin-link.com" >工厂仿真软件</a></p> </li> <li> <h6>社区栏目</h6> <p><a href="https://www.ucloud.cn/yun/column/index.html">专栏文章</a></p> <p><a href="https://www.ucloud.cn/yun/ask/">专业问答</a></p> <p><a href="https://www.ucloud.cn/yun/kc.html">云学院</a></p> <p><a href="https://www.ucloud.cn/yun/udata/">专题地图</a></p> </li> <li> <h6>常见问题</h6> <p><a href="https://www.ucloud.cn/site/ucsafe/notice.html" >安全中心</a></p> <p><a href="https://www.ucloud.cn/site/about/news/recent/" >新闻动态</a></p> <p><a href="https://www.ucloud.cn/site/about/news/report/">媒体动态</a></p> <p><a href="https://www.ucloud.cn/site/cases.html">客户案例</a></p> <p><a href="https://www.ucloud.cn/site/notice/">公告</a></p> </li> <li> <span><img src="https://static.ucloud.cn/7a4b6983f4b94bcb97380adc5d073865.png" alt="优刻得"></span> <p>扫扫了解更多</p></div> </div> <div class="copyright">Copyright © 2012-2023 UCloud 优刻得科技股份有限公司<i>|</i><a rel="nofollow" href="http://beian.miit.gov.cn/">沪公网安备 31011002000058号</a><i>|</i><a rel="nofollow" href="http://beian.miit.gov.cn/"></a> 沪ICP备12020087号-3</a><i>|</i> <script type="text/javascript" src="https://gyfk12.kuaishang.cn/bs/ks.j?cI=197688&fI=125915" charset="utf-8"></script> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?290c2650b305fc9fff0dbdcafe48b59d"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-DZSMXQ3P9N"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-DZSMXQ3P9N'); </script> <script> (function(){ var el = document.createElement("script"); el.src = "https://lf1-cdn-tos.bytegoofy.com/goofy/ttzz/push.js?99f50ea166557aed914eb4a66a7a70a4709cbb98a54ecb576877d99556fb4bfc3d72cd14f8a76432df3935ab77ec54f830517b3cb210f7fd334f50ccb772134a"; el.id = "ttzz"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(el, s); })(window) </script></div> </div> </footer> </body> <script src="https://www.ucloud.cn/yun/static/theme/ukd/js/common.js"></script> <<script type="text/javascript"> $(".site-seo-depict *,.site-content-answer-body *,.site-body-depict *").css("max-width","100%"); </script> </html>