Code Monkey home page Code Monkey logo

Comments (7)

7MinSec avatar 7MinSec commented on July 18, 2024 1

This appears to be working - all I did was change <table> to <table style="white-space:nowrap;"> and the links look good now. Much appreciated!

from sysreptor.

aronmolnar avatar aronmolnar commented on July 18, 2024

Hi Brian,

I created you a sample code for such a table:

image

It uses the title and the affected_components field and also adds the page number to the table.
Rows are also linked.

<table>
    <thead>
        <tr>
            <th>Title</th>
            <th>Affected Assets</th>
            <th>Page</th>
        </tr>
    </thead>
    <tbody>
        <template v-for="finding in findings">
            <tr class="table-row-link">
                <td>
                    <a :href="'#' + finding.id">{{ finding.title }}</a>
                </td>
                <td>
                    <template v-if="finding.affected_components.length === 0"></template>
                    <template v-else-if="finding.affected_components.length === 1"><a :href="'#' + finding.id">{{ finding.affected_components[0] }}</a></template>
                    <template v-else>
                        <template v-for="s in finding.affected_components"><a :href="'#' + finding.id">{{ s }}</a></template>
                    </template>
                </td>	
                <td>
                    <a :href="'#' + finding.id" class="finding-pagenumber"></a>
                </td>
            </tr>
        </template>
    </tbody>
</table>

from sysreptor.

7MinSec avatar 7MinSec commented on July 18, 2024

Thank you! This is really close - there are two things I have questions about:

  • The affected assets show as one continuous string - i.e. "AffectedSite1.comAffectedSite2.com" - should they be comma-separated?

  • Page number column is there but no page numbers for each finding.

Sorry these might be super basic fixes, but I'm a code newb.

from sysreptor.

aronmolnar avatar aronmolnar commented on July 18, 2024

Hi,

For the page number you might not have a CSS element that I had. Add this to your CSS specs and it should work:

.finding-pagenumber::after {
    content: target-counter(attr(href), page);
    text-decoration: none;
    color: initial;
}

And I also missed to provide you the CSS snippet for table-row-link, which adds line breaks between your affected components:

tr.table-row-link a {
    display: block;
}

from sysreptor.

7MinSec avatar 7MinSec commented on July 18, 2024

NICE! This looks super great, much appreciated!

from sysreptor.

7MinSec avatar 7MinSec commented on July 18, 2024

Ah sorry one more small ask/tweak! In my table the affected asset field often looks like this:

www.domain.co
m

I tried to set table width to 100% in CSS but this doesn't help. It seems like the Title column wraps at around 45 characters, but I'd like to have it so the affected asset URL always stays in tact without wrapping:

www.domain.com

from sysreptor.

aronmolnar avatar aronmolnar commented on July 18, 2024

Can you try the white-space: nowrap; css style?
(See https://stackoverflow.com/a/1893764)

from sysreptor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.