首页 文章 精选 留言 我的

精选列表

搜索[OS Agent],共10003篇文章
优秀的个人博客,低调大师

华为鸿蒙OS 尝鲜 (二)创建TV(JS)应用

1. 选择TV设备 列表模板(JS版本) ![] 2. 生成后JS版本部分如下: index.css 样式控制和平常css没啥两样 .container { flex-direction: row; justify-content: flex-start; align-items: flex-start; background-color: #000000; } .title { line-height: 60px; font-size: 48px; margin-bottom: 16px; color: #ffffff; margin-left: 48px; } .content_box { flex-direction: column; justify-content: flex-start; align-items: flex-start; width: 516px; margin-top: 24px; } .content-list { width: 516px; flex-direction: column; justify-content: flex-start; align-items: flex-start; flex-grow: 1; } .content-bar { flex-direction: row; justify-content: space-between; align-items: center; width: 420px; height: 48px; margin-left: 48px; margin-right: 48px; background-color: #808080; border-radius: 8px; } .content-bar-focus { flex-direction: row; justify-content: space-between; align-items: center; width: 420px; height: 48px; margin-left: 48px; margin-right: 48px; background-color: #ffffff; border-radius: 8px; } .bar-title { color: #ffffff; font-size: 24px; margin-left: 15px; } .bar-title-focus { color: #000000; font-size: 24px; margin-left: 15px; } .bar-more { flex-direction: row; justify-content: space-between; align-items: center; margin-right: 15px; width: 30px; height: 24px; } .bar-img { object-fit: contain; } .content_img { width: 444px; flex-direction: column; justify-content: flex-start; align-items: flex-end; } .img-box { margin-top: 160px; margin-right: 160px; background-color: #808080; width: 198px; height: 198px; } .img-img { object-fit: contain; width: 198px; height: 198px; } .text_box { width: 272px; justify-content: center; margin-right: 123px; margin-top: 12px; } .img-text { font-size: 24px; color: #ffffff; } index.hml 模板文件 <div class="container"> <div class="content_box"> <text class="title">{{Title}} </text> <list class="content-list"> <list-item type="listItem" class="{{list_item_class1}}" onfocus="focusFunc1" onblur="blurFunc1"> <text class="{{text_class1}}">{{$t('strings.list')}} 1 </text> <div class="bar-more"> <image class="bar-img" src="../../common/arrow.png"></image> </div> </list-item> <list-item type="divider" style="height: 12px"></list-item> <list-item type="listItem" class="{{list_item_class2}}" onfocus="focusFunc2" onblur="blurFunc2"> <text class="{{text_class2}}">{{$t('strings.list')}} 2 </text> <div class="bar-more"> <image class="bar-img" src="../../common/arrow.png"></image> </div> </list-item> <list-item type="divider" style="height: 12px"></list-item> <list-item type="listItem" class="{{list_item_class3}}" onfocus="focusFunc3" onblur="blurFunc3"> <text class="{{text_class3}}">{{$t('strings.list')}} 3 </text> <div class="bar-more"> <image class="bar-img" src="../../common/arrow.png"></image> </div> </list-item> <list-item type="divider" style="height: 12px"></list-item> <list-item type="listItem" class="{{list_item_class4}}" onfocus="focusFunc4" onblur="blurFunc4"> <text class="{{text_class4}}">{{$t('strings.list')}} 4 </text> <div class="bar-more"> <image class="bar-img" src="../../common/arrow.png"></image> </div> </list-item> <list-item type="divider" style="height: 12px"></list-item> <list-item type="listItem" class="{{list_item_class5}}" onfocus="focusFunc5" onblur="blurFunc5"> <text class="{{text_class5}}">{{$t('strings.list')}} 5 </text> <div class="bar-more"> <image class="bar-img" src="../../common/arrow.png"></image> </div> </list-item> <list-item type="divider" style="height: 12px"></list-item> <list-item type="listItem" class="{{list_item_class6}}" onfocus="focusFunc6" onblur="blurFunc6"> <text class="{{text_class6}}">{{$t('strings.list')}} 6 </text> <div class="bar-more"> <image class="bar-img" src="../../common/arrow.png"></image> </div> </list-item> </list> </div> <div class="content_img"> <div class="img-box"> <image class="img-img" src=""></image> </div> <div class="text_box"> <text class="img-text">{{$t('strings.img-text')}} </text> </div> </div> </div> index.js 脚本控制部分 export default { data: { Title: "", list_item_class1: "content-bar", text_class1: "bar-title", list_item_class2: "content-bar", text_class2: "bar-title", list_item_class3: "content-bar", text_class3: "bar-title", list_item_class4: "content-bar", text_class4: "bar-title", list_item_class5: "content-bar", text_class5: "bar-title", list_item_class6: "content-bar", text_class6: "bar-title", }, onInit (){ this.Title = this.$t('strings.title'); }, /* activated when the component has focus */ focusFunc1: function () { this.list_item_class1 = "content-bar-focus"; this.text_class1 = "bar-title-focus"; }, /* activated when the component loses focus */ blurFunc1: function () { this.list_item_class1 = "content-bar"; this.text_class1 = "bar-title"; }, focusFunc2: function () { this.list_item_class2 = "content-bar-focus"; this.text_class2 = "bar-title-focus"; }, blurFunc2: function () { this.list_item_class2 = "content-bar"; this.text_class2 = "bar-title"; }, focusFunc3: function () { this.list_item_class3 = "content-bar-focus"; this.text_class3 = "bar-title-focus"; }, blurFunc3: function () { this.list_item_class3 = "content-bar"; this.text_class3 = "bar-title"; }, focusFunc4: function () { this.list_item_class4 = "content-bar-focus"; this.text_class4 = "bar-title-focus"; }, blurFunc4: function () { this.list_item_class4 = "content-bar"; this.text_class4 = "bar-title"; }, focusFunc5: function () { this.list_item_class5 = "content-bar-focus"; this.text_class5 = "bar-title-focus"; }, blurFunc5: function () { this.list_item_class5 = "content-bar"; this.text_class5 = "bar-title"; }, focusFunc6: function () { this.list_item_class6 = "content-bar-focus"; this.text_class6 = "bar-title-focus"; }, blurFunc6: function () { this.list_item_class6 = "content-bar"; this.text_class6 = "bar-title"; } } 国际化(i18n)的支持: 从观看直播华为应该是对这块很重视帮助开发者“走出去”。 zh-CN.json { "strings":{ "title":"标题", "list": "栏目", "img-text":"显示图片" }, "Files":{ } } en-US.json { "strings":{ "title":"Title", "list": "List", "img-text":"Display Image" }, "Files":{ } } 3. 结尾 运行看效果: 这个和混合APP开发没啥太大区别(可能API,个别语法稍微不太一样)前端开发者应该能很快上手。

优秀的个人博客,低调大师

新服务器部署(Cent OS 阿里云)

新购入一台阿里云服务器,系统版本是CentOS 7.4,以下是搭建PHP环境的步骤 一、部署yum源 1、打开centos的yum文件夹 输入命令cd /etc/yum.repos.d/ 2、用wget下载repo文件 输入命令wget http://mirrors.aliyun.com/repo/Centos-7.repo 如果wget命令不生效,说明还没有安装wget工具,输入yum -y install wget回车进行安装。 当前目录是/etc/yum.repos.d/,刚刚下载的Centos-7.repo也在这个目录上 3、备份系统原来的repo文件 mv CentOS-Base.repo CentOS-Base.repo.bak 即是重命名 CentOS-Base.repo -> CentOS-Base.repo.bak 4、替换系统原理的repo文件 mv Centos-7.repo CentOS-Base.repo 即是重命名 Centos-7.repo -> CentOs-Base.repo 5、执行yum源更新命令 yum clean all yum makecache yum update 但是阿里云的源有时候缺很多东西 可以继续安装其他源 安装epel源 yum install epel-release 安装remi源 yum install -y http://rpms.famillecollet.com/enterprise/remi-release-7.rpm 然后进入到/etc/yum.repos.d/目录看一下源列表 yum repolist 二、yum源配好了下面就可以安装软件了 1、先随便安装个vim测试一下 yum install vim 下面开始安装PHP环境 2、安装PHP 通过search搜索合适的PHP源 yum search php7 这时候会列出一堆带php7的源,如果想更详细可以选php72或者php73等版本,如果发现没有从remi源里搜索 可以加上选择什么源 yum --enablerepo=remi search <keyword> 可以通过yum info <包名>查看包的具体版本等信息 依次执行安装php yum install php73 yum install php73-php-fpm 3、安装nginx,发现源里面的nginx版本比较旧,通过以下方式安装新的 wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm yum install nginx 4、接下来安装mysql 首先centOS 7 自带一个mariadb,需要卸载掉,否则会跟mysql冲突 rpm -qa | grep mariadb //列出来服务器上安装的mariadb包 rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64 //移除掉安装的包(包名从刚才的列表里粘贴) 依然是和nginx类似的步骤获取比较新的mysql 5.7版本 wget http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm rpm -Uvh mysql57-community-release-el7-7.noarch.rpm yum install mysql-community-server //安装服务端 mysql5.7之后的版本为了安全起见会随机生成一个初始密码放在/var/log/mysqld.log? 找到日志中的 > A temporary password is generated for root@localhost: 之类就是初始密码。 修改mysql密码 拿到初始密码之后,登录mysql修改密码 mysql -u root -p 1: 修改密码,必须有大小写,含数字特殊符号,长度8位及以上> SET PASSWORD = 'your password'; 2: 设置密码不过期;> ALTER USER root@localhost PASSWORD EXPIRE NEVER; 3: 刷新权限表;> flush privileges; 然后打开nginx配置目录 新建pksfc.conf server { listen 80; server_name www.pksfc.com; root /var/www/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { index index.html; if (!-e $request_filename) { rewrite ^(.*)$ /404.html last; break; } error_page 404 /var/www/html/404.html; } location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/var/run/php-fpm.sock; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; fastcgi_keep_conn on; fastcgi_connect_timeout 180; fastcgi_read_timeout 600; fastcgi_send_timeout 600; fastcgi_buffer_size 128k; fastcgi_buffers 8 64k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } } server { listen 443 ssl http2; server_name www.pksfc.com; root /var/www/html; ssl on; ssl_certificate /etc/nginx/1_www.pksfc.com_bundle.crt; ssl_certificate_key /etc/nginx/2_www.pksfc.com.key; ssl_ciphers HIGH:!aNULL:!MD5; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_dhparam /etc/nginx/ssl/dhparam.pem; add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload"; add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; location / { index index.html; if (!-e $request_filename) { rewrite ^(.*)$ /404.html last; break; } error_page 404 /var/www/html/404.html; } location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/var/run/php-fpm.sock; #fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; #include fastcgi_params; fastcgi_index index.php; fastcgi_connect_timeout 180; fastcgi_read_timeout 600; fastcgi_send_timeout 600; fastcgi_buffer_size 128k; fastcgi_buffers 8 64k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; #fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; fastcgi_keep_conn on; } } 然后restart nginx之后就可以通过域名去访问了 如果想设置开机自启动的话就执行下面的语句 chkconfig nginx on chkconfig php72-php-fpm on chkconfig supervisord on 5、最后一步补充PHP扩展,当你发现缺少了某些扩展的时候依然是通过以下命令 yum search php-mysql yum install -y php73-php-mysqlnd.x86_64 service php73-php-fpm restart 去搜索安装对应扩展并重启php-fpm服务 其他的如redis,mongodb,等参考上面例子安装即可 大功告成!!!

资源下载

更多资源
Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册