3 <div class="card" :class="item.class">
4 <a :href="item.url" :target="item.target" rel="noreferrer">
5 <div class="card-content">
7 <div v-if="item.logo" class="media-left">
8 <figure class="image is-48x48">
9 <img :src="item.logo" :alt="`${item.name} logo`" />
12 <div v-if="item.icon" class="media-left">
13 <figure class="image is-48x48">
14 <i style="font-size: 35px" :class="['fa-fw', item.icon]"></i>
17 <div class="media-content">
18 <p class="title is-4">{{ item.name }}</p>
19 <p class="subtitle is-6">
20 <template v-if="item.subtitle">
23 <template v-else-if="stats">
24 {{ percentage }}% blocked
28 <div class="status" :class="protection">
32 <div class="tag" :class="item.tagstyle" v-if="item.tag">
33 <strong class="tag-text">#{{ item.tag }}</strong>
54 percentage: function () {
57 (this.stats.num_blocked_filtering * 100) /
58 this.stats.num_dns_queries
63 protection: function () {
65 return this.status.protection_enabled ? "enabled" : "disabled";
66 } else return "unknown";
69 created: function () {
71 if (!this.item.subtitle) {
76 fetchStatus: async function () {
77 this.status = await fetch(`${this.item.url}/control/status`, {
78 credentials: "include",
80 .then((response) => response.json())
81 .catch((e) => console.log(e));
83 fetchStats: async function () {
84 this.stats = await fetch(`${this.item.url}/control/stats`, {
85 credentials: "include",
87 .then((response) => response.json())
88 .catch((e) => console.log(e));
94 <style scoped lang="scss">
100 color: var(--text-title);
103 background-color: #94e185;
104 border-color: #78d965;
105 box-shadow: 0px 0px 4px 1px #94e185;
109 background-color: #c9404d;
110 border-color: #c42c3b;
111 box-shadow: 0px 0px 4px 1px #c9404d;
115 background-color: #c9c740;
116 border-color: #ccc935;
117 box-shadow: 0px 0px 4px 1px #c9c740;
122 display: inline-block;
126 border: 1px solid #000;