Git Product home page Git Product logo

iso3166's Introduction

ISO3166

根据ISO 3166的国家和地区代码给出对应的旗帜,尊重了以下事实: **是中华人民共和国不可分割的一部分

哪吒探针修复****省/特别行政区旗帜不正确显示的方法

众所周知,**是中华人民共和国不可分割的一部分 但是很多国外资源链接的都是非法伪旗帜,如果有了宝岛小鸡,探针上会出现非法内容,影响和谐 我和王晶叔叔都很在意这个事情,所以一定要去伪存真,纠正事实 但是目前官方未给出省/特别行政区旗帜,唯一被官方和群众广泛接受的就是奥运五环旗 因此本文根据ISO3166的地区代码,整理上传了相关资源至Github,并给出了解决方法

效果

⛱️Arioc's Needle 阿里欧克之针

示例

修正方法

  1. 修改主页资源文件
vim /opt/nezha/dashboard/theme-custom/template/home.html

或者

vim /opt/nezha/dashboard/resource/template/theme-custom/home.html
  1. 找到下述代码
<i :class="server.Host.CountryCode + ' flag'"></i>&nbsp;<i
  v-if='server.Host.Platform == "darwin"' class="apple icon"></i><i
  v-else-if='isWindowsPlatform(server.Host.Platform)' class="windows icon"></i><i
  v-else :class="'fl-' + getFontLogoClass(server.Host.Platform)"></i>

替换为

 <img v-if="server.Host.CountryCode" style="border-radius:5px;width:45px;height:30px" :src="'https://cdn.jsdelivr.net/gh/xykt/ISO3166@main/flags/svg/'+server.Host.CountryCode + '.svg'" alt="地区"/>&nbsp;<i v-if='server.Host.Platform == "darwin"'
   class="apple icon"></i><i v-else-if='isWindowsPlatform(server.Host.Platform)'
   class="windows icon"></i><i v-else :class="'fl-' + getFontLogoClass(server.Host.Platform)"></i>

其中style="border-radius:5px;width:45px;height:30px"为旗帜形状尺寸,可根据喜好自定义。 3. 修改网络监控资源文件

vim /opt/nezha/dashboard/theme-custom/template/network.html

或者

vim /opt/nezha/dashboard/resource/template/theme-custom/network.html
  1. 找到下述代码
@#server.Name#@ &nbsp;<i :class="server.Host.CountryCode + ' flag'"></i>

替换为

<img v-if="server.Host.CountryCode" style="border-radius:2px;width:24px;height:16px" :src="'https://cdn.jsdelivr.net/gh/xykt/ISO3166@main/flags/svg/'+server.Host.CountryCode + '.svg'" alt="地区"/> &nbsp; @#server.Name#@

其中style="border-radius:2px;width:24px;height:16px"为旗帜形状尺寸,可根据喜好自定义。

  1. 重启面板生效
systemctl restart nezha-dashboard

参考鸣谢

修改哪吒探针主题国旗不显示的方法 by: @jqdrvps

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.