Unverified Commit 987b4017 authored by Kevin Di Lallo's avatar Kevin Di Lallo Committed by GitHub
Browse files

Merge pull request #72 from dilallkx/kd_sp39_dev_help

Platform usage links (help buttons) in frontend
parents 8d621e08 b17a82ae
Loading
Loading
Loading
Loading

dashboards/basic-dashboards.json

deleted100755 → 0
+0 −109

File deleted.

Preview size limit exceeded, changes collapsed.

dashboards/dashboards.conf

deleted100644 → 0
+0 −7
Original line number Diff line number Diff line
#defaultIndex is a reserved value
#lines starting with a '#' are ignored when parsed

defaultIndex: 27b98a60-bb57-11e8-a056-d1ed6789004e
basic: <GITDIR>/dashboards/basic-dashboards.json
demo1: <GITDIR>/examples/demo1/demo1-dashboards.json
#k8s: https://raw.githubusercontent.com/monotek/kibana-dashboards/master/k8s-fluentd-elasticsearch.json
+78 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020  InterDigital Communications, Inc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cmd

import (
	"context"
	"encoding/json"
	"fmt"

	"github.com/ghodss/yaml"
	"github.com/spf13/cobra"
)

// replayStatusCmd represents the replay status command
var replayStatusCmd = &cobra.Command{
	Use:     "status",
	Short:   "Retrieve replay status",
	Long:    "Retrieve replay execution status from backend.",
	Example: "meepctl replay status",
	Run: func(cmd *cobra.Command, args []string) {
		v, _ := cmd.Flags().GetBool("verbose")
		if v {
			fmt.Println("Replay status called")
			fmt.Println("[flag] verbose:", v)
		}
		replayStatus(cmd)
	},
}

func init() {
	replayCmd.AddCommand(replayStatusCmd)
}

func replayStatus(cobraCmd *cobra.Command) {
	verbose, _ := cobraCmd.Flags().GetBool("verbose")

	client, err := createClient(getBasePath())
	if err != nil {
		printError("Error creating client: ", err, verbose)
		return
	}

	status, _, err := client.EventReplayApi.GetReplayStatus(context.TODO())
	if err != nil {
		if err.Error() == "404 Not Found" {
			fmt.Println("Replay file not running...")
		} else {
			printError("Error: ", err, verbose)
		}
	} else {
		json, err := json.Marshal(status)
		if err != nil {
			printError("Error: ", err, verbose)
		}

		jsonToYaml, err := yaml.JSONToYAML(json)
		if err != nil {
			printError("Error converting JSON to YAML: ", err, verbose)
			return
		}

		fmt.Println(string(jsonToYaml))
	}
}
+2 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ import { NO_SCENARIO_NAME, MEEP_LBL_SCENARIO_NAME } from '../meep-constants';
const HeadlineBar = ({ titleLabel, scenarioName }) => {
  var name = scenarioName === NO_SCENARIO_NAME ? 'None' : scenarioName;
  return (
    <div style={{ marginTop: 14, marginBottom: 14 }}>
    <>
      <span className="mdc-typography--headline6">{titleLabel}: </span>
      <span
        data-cy={MEEP_LBL_SCENARIO_NAME}
@@ -29,7 +29,7 @@ const HeadlineBar = ({ titleLabel, scenarioName }) => {
      >
        {name}
      </span>
    </div>
    </>
  );
};

+2 −2
Original line number Diff line number Diff line
@@ -591,9 +591,9 @@ class CfgPageContainer extends Component {
                      scenarioName={this.props.scenarioName}
                    />
                  </GridCell>
                  <GridCell span={8}>
                  <GridCell align={'middle'} span={8}>
                    <GridInner align={'right'}>
                      <GridCell align={'middle'} span={12}>
                      <GridCell span={12}>
                        <CfgPageScenarioButtons
                          {...this.props}
                          onDeleteScenario={() => {
Loading