npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

enniot-firewall-conf

v0.0.2

Published

"根据需求修改防火墙的相关策略以及换成了最新的 table 组件"

Readme

目录结构

── enniot-firewall-conf
    ├── firewall.vue
    ├── README.md
    ├── firewall.schema.json
    └── package.json

Props

| 参数 | 说明 | 类型 | 可选值 | 默认值 | | ------ | ------------------------------------------------ | --------- | -------------------- | ------ | | ref | 用于父组件调用子组件的变量和方法 | string | InStation/OutStation | — | | model | table 有关 api 的组件 url 参数以及重写方法的传入 | dataModel | — | — | | schema | table 新增以及编辑 form 框中的数据格式的渲染 | json | — | — |

Fields

| 参数 | 说明 | 类型 | 可选值 | 默认值 | | -------------- | ----------------- | ------- | -------------------------------- | ------ | | id | ID | int | 1 | 1 | | gateway_id | 网关 id(可去掉) | int | 1 | 1 | | enabled | 规则行为 | Boolean | true/false | — | | card | 模块型号 | string | "WAN"/"LAN" | — | | ip_address | IP 地址 | string | — | — | | server_type | 服务类型 | string | TELNET/SSH/TFTP/FTP/ICMP/TCP/UDP | — | | direction_type | 策略类型 | string | 入站/出站 | — |

Usage

<template>
  <el-row
    :gutter="2"
    style="margin-left: 20px;"
  >
    <StationTable
      ref="Station"
      :schema="firwallSchema"
      :model="StationModel"
    >
      <template v-slot:action="{ record }">
        <span>
          <el-switch
            v-model="record.enabled"
            @change="ruleSwitched(record)"
          />
        </span>
      </template>
    </StationTable>
  </el-row>
</template>

<script>
import StationTable from '@/component/table.vue';
import DataModel from '@/component/data-model';
import baseUrl from '@/service/api';
import firwallSchema from './firewall.schema.json';

export default {
  name: 'Firewall',
  components: {
    StationTable,
  },
  data() {
    const StationModel = new DataModel({
      createApi: `${baseUrl}/api/firewall`,
      deleteApi: `${baseUrl}/api/firewall/:id`,
      updateApi: `${baseUrl}/api/firewall/:id`,
      getListApi: `${baseUrl}/api/firewall`,
    });
    return {
      firwallSchema,
      StationModel,
    };
  },
  methods: {
    async ruleSwitched(rule) {
      const ruleApi = `${baseUrl}/api/firewall/${rule.id}/enabled`;
      const rulForm = { enabled: rule.enabled };
      await this.$api.put(ruleApi, rulForm);
    },
  },
};
</script>

其中 data-model 中封装的有多种 api 的请求方法,可以接受重写函数作为参数的传入。