Restructure frontend svelte file src folder

- Goal: Dependency structure mirrored in file structure
This commit is contained in:
Christoph Kluge 2024-07-26 12:34:18 +02:00
parent 18369da5bc
commit 3ca1127685
52 changed files with 142 additions and 109 deletions

View File

@ -6,7 +6,6 @@
--> -->
<script> <script>
import { init, convert2uplot } from "./utils.js";
import { getContext, onMount } from "svelte"; import { getContext, onMount } from "svelte";
import { import {
queryStore, queryStore,
@ -22,14 +21,18 @@
Table, Table,
Icon, Icon,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import Filters from "./filters/Filters.svelte"; import {
import PlotSelection from "./PlotSelection.svelte"; init,
import Histogram from "./plots/Histogram.svelte"; convert2uplot,
import Pie, { colors } from "./plots/Pie.svelte"; binsFromFootprint,
import { binsFromFootprint } from "./utils.js"; } from "./generic/utils.js";
import ScatterPlot from "./plots/Scatter.svelte"; import PlotSelection from "./analysis/PlotSelection.svelte.js";
import PlotTable from "./PlotTable.svelte"; import Filters from "./generic/Filters.svelte";
import RooflineHeatmap from "./plots/RooflineHeatmap.svelte"; import PlotTable from "./generic/PlotTable.svelte";
import Histogram from "./generic/plots/Histogram.svelte";
import Pie, { colors } from "./generic/plots/Pie.svelte";
import ScatterPlot from "./generic/plots/Scatter.svelte";
import RooflineHeatmap from "./generic/plots/RooflineHeatmap.svelte";
const { query: initq } = init(); const { query: initq } = init();

View File

@ -9,7 +9,6 @@
<script> <script>
import { Card, CardHeader, CardTitle } from "@sveltestrap/sveltestrap"; import { Card, CardHeader, CardTitle } from "@sveltestrap/sveltestrap";
import UserSettings from "./config/UserSettings.svelte"; import UserSettings from "./config/UserSettings.svelte";
import AdminSettings from "./config/AdminSettings.svelte"; import AdminSettings from "./config/AdminSettings.svelte";

View File

@ -20,8 +20,8 @@
DropdownToggle, DropdownToggle,
DropdownMenu, DropdownMenu,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import NavbarLinks from "./NavbarLinks.svelte"; import NavbarLinks from "./header/NavbarLinks.svelte";
import NavbarTools from "./NavbarTools.svelte"; import NavbarTools from "./header/NavbarTools.svelte";
export let username; export let username;
export let authlevel; export let authlevel;

View File

@ -9,12 +9,6 @@
--> -->
<script> <script>
import {
init,
groupByScope,
checkMetricDisabled,
transformDataForRoofline,
} from "./utils.js";
import { import {
queryStore, queryStore,
gql, gql,
@ -33,16 +27,22 @@
Button, Button,
Icon, Icon,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import PlotTable from "./PlotTable.svelte";
import Metric from "./Metric.svelte";
import Polar from "./plots/Polar.svelte";
import Roofline from "./plots/Roofline.svelte";
import JobInfo from "./joblist/JobInfo.svelte";
import TagManagement from "./TagManagement.svelte";
import MetricSelection from "./MetricSelection.svelte";
import StatsTable from "./StatsTable.svelte";
import JobFootprint from "./JobFootprint.svelte";
import { getContext } from "svelte"; import { getContext } from "svelte";
import {
init,
groupByScope,
checkMetricDisabled,
transformDataForRoofline,
} from "./generic/utils.js";
import Metric from "./job/Metric.svelte.js";
import TagManagement from "./job/TagManagement.svelte.js";
import StatsTable from "./job/StatsTable.svelte.js";
import JobFootprint from "./generic/helper/JobFootprint.svelte";
import PlotTable from "./generic/PlotTable.svelte";
import Polar from "./generic/plots/Polar.svelte";
import Roofline from "./generic/plots/Roofline.svelte";
import JobInfo from "./generic/joblist/JobInfo.svelte";
import MetricSelection from "./generic/select/MetricSelection.svelte";
export let dbid; export let dbid;
export let authlevel; export let authlevel;

View File

@ -9,7 +9,6 @@
<script> <script>
import { onMount, getContext } from "svelte"; import { onMount, getContext } from "svelte";
import { init } from "./utils.js";
import { import {
Row, Row,
Col, Col,
@ -18,12 +17,13 @@
Card, Card,
Spinner, Spinner,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import Filters from "./filters/Filters.svelte"; import { init } from "./generic/utils.js";
import JobList from "./joblist/JobList.svelte"; import Filters from "./generic/Filters.svelte";
import Refresher from "./joblist/Refresher.svelte"; import JobList from "./generic/JobList.svelte";
import Sorting from "./joblist/SortSelection.svelte"; import TextFilter from "./generic/helper/TextFilter.svelte";
import MetricSelection from "./MetricSelection.svelte"; import Refresher from "./generic/helper/Refresher.svelte";
import TextFilter from "./filters/TextFilter.svelte"; import Sorting from "./generic/select/SortSelection.svelte";
import MetricSelection from "./generic/select/MetricSelection.svelte";
const { query: initq } = init(); const { query: initq } = init();

View File

@ -8,7 +8,6 @@
<script> <script>
import { onMount } from "svelte"; import { onMount } from "svelte";
import { init, scramble, scrambleNames } from "./utils.js";
import { import {
Row, Row,
Col, Col,
@ -20,8 +19,17 @@
InputGroup, InputGroup,
Input, Input,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import Filters from "./filters/Filters.svelte"; import {
import { queryStore, gql, getContextClient } from "@urql/svelte"; queryStore,
gql,
getContextClient,
} from "@urql/svelte";
import {
init,
scramble,
scrambleNames,
} from "./generic/utils.js";
import Filters from "./generic/Filters.svelte";
const {} = init(); const {} = init();

View File

@ -9,7 +9,7 @@
--> -->
<script> <script>
import { init, checkMetricDisabled } from "./utils.js"; import { getContext } from "svelte";
import { import {
Row, Row,
Col, Col,
@ -19,12 +19,19 @@
Spinner, Spinner,
Card, Card,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { queryStore, gql, getContextClient } from "@urql/svelte"; import {
import TimeSelection from "./filters/TimeSelection.svelte"; queryStore,
import Refresher from "./joblist/Refresher.svelte"; gql,
import PlotTable from "./PlotTable.svelte"; getContextClient,
import MetricPlot from "./plots/MetricPlot.svelte"; } from "@urql/svelte";
import { getContext } from "svelte"; import {
init,
checkMetricDisabled,
} from "./utils.js";
import PlotTable from "./generic/PlotTable.svelte";
import MetricPlot from "./generic/plots/MetricPlot.svelte";
import TimeSelection from "./generic/select/TimeSelection.svelte";
import Refresher from "./generic/helper/Refresher.svelte";
export let cluster; export let cluster;
export let hostname; export let hostname;

View File

@ -7,10 +7,6 @@
<script> <script>
import { getContext } from "svelte"; import { getContext } from "svelte";
import Refresher from "./joblist/Refresher.svelte";
import Roofline from "./plots/Roofline.svelte";
import Pie, { colors } from "./plots/Pie.svelte";
import Histogram from "./plots/Histogram.svelte";
import { import {
Row, Row,
Col, Col,
@ -24,20 +20,24 @@
Icon, Icon,
Button, Button,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import {
init,
convert2uplot,
transformPerNodeDataForRoofline,
} from "./utils.js";
import { scaleNumbers } from "./units.js";
import { import {
queryStore, queryStore,
gql, gql,
getContextClient, getContextClient,
mutationStore, mutationStore,
} from "@urql/svelte"; } from "@urql/svelte";
import PlotTable from "./PlotTable.svelte"; import {
import HistogramSelection from "./HistogramSelection.svelte"; init,
convert2uplot,
transformPerNodeDataForRoofline,
} from "./generic/utils.js";
import { scaleNumbers } from "./generic/units.js";
import PlotTable from "./generic/PlotTable.svelte";
import Roofline from "./generic/plots/Roofline.svelte";
import Pie, { colors } from "./generic/plots/Pie.svelte";
import Histogram from "./generic/plots/Histogram.svelte";
import Refresher from "./generic/helper/Refresher.svelte";
import HistogramSelection from "./generic/select/HistogramSelection.svelte";
const { query: initq } = init(); const { query: initq } = init();
const ccconfig = getContext("cc-config"); const ccconfig = getContext("cc-config");

View File

@ -8,8 +8,7 @@
--> -->
<script> <script>
import { init, checkMetricDisabled } from "./utils.js"; import { getContext } from "svelte";
import Refresher from "./joblist/Refresher.svelte";
import { import {
Row, Row,
Col, Col,
@ -20,11 +19,19 @@
Spinner, Spinner,
Card, Card,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { queryStore, gql, getContextClient } from "@urql/svelte"; import {
import TimeSelection from "./filters/TimeSelection.svelte"; queryStore,
import PlotTable from "./PlotTable.svelte"; gql,
import MetricPlot from "./plots/MetricPlot.svelte"; getContextClient,
import { getContext } from "svelte"; } from "@urql/svelte";
import {
init,
checkMetricDisabled,
} from "./generic/utils.js";
import PlotTable from "./generic/PlotTable.svelte";
import MetricPlot from "./generic/plots/MetricPlot.svelte";
import TimeSelection from "./generic/select/TimeSelection.svelte";
import Refresher from "./generic/helper/Refresher.svelte";
export let cluster; export let cluster;
export let from = null; export let from = null;

View File

@ -8,7 +8,6 @@
<script> <script>
import { onMount, getContext } from "svelte"; import { onMount, getContext } from "svelte";
import { init, convert2uplot, scramble, scrambleNames } from "./utils.js";
import { import {
Table, Table,
Row, Row,
@ -18,16 +17,26 @@
Card, Card,
Spinner, Spinner,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { queryStore, gql, getContextClient } from "@urql/svelte"; import {
import Filters from "./filters/Filters.svelte"; queryStore,
import TextFilter from "./filters/TextFilter.svelte" gql,
import JobList from "./joblist/JobList.svelte"; getContextClient,
import Sorting from "./joblist/SortSelection.svelte"; } from "@urql/svelte";
import Refresher from "./joblist/Refresher.svelte"; import {
import Histogram from "./plots/Histogram.svelte"; init,
import MetricSelection from "./MetricSelection.svelte"; convert2uplot,
import HistogramSelection from "./HistogramSelection.svelte"; scramble,
import PlotTable from "./PlotTable.svelte"; scrambleNames,
} from "./generic/utils.js";
import JobList from "./generic/JobList.svelte";
import Filters from "./generic/Filters.svelte";
import PlotTable from "./generic/PlotTable.svelte";
import Histogram from "./generic/plots/Histogram.svelte";
import MetricSelection from "./generic/select/MetricSelection.svelte";
import HistogramSelection from "./generic/select/HistogramSelection.svelte";
import Sorting from "./generic/select/SortSelection.svelte";
import TextFilter from "./generic/helper/TextFilter.svelte"
import Refresher from "./generic/helper/Refresher.svelte";
const { query: initq } = init(); const { query: initq } = init();

View File

@ -8,7 +8,7 @@
<script> <script>
import { Button } from "@sveltestrap/sveltestrap"; import { Button } from "@sveltestrap/sveltestrap";
import { fetchJwt } from "../../utils.js" import { fetchJwt } from "../../generic/utils.js"
export let user; export let user;

View File

@ -23,7 +23,7 @@
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { fade } from "svelte/transition"; import { fade } from "svelte/transition";
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import { fetchJwt } from "../../utils.js"; import { fetchJwt } from "../../generic/utils.js";
export let config; export let config;
export let message; export let message;

View File

@ -15,6 +15,7 @@
--> -->
<script> <script>
import { createEventDispatcher } from "svelte";
import { import {
Row, Row,
Col, Col,
@ -24,16 +25,15 @@
ButtonDropdown, ButtonDropdown,
Icon, Icon,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { createEventDispatcher } from "svelte"; import Tag from "./helper/Tag.svelte";
import Info from "./InfoBox.svelte"; import Info from "./filters/InfoBox.svelte";
import Cluster from "./Cluster.svelte"; import Cluster from "./filters/Cluster.svelte";
import JobStates, { allJobStates } from "./JobStates.svelte"; import JobStates, { allJobStates } from "./filters/JobStates.svelte";
import StartTime from "./StartTime.svelte"; import StartTime from "./filters/StartTime.svelte";
import Tags from "./Tags.svelte"; import Tags from "./filters/Tags.svelte";
import Tag from "../Tag.svelte"; import Duration from "./filters/Duration.svelte";
import Duration from "./Duration.svelte"; import Resources from "./filters/Resources.svelte";
import Resources from "./Resources.svelte"; import Statistics from "./filters/Stats.svelte";
import Statistics from "./Stats.svelte";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();

View File

@ -14,17 +14,17 @@
--> -->
<script> <script>
import { getContext } from "svelte";
import { import {
queryStore, queryStore,
gql, gql,
getContextClient, getContextClient,
mutationStore, mutationStore,
} from "@urql/svelte"; } from "@urql/svelte";
import { getContext } from "svelte";
import { Row, Table, Card, Spinner } from "@sveltestrap/sveltestrap"; import { Row, Table, Card, Spinner } from "@sveltestrap/sveltestrap";
import Pagination from "./Pagination.svelte"; import { stickyHeader } from "./utils.js";
import JobListRow from "./Row.svelte"; import Pagination from "./joblist/Pagination.svelte";
import { stickyHeader } from "../utils.js"; import JobListRow from "./joblist/JobListRow.svelte";
const ccconfig = getContext("cc-config"), const ccconfig = getContext("cc-config"),
initialized = getContext("initialized"), initialized = getContext("initialized"),

View File

@ -25,7 +25,7 @@
ModalHeader, ModalHeader,
ModalFooter, ModalFooter,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import DoubleRangeSlider from "./DoubleRangeSlider.svelte"; import DoubleRangeSlider from "../select/DoubleRangeSlider.svelte";
const clusters = getContext("clusters"), const clusters = getContext("clusters"),
initialized = getContext("initialized"), initialized = getContext("initialized"),

View File

@ -20,7 +20,7 @@
ModalHeader, ModalHeader,
ModalFooter, ModalFooter,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import DoubleRangeSlider from "./DoubleRangeSlider.svelte"; import DoubleRangeSlider from "../select/DoubleRangeSlider.svelte";
const initialized = getContext("initialized"), const initialized = getContext("initialized"),
dispatch = createEventDispatcher(); dispatch = createEventDispatcher();

View File

@ -24,7 +24,7 @@
Icon, Icon,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { fuzzySearchTags } from "../utils.js"; import { fuzzySearchTags } from "../utils.js";
import Tag from "../Tag.svelte"; import Tag from "../helper/Tag.svelte";
const allTags = getContext("tags"), const allTags = getContext("tags"),
initialized = getContext("initialized"), initialized = getContext("initialized"),

View File

@ -7,9 +7,9 @@
--> -->
<script> <script>
import Tag from "../Tag.svelte";
import { Badge, Icon } from "@sveltestrap/sveltestrap"; import { Badge, Icon } from "@sveltestrap/sveltestrap";
import { scrambleNames, scramble } from "../utils.js"; import { scrambleNames, scramble } from "../utils.js";
import Tag from "../helper/Tag.svelte";
export let job; export let job;
export let jobTags = job.tags; export let jobTags = job.tags;

View File

@ -14,10 +14,10 @@
import { queryStore, gql, getContextClient } from "@urql/svelte"; import { queryStore, gql, getContextClient } from "@urql/svelte";
import { getContext } from "svelte"; import { getContext } from "svelte";
import { Card, Spinner } from "@sveltestrap/sveltestrap"; import { Card, Spinner } from "@sveltestrap/sveltestrap";
import MetricPlot from "../plots/MetricPlot.svelte";
import JobInfo from "./JobInfo.svelte";
import JobFootprint from "../JobFootprint.svelte";
import { maxScope, checkMetricDisabled } from "../utils.js"; import { maxScope, checkMetricDisabled } from "../utils.js";
import JobInfo from "./JobInfo.svelte";
import MetricPlot from "../plots/MetricPlot.svelte";
import JobFootprint from "../helper/JobFootprint.svelte";
export let job; export let job;
export let metrics; export let metrics;

View File

@ -4,7 +4,7 @@ Originally created by Michael Keller (https://github.com/mhkeller/svelte-double-
Changes: remove dependency, text inputs, configurable value ranges, on:change event Changes: remove dependency, text inputs, configurable value ranges, on:change event
--> -->
<!-- <!--
@component Helper component to display range selections via min and max double-sliders @component Selector component to display range selections via min and max double-sliders
Properties: Properties:
- min: Number - min: Number

View File

@ -8,6 +8,7 @@
--> -->
<script> <script>
import { getContext } from "svelte";
import { import {
Modal, Modal,
ModalBody, ModalBody,
@ -17,7 +18,6 @@
ListGroup, ListGroup,
ListGroupItem, ListGroupItem,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { getContext } from "svelte";
import { gql, getContextClient, mutationStore } from "@urql/svelte"; import { gql, getContextClient, mutationStore } from "@urql/svelte";
export let cluster; export let cluster;

View File

@ -12,6 +12,7 @@
--> -->
<script> <script>
import { getContext } from "svelte";
import { import {
Modal, Modal,
ModalBody, ModalBody,
@ -20,7 +21,6 @@
Button, Button,
ListGroup, ListGroup,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { getContext } from "svelte";
import { gql, getContextClient, mutationStore } from "@urql/svelte"; import { gql, getContextClient, mutationStore } from "@urql/svelte";
export let metrics; export let metrics;

View File

@ -7,6 +7,7 @@
--> -->
<script> <script>
import { getContext } from "svelte";
import { import {
Icon, Icon,
Button, Button,
@ -17,7 +18,6 @@
ModalHeader, ModalHeader,
ModalFooter, ModalFooter,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { getContext } from "svelte";
import { getSortItems } from "../utils.js"; import { getSortItems } from "../utils.js";
export let isOpen = false; export let isOpen = false;

View File

@ -1,5 +1,5 @@
<!-- <!--
@component Filter sub-component for selecting specified real time ranges for data cutoff; used in systems and nodes view @component Selector for specified real time ranges for data cutoff; used in systems and nodes view
Properties: Properties:
- `from Date`: The datetime to start data display from - `from Date`: The datetime to start data display from
@ -12,13 +12,13 @@
--> -->
<script> <script>
import { createEventDispatcher } from "svelte";
import { import {
Icon, Icon,
Input, Input,
InputGroup, InputGroup,
InputGroupText, InputGroupText,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { createEventDispatcher } from "svelte";
export let from; export let from;
export let to; export let to;

View File

@ -14,14 +14,14 @@
<script> <script>
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";
import Timeseries from "./plots/MetricPlot.svelte";
import { import {
InputGroup, InputGroup,
InputGroupText, InputGroupText,
Spinner, Spinner,
Card, Card,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { minScope } from "./utils"; import { minScope } from "../generic/utils";
import Timeseries from "../generic/plots/MetricPlot.svelte";
export let job; export let job;
export let metricName; export let metricName;

View File

@ -15,9 +15,9 @@
InputGroupText, InputGroupText,
Icon, Icon,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import MetricSelection from "./MetricSelection.svelte"; import { maxScope } from "../generic/utils.js";
import StatsTableEntry from "./StatsTableEntry.svelte"; import StatsTableEntry from "./StatsTableEntry.svelte";
import { maxScope } from "./utils.js"; import MetricSelection from "../generic/Select/MetricSelection.svelte";
export let job; export let job;
export let jobMetrics; export let jobMetrics;

View File

@ -20,8 +20,8 @@
ModalFooter, ModalFooter,
Alert, Alert,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { fuzzySearchTags } from "./utils.js"; import { fuzzySearchTags } from "../generic/utils.js";
import Tag from "./Tag.svelte"; import Tag from "../generic/helper/Tag.svelte";
export let job; export let job;
export let jobTags = job.tags; export let jobTags = job.tags;