Mirage

Inserting most downloaded items into XMLUI (DSpace 6.2)

一世执手 提交于 2021-02-07 08:31:29
问题 I am using XMLUI (Mirage) on DSpace 6.2 and am trying to insert the "Most Downloaded Items" into the home page. I have figured out the SOLR query for this, namely (in page-structure.xsl): <xsl:variable name="statsURL"> <xsl:text>http://localhost/solr/statistics</xsl:text> </xsl:variable> <xsl:apply-templates select="document(concat($statsURL,'/select?q=type:0+-isBot:true+statistics_type:view&wt=xml&indent=true&facet=true&facet.field=id&facet.sort=count&facet.limit=10'))" mode="mostdownloaded"

[Node.js] Mock an API for Local Development in React with Mirage JS

元气小坏坏 提交于 2020-08-19 20:51:28
Mirage JS lets you mock out production APIs directly alongside your frontend React code. You can tweak the data or force a network request to hang, so you can quickly design different states of your application. In this way Mirage lets you build every state of your UI regardless of the state of your production API. Check out Mirage's React quickstart here . // src/App.js import React, { useState, useEffect } from "react" import { Server } from "miragejs" let server = new Server() server.get("/api/users", { users: [{ id: 1, name: "Bob" }] }) export default function App() { let [users, setUsers]

kubernetes每个节点创建一个服务的Pod

大城市里の小女人 提交于 2020-03-02 03:49:18
1. 问题场景 希望一个worker节点上仅部署同样的服务一个. 比如: kubernets有三个worker节点,三个节点部署N个副本的api服务, 为了提高服务效率希望加入缓存,需要为三个节点个部署一个redis服务, 这个时候我们定义这个redis服务副本为3, 但是如何设置一个节点仅部署一个redis服务呢? 2. 相关知识 亲和性 k8s设计了亲和性来配置pod和node, pod和pod的关系, 即: Node affinity Inter-pod affinity and anti-affinity 思路 pod和node关系解决的pod选择node的场景, 这里不是解决本问题的关键, pod和pod的关系才是解决的关键, 只要让服务副本设置为3, 且每个node上redis的pod是互斥或者排他的选择即可, 如何设置同一个node上的pod互斥呢? 通过 Inter-pod affinity and anti-affinity 可以知道需要指定: topologyKey 具体配置结果 apiVersion: apps/v1 kind: Deployment metadata: name: redis spec: nodeSelector: matchLabels: service: mirage selector: matchLabels: service: